From brukman at cs.uiuc.edu Mon Jul 21 11:35:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Jul 21 11:35:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp Message-ID: <200307211634.LAA30597@zion.cs.uiuc.edu> Changes in directory llvm/lib/CWriter: Writer.cpp updated: 1.106 -> 1.107 --- Log message: Eliminated dead code. --- Diffs of the changes: Index: llvm/lib/CWriter/Writer.cpp diff -u llvm/lib/CWriter/Writer.cpp:1.106 llvm/lib/CWriter/Writer.cpp:1.107 --- llvm/lib/CWriter/Writer.cpp:1.106 Wed Jul 9 12:33:50 2003 +++ llvm/lib/CWriter/Writer.cpp Mon Jul 21 11:34:35 2003 @@ -280,7 +280,7 @@ ptrName = "(" + ptrName + ")"; // return printType(Out, PTy->getElementType(), ptrName); - }Out <<"--"; + } case Type::ArrayTyID: { const ArrayType *ATy = cast(Ty); From lattner at cs.uiuc.edu Mon Jul 21 14:07:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jul 21 14:07:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Makefile Message-ID: <200307211907.OAA03024@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer: Makefile updated: 1.12 -> 1.13 --- Log message: Remove gross hack --- Diffs of the changes: Index: llvm/lib/Reoptimizer/Makefile diff -u llvm/lib/Reoptimizer/Makefile:1.12 llvm/lib/Reoptimizer/Makefile:1.13 --- llvm/lib/Reoptimizer/Makefile:1.12 Fri Jul 18 12:38:40 2003 +++ llvm/lib/Reoptimizer/Makefile Mon Jul 21 14:06:50 2003 @@ -3,7 +3,5 @@ include $(LEVEL)/Makefile.config ifeq ($(ARCH),Sparc) DIRS = Mapping TraceCache LightWtProfiling ScratchMemory -else -DIRS = LightWtProfiling/Instrument endif include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Mon Jul 21 14:07:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jul 21 14:07:04 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/LightWtProfiling/Makefile Message-ID: <200307211906.OAA02835@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/LightWtProfiling: Makefile updated: 1.1 -> 1.2 --- Log message: No more instrument directory --- Diffs of the changes: Index: llvm/lib/Reoptimizer/LightWtProfiling/Makefile diff -u llvm/lib/Reoptimizer/LightWtProfiling/Makefile:1.1 llvm/lib/Reoptimizer/LightWtProfiling/Makefile:1.2 --- llvm/lib/Reoptimizer/LightWtProfiling/Makefile:1.1 Sat Nov 2 19:44:09 2002 +++ llvm/lib/Reoptimizer/LightWtProfiling/Makefile Mon Jul 21 14:06:29 2003 @@ -1,4 +1,4 @@ LEVEL = ../../.. -DIRS = Instrument Trigger +DIRS = Trigger include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Mon Jul 21 14:07:05 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jul 21 14:07:05 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/LightWtProfiling/Instrument/Makefile Message-ID: <200307211906.OAA02820@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/LightWtProfiling/Instrument: Makefile (r1.1) removed --- Log message: Move code to lib/Transforms/Instrumentation --- Diffs of the changes: From lattner at cs.uiuc.edu Mon Jul 21 14:08:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jul 21 14:08:01 2003 Subject: [llvm-commits] CVS: llvm/tools/opt/Makefile Message-ID: <200307211907.OAA03169@apoc.cs.uiuc.edu> Changes in directory llvm/tools/opt: Makefile updated: 1.42 -> 1.43 --- Log message: Remove instloops library --- Diffs of the changes: Index: llvm/tools/opt/Makefile diff -u llvm/tools/opt/Makefile:1.42 llvm/tools/opt/Makefile:1.43 --- llvm/tools/opt/Makefile:1.42 Fri Jul 18 11:25:40 2003 +++ llvm/tools/opt/Makefile Mon Jul 21 14:07:27 2003 @@ -4,7 +4,7 @@ USEDLIBS = bcreader bcwriter \ instrument profpaths scalaropts \ ipo ipa.a datastructure transforms target.a analysis \ - transformutils vmcore support instloops + transformutils vmcore support TOOLLINKOPTS = $(PLATFORMLIBDL) include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Mon Jul 21 14:13:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jul 21 14:13:00 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-mst/Makefile Message-ID: <200307211912.OAA03217@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-mst: Makefile updated: 1.9 -> 1.10 --- Log message: Allow large input sizes --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-mst/Makefile diff -u llvm/test/Programs/MultiSource/Olden-mst/Makefile:1.9 llvm/test/Programs/MultiSource/Olden-mst/Makefile:1.10 --- llvm/test/Programs/MultiSource/Olden-mst/Makefile:1.9 Wed Jul 9 10:14:10 2003 +++ llvm/test/Programs/MultiSource/Olden-mst/Makefile Mon Jul 21 14:12:35 2003 @@ -3,6 +3,10 @@ PROG = mst CPPFLAGS = -DTORONTO LDFLAGS = +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = 3000 +else RUN_OPTIONS = 500 +endif include ../Makefile.multisrc From lattner at cs.uiuc.edu Mon Jul 21 14:13:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jul 21 14:13:03 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-perimeter/Makefile Message-ID: <200307211912.OAA03202@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-perimeter: Makefile updated: 1.7 -> 1.8 --- Log message: Allow large input sizes --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-perimeter/Makefile diff -u llvm/test/Programs/MultiSource/Olden-perimeter/Makefile:1.7 llvm/test/Programs/MultiSource/Olden-perimeter/Makefile:1.8 --- llvm/test/Programs/MultiSource/Olden-perimeter/Makefile:1.7 Thu Jul 10 14:04:12 2003 +++ llvm/test/Programs/MultiSource/Olden-perimeter/Makefile Mon Jul 21 14:12:25 2003 @@ -3,6 +3,10 @@ PROG = perimeter CPPFLAGS = -DTORONTO LDFLAGS = +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = 11 +else RUN_OPTIONS = 4 +endif include ../Makefile.multisrc From lattner at cs.uiuc.edu Mon Jul 21 14:17:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jul 21 14:17:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile.programs Message-ID: <200307211916.OAA03234@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile.programs updated: 1.69 -> 1.70 --- Log message: Remove dead lines at EOF --- Diffs of the changes: Index: llvm/test/Programs/Makefile.programs diff -u llvm/test/Programs/Makefile.programs:1.69 llvm/test/Programs/Makefile.programs:1.70 --- llvm/test/Programs/Makefile.programs:1.69 Fri Jul 18 10:58:13 2003 +++ llvm/test/Programs/Makefile.programs Mon Jul 21 14:16:39 2003 @@ -511,10 +511,3 @@ @exit 1 endif endif - - - - - - - From lattner at cs.uiuc.edu Mon Jul 21 14:21:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jul 21 14:21:01 2003 Subject: [llvm-commits] CVS: llvm/test/Libraries/libinstr/tracelib.c Message-ID: <200307211920.OAA03512@apoc.cs.uiuc.edu> Changes in directory llvm/test/Libraries/libinstr: tracelib.c updated: 1.6 -> 1.7 --- Log message: Fix warnings --- Diffs of the changes: Index: llvm/test/Libraries/libinstr/tracelib.c diff -u llvm/test/Libraries/libinstr/tracelib.c:1.6 llvm/test/Libraries/libinstr/tracelib.c:1.7 --- llvm/test/Libraries/libinstr/tracelib.c:1.6 Fri Jul 11 17:02:28 2003 +++ llvm/test/Libraries/libinstr/tracelib.c Mon Jul 21 14:20:44 2003 @@ -105,7 +105,7 @@ #ifndef NDEBUG printf("\n***\n*** WARNING: REALLOCATING SPACE FOR POINTER HASH TABLE.\n"); - printf("*** oldSize = %ld, oldCapacity = %ld\n***\n\n", + printf("*** oldSize = %d, oldCapacity = %d\n***\n\n", ptrTable->size, ptrTable->capacity); printf("*** NEW SEQUENCE NUMBER FOR A POINTER WILL PROBABLY NOT MATCH "); printf(" THE OLD ONE!\n***\n\n"); From lattner at cs.uiuc.edu Mon Jul 21 14:24:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jul 21 14:24:01 2003 Subject: [llvm-commits] CVS: llvm/test/Libraries/libinstr/tracelib.c Message-ID: <200307211923.OAA03784@apoc.cs.uiuc.edu> Changes in directory llvm/test/Libraries/libinstr: tracelib.c updated: 1.7 -> 1.8 --- Log message: Remove unneccesary #ifdefs --- Diffs of the changes: Index: llvm/test/Libraries/libinstr/tracelib.c diff -u llvm/test/Libraries/libinstr/tracelib.c:1.7 llvm/test/Libraries/libinstr/tracelib.c:1.8 --- llvm/test/Libraries/libinstr/tracelib.c:1.7 Mon Jul 21 14:20:44 2003 +++ llvm/test/Libraries/libinstr/tracelib.c Mon Jul 21 14:23:31 2003 @@ -1,9 +1,9 @@ -/*===-- Libraries/tracelib.c - Runtime routines for tracing -----*- C++ -*--=== - * - * Runtime routines for supporting tracing of execution - * for code generated by LLVM. - * - *===---------------------------------------------------------------------===*/ +/*===-- tracelib.c - Runtime routines for tracing ---------------*- C++ -*-===*\ +// +// Runtime routines for supporting tracing of execution for code generated by +// LLVM. +// +//===----------------------------------------------------------------------===*/ #include "tracelib.h" #include @@ -19,12 +19,6 @@ *===---------------------------------------------------------------------===*/ /* use #defines until we have inlining */ - -#ifndef sun -typedef uint32_t Pointer; /* int representation of a pointer */ -#else -typedef uint64_t Pointer; /* int representation of a pointer */ -#endif typedef uint32_t Index; /* type of index/size for hash table */ typedef uint32_t Generic; /* type of values stored in table */ From criswell at choi.cs.uiuc.edu Mon Jul 21 14:43:03 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Mon Jul 21 14:43:03 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2003-07-21-ExternalConstant.ll Message-ID: <200307211942.h6LJg2J11828@choi.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: 2003-07-21-ExternalConstant.ll added (r1.1) --- Log message: Regression test for the Instruction Combining optimizization. This test helps to see if the optimization correctly handles variables that are declared constant and external. --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/2003-07-21-ExternalConstant.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2003-07-21-ExternalConstant.ll:1.1 *** /dev/null Mon Jul 21 14:42:01 2003 --- llvm/test/Regression/Transforms/InstCombine/2003-07-21-ExternalConstant.ll Mon Jul 21 14:41:51 2003 *************** *** 0 **** --- 1,46 ---- + ; + ; Test: ExternalConstant + ; + ; Description: + ; This regression test helps check whether the instruction combining + ; optimization pass correctly handles global variables which are marked + ; as external and constant. + ; + ; If a problem occurs, we should die on an assert(). Otherwise, we + ; should pass through the optimizer without failure. + ; + ; Extra code: + ; RUN: as < %s | opt -instcombine + ; + + target endian = little + target pointersize = 32 + %silly = external constant int ; [#uses=1] + + implementation ; Functions: + + declare void %bzero(sbyte*, uint) + + declare void %bcopy(sbyte*, sbyte*, uint) + + declare int %bcmp(sbyte*, sbyte*, uint) + + declare int %fputs(sbyte*, sbyte*) + + declare int %fputs_unlocked(sbyte*, sbyte*) + + int %function(int %a.1) { + entry: ; No predecessors! + %a.0 = alloca int ; [#uses=2] + %result = alloca int ; [#uses=2] + store int %a.1, int* %a.0 + %tmp.0 = load int* %a.0 ; [#uses=1] + %tmp.1 = load int* %silly ; [#uses=1] + %tmp.2 = add int %tmp.0, %tmp.1 ; [#uses=1] + store int %tmp.2, int* %result + br label %return + + return: ; preds = %entry + %tmp.3 = load int* %result ; [#uses=1] + ret int %tmp.3 + } From criswell at choi.cs.uiuc.edu Mon Jul 21 14:44:02 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Mon Jul 21 14:44:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200307211943.h6LJh7B11844@choi.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.95 -> 1.96 --- Log message: Added code that checks to see if a global variable is external before replacing a load of the global variable with the variable's constant value. --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.95 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.96 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.95 Thu Jul 17 14:06:55 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Jul 21 14:42:57 2003 @@ -1294,7 +1294,7 @@ // Instcombine load (constant global) into the value loaded... if (GlobalVariable *GV = dyn_cast(Op)) - if (GV->isConstant()) + if ((GV->isConstant()) && (!(GV->isExternal()))) return ReplaceInstUsesWith(LI, GV->getInitializer()); // Instcombine load (constantexpr_GEP global, 0, ...) into the value loaded... From lattner at cs.uiuc.edu Mon Jul 21 14:57:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jul 21 14:57:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcRegInfo.cpp Message-ID: <200307211957.OAA04146@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcRegInfo.cpp updated: 1.103 -> 1.104 --- Log message: Simplify code a bit --- Diffs of the changes: Index: llvm/lib/Target/Sparc/SparcRegInfo.cpp diff -u llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.103 llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.104 --- llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.103 Sun Jul 20 10:38:14 2003 +++ llvm/lib/Target/Sparc/SparcRegInfo.cpp Mon Jul 21 14:56:49 2003 @@ -1174,7 +1174,7 @@ const BasicBlock *BB, PhyRegAlloc &PRA) const { - assert ( (target.getInstrInfo()).isCall(CallMI->getOpCode()) ); + assert(target.getInstrInfo().isCall(CallMI->getOpCode())); // has set to record which registers were saved/restored // @@ -1182,14 +1182,14 @@ CallArgsDescriptor* argDesc = CallArgsDescriptor::get(CallMI); - //if the call is to a instrumentation function, do not - //insert save and restore instructions - //the instrumentation function takes care of - //save restore for volatile regs - bool isLLVMFirstTrigger = false; - const Function *calledFunction = argDesc->getCallInst()->getCalledFunction(); - if(calledFunction && calledFunction->getName() == "llvm_first_trigger") - isLLVMFirstTrigger = true; + // if the call is to a instrumentation function, do not insert save and + // restore instructions the instrumentation function takes care of save + // restore for volatile regs. + // + // FIXME: this should be made general, not specific to the reoptimizer! + // + const Function *Callee = argDesc->getCallInst()->getCalledFunction(); + bool isLLVMFirstTrigger = Callee && Callee->getName() == "llvm_first_trigger"; // Now check if the call has a return value (using argDesc) and if so, // find the LR of the TmpInstruction representing the return value register. From lattner at cs.uiuc.edu Mon Jul 21 14:59:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jul 21 14:59:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/Makefile.spec Message-ID: <200307211958.OAA04165@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC: Makefile.spec updated: 1.13 -> 1.14 --- Log message: Remove unused define --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/Makefile.spec diff -u llvm/test/Programs/External/SPEC/Makefile.spec:1.13 llvm/test/Programs/External/SPEC/Makefile.spec:1.14 --- llvm/test/Programs/External/SPEC/Makefile.spec:1.13 Fri Jul 18 11:00:24 2003 +++ llvm/test/Programs/External/SPEC/Makefile.spec Mon Jul 21 14:58:23 2003 @@ -47,7 +47,6 @@ CPPFLAGS += -DSPEC_CPU2000 SPEC_SANDBOX := $(LEVEL)/test/Programs/External/SPEC/Sandbox.sh -SPEC_SANDBOX_COV := $(LEVEL)/test/Programs/External/SPEC/Sandbox_cov.sh # Information about testing the program... REF_IN_DIR := $(SPEC_BENCH_DIR)/data/$(RUN_TYPE)/input/ From lattner at cs.uiuc.edu Mon Jul 21 15:03:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jul 21 15:03:03 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile.programs RunSafely_trace_execs.sh Message-ID: <200307212002.PAA04218@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile.programs updated: 1.70 -> 1.71 RunSafely_trace_execs.sh (r1.1) removed --- Log message: Runsafely and the RunSafely_trace_execs scripts are effectively the same This is a first step to eliminate the RUNSAFELY_TRACE_EXECS variable --- Diffs of the changes: Index: llvm/test/Programs/Makefile.programs diff -u llvm/test/Programs/Makefile.programs:1.70 llvm/test/Programs/Makefile.programs:1.71 --- llvm/test/Programs/Makefile.programs:1.70 Mon Jul 21 14:16:39 2003 +++ llvm/test/Programs/Makefile.programs Mon Jul 21 15:02:06 2003 @@ -79,7 +79,7 @@ # continue to be run. RUNSAFELY := $(PROGDIR)/RunSafely.sh $(RUNTIMELIMIT) -RUNSAFELY_TRACE_EXECS := $(PROGDIR)/RunSafely_trace_execs.sh $(RUNTIMELIMIT) +RUNSAFELY_TRACE_EXECS := $(RUNSAFELY) ifndef STDIN_FILENAME STDIN_FILENAME := /dev/null From lattner at cs.uiuc.edu Mon Jul 21 15:07:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jul 21 15:07:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/Makefile.spec Message-ID: <200307212006.PAA04400@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC: Makefile.spec updated: 1.14 -> 1.15 --- Log message: Remove a bunch of stuff that existed because of the RunSafely_trace_execs script --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/Makefile.spec diff -u llvm/test/Programs/External/SPEC/Makefile.spec:1.14 llvm/test/Programs/External/SPEC/Makefile.spec:1.15 --- llvm/test/Programs/External/SPEC/Makefile.spec:1.14 Mon Jul 21 14:58:23 2003 +++ llvm/test/Programs/External/SPEC/Makefile.spec Mon Jul 21 15:06:17 2003 @@ -82,7 +82,6 @@ -(cd Output/jit-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ -cp Output/jit-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time -ifndef GET_LLVM_TRACE $(PROGRAMS_TO_TEST:%=Output/%.out-llc): \ Output/%.out-llc: Output/%.llc $(SPEC_SANDBOX) llc-$(RUN_TYPE) $@ $(REF_IN_DIR) \ @@ -90,15 +89,6 @@ ../../$< $(RUN_OPTIONS) -(cd Output/llc-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ -cp Output/llc-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time -else -$(PROGRAMS_TO_TEST:%=Output/%.out-llc): \ -Output/%.out-llc: Output/%.llc - $(SPEC_SANDBOX) llc-$(RUN_TYPE) $@ $(REF_IN_DIR) \ - ../../$(RUNSAFELY_TRACE_EXECS) $(STDIN_FILENAME) \ - $(STDOUT_FILENAME) ../../$< $(RUN_OPTIONS) - -(cd Output/llc-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ - -cp Output/llc-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time -endif $(PROGRAMS_TO_TEST:%=Output/%.out-cbe): \ Output/%.out-cbe: Output/%.cbe @@ -127,7 +117,7 @@ $(PROGRAMS_TO_TEST:%=Output/%.out-tracing): \ Output/%.out-tracing: Output/%.trace $(SPEC_SANDBOX) trace-$(RUN_TYPE) $@ $(REF_IN_DIR) \ - ../../$(RUNSAFELY_TRACE_EXECS) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ + ../../$(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ ../../$< $(RUN_OPTIONS) -(cd Output/trace-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ -cp Output/trace-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time From lattner at cs.uiuc.edu Mon Jul 21 15:09:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jul 21 15:09:00 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile.programs Message-ID: <200307212008.PAA04444@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile.programs updated: 1.71 -> 1.72 --- Log message: Remove more RunSafely wierd stuff --- Diffs of the changes: Index: llvm/test/Programs/Makefile.programs diff -u llvm/test/Programs/Makefile.programs:1.71 llvm/test/Programs/Makefile.programs:1.72 --- llvm/test/Programs/Makefile.programs:1.71 Mon Jul 21 15:02:06 2003 +++ llvm/test/Programs/Makefile.programs Mon Jul 21 15:08:38 2003 @@ -79,8 +79,6 @@ # continue to be run. RUNSAFELY := $(PROGDIR)/RunSafely.sh $(RUNTIMELIMIT) -RUNSAFELY_TRACE_EXECS := $(RUNSAFELY) - ifndef STDIN_FILENAME STDIN_FILENAME := /dev/null endif @@ -363,15 +361,9 @@ @if test \! -f $@.exitok; then echo "TEST: $* FAILED!"; rm -f $@; fi endif -ifndef GET_LLVM_TRACE $(PROGRAMS_TO_TEST:%=Output/%.out-llc): \ Output/%.out-llc: Output/%.llc -$(RUNSAFELY) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS) -else -$(PROGRAMS_TO_TEST:%=Output/%.out-llc): \ -Output/%.out-llc: Output/%.llc - -$(RUNSAFELY_TRACE_EXECS) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS) -endif $(PROGRAMS_TO_TEST:%=Output/%.out-cbe): \ Output/%.out-cbe: Output/%.cbe @@ -379,7 +371,7 @@ $(PROGRAMS_TO_TEST:%=Output/%.out-tracing): \ Output/%.out-tracing: Output/%.trace - -$(RUNSAFELY_TRACE_EXECS) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS) + -$(RUNSAFELY) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS) $(PROGRAMS_TO_TEST:%=Output/%.performance): \ Output/%.performance: Output/%.out-llc.time Output/%.out-tracing.time From gaeke at cs.uiuc.edu Mon Jul 21 16:58:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jul 21 16:58:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile.programs Message-ID: <200307212157.QAA28862@trinity.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile.programs updated: 1.72 -> 1.73 --- Log message: Fix a couple of typos. Turn off TRACINGDIFFS, which could never have worked as written in the manner intended, and which was making all the tests fail with GET_LLVM_TRACE turned on. --- Diffs of the changes: Index: llvm/test/Programs/Makefile.programs diff -u llvm/test/Programs/Makefile.programs:1.72 llvm/test/Programs/Makefile.programs:1.73 --- llvm/test/Programs/Makefile.programs:1.72 Mon Jul 21 15:08:38 2003 +++ llvm/test/Programs/Makefile.programs Mon Jul 21 16:56:58 2003 @@ -101,7 +101,7 @@ LLCBYTECODE := $(addsuffix .llc.bc, $(PREFIXED_PROGRAMS_TO_TEST)) TRACINGCODEGEN := $(addsuffix .run.bc, $(PREFIXED_PROGRAMS_TO_TEST)) TRACINGLLCCODEGEN := $(addsuffix .run.s, $(PREFIXED_PROGRAMS_TO_TEST)) -TRACINGEXCEUTABLE := $(addsuffix .trace, $(PREFIXED_PROGRAMS_TO_TEST)) +TRACINGEXECUTABLE := $(addsuffix .trace, $(PREFIXED_PROGRAMS_TO_TEST)) # Output produced by programs run GCCOUTPUT := $(addsuffix .ll, $(addprefix Output/,$basename $(Source))) @@ -183,8 +183,11 @@ ifdef GET_LLVM_TRACE all:: $(TRACINGCODEGEN) all:: $(TRACINGLLCCODEGEN) -all:: $(TRACINGEXCEUTABLE) -all:: $(TRACINGDIFFS) +all:: $(TRACINGEXECUTABLE) +#all:: $(TRACINGDIFFS) +# TRACINGDIFFS does not work - it wants to diff llc against tracing, +# but DiffOutput always diffs against native, and GET_LLVM_TRACE disables +# native. all:: $(GETTIMECOMPARISON) DISABLE_CBE = 1 @@ -389,7 +392,7 @@ $(PROGRAMS_TO_TEST:%=Output/%.diff-lli): \ Output/%.diff-lli: Output/%.out-nat Output/%.out-lli - -$(DIFFPROG) lli $* $(HIDEDIFF) + -$(DIFFPROG) lli $* $(HIDEDIFF) $(PROGRAMS_TO_TEST:%=Output/%.diff-jit): \ Output/%.diff-jit: Output/%.out-nat Output/%.out-jit @@ -405,7 +408,7 @@ $(PROGRAMS_TO_TEST:%=Output/%.diff-tracing): \ Output/%.diff-tracing: Output/%.out-llc Output/%.out-tracing - $(DIFFPROG) tracing $* $(HIDEDIFF) + -$(DIFFPROG) tracing $* $(HIDEDIFF) ifndef DISABLE_DIFFS $(PROGRAMS_TO_TEST:%=Output/%.exe-lli): \ From brukman at cs.uiuc.edu Mon Jul 21 16:59:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Jul 21 16:59:01 2003 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/OptimizerDriver.cpp Message-ID: <200307212158.QAA31388@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: OptimizerDriver.cpp updated: 1.7 -> 1.8 --- Log message: Fixed misspelling. --- Diffs of the changes: Index: llvm/tools/bugpoint/OptimizerDriver.cpp diff -u llvm/tools/bugpoint/OptimizerDriver.cpp:1.7 llvm/tools/bugpoint/OptimizerDriver.cpp:1.8 --- llvm/tools/bugpoint/OptimizerDriver.cpp:1.7 Sun Jun 1 23:54:16 2003 +++ llvm/tools/bugpoint/OptimizerDriver.cpp Mon Jul 21 16:58:16 2003 @@ -33,7 +33,7 @@ /// EmitProgressBytecode - This function is used to output the current Program -/// to a file named "bugpoing-ID.bc". +/// to a file named "bugpoint-ID.bc". /// void BugDriver::EmitProgressBytecode(const std::string &ID, bool NoFlyer) { // Output the input to the current pass to a bytecode file, emit a message From gaeke at cs.uiuc.edu Mon Jul 21 17:01:05 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jul 21 17:01:05 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/GetTraceTime.pl Message-ID: <200307212200.RAA28885@trinity.cs.uiuc.edu> Changes in directory llvm/test/Programs: GetTraceTime.pl updated: 1.1 -> 1.2 --- Log message: Take out the garbage, dead code, statements with no effect, etc. Remove hardcoded .../ashukla/runs path. Avoid division by zero in what appears to be a relatively common case. :-( --- Diffs of the changes: Index: llvm/test/Programs/GetTraceTime.pl diff -u llvm/test/Programs/GetTraceTime.pl:1.1 llvm/test/Programs/GetTraceTime.pl:1.2 --- llvm/test/Programs/GetTraceTime.pl:1.1 Fri Jul 18 10:57:12 2003 +++ llvm/test/Programs/GetTraceTime.pl Mon Jul 21 17:00:30 2003 @@ -1,83 +1,44 @@ #!/usr/bin/perl -$prog = $ARGV[0]; -$llc = $ARGV[1]; -$trace = $ARGV[2]; -open(LLC,"< $llc"); -open(TRACE, "< $trace"); +($prog, $llc, $trace, @rest) = @ARGV; +$runs = $llc; $runs =~ s/llc/runs/; -$time_t; -$sys1; -$cycles; -$instrCnt; +open LLC, $llc; foreach $line (){ if($line =~ /(user[\s]+)([0-9\.]+)/){ - # if($line =~ /([0-9\.]*)([\s]*[0-9]*[\s]*exit[\s]*)([0-9]*)([\s]+)([0-9]*)/){ - #$time_t = $1; $time_t = $2; - $cycles = $3; - $instrCnt = $5; - #print "Time: $time_t \tCycles: $cycles \tInstrCnt: $instrCnt\n"; - end; - } - if($line =~ /(user[\s]+)([0-9]*)(:)([0-9\.]+)/){ + } elsif ($line =~ /(user[\s]+)([0-9]*)(:)([0-9\.]+)/){ $time_t = $2*60+$4; - } - if($line =~ /(sys[\s]+)([0-9\.]+)/){ + } elsif($line =~ /(sys[\s]+)([0-9\.]+)/){ $sys1=$2; - } - if($line =~ /(sys[\s]+)([0-9]*)(:)([0-9\.]+)/){ + } elsif($line =~ /(sys[\s]+)([0-9]*)(:)([0-9\.]+)/){ $sys1 = $2*60+$4; } - - } +close LLC; -$time_t2; -$sys2; -$cycles2; -$instrCnt2; +open TRACE, $trace; foreach $line (){ - if($line =~ /(user[\s]+)([0-9\.]+)/){ - #if($line =~ /([0-9\.]*)([\s]*[0-9]*[\s]*exit[\s]*)([0-9]*)([\s]+)([0-9]*)/){ - #$time_t2 = $1; $time_t2 = $2; - $cycles2 = $3; - $instrCnt2 = $5; - #print "Time: $time_t \tCycles: $cycles \tInstrCnt: $instrCnt\n"; - end; - } - if($line =~ /(user[\s]+)([0-9]*)(:)([0-9\.]+)/){ + } elsif($line =~ /(user[\s]+)([0-9]*)(:)([0-9\.]+)/){ $time_t2 = $2*60+$4; - } - - if($line =~ /(sys[\s]+)([0-9\.]+)/){ + } elsif($line =~ /(sys[\s]+)([0-9\.]+)/){ $sys2=$2; - } - if($line =~ /(sys[\s]+)([0-9]*)(:)([0-9\.]+)/){ + } elsif($line =~ /(sys[\s]+)([0-9]*)(:)([0-9\.]+)/){ $sys2 = $2*60+$4; } } +close TRACE; $time_t = $sys1+$time_t; $time_t2 = $sys2 + $time_t2; -open(OUTPUT, ">> /home/vadve/ashukla/runs"); -$dt = `date`; -print OUTPUT $dt."\n"; -print $prog.":\n---------------------\n"; -printf ("%0.2f\t",(($time_t2/$time_t)*100)); -#printf ("instrCnt: %0.2f\t",(($instrCnt2/$instrCnt)*100)); -printf ("time: %0.2f\n---------------------\n",$time_t2); - - -print OUTPUT $prog.":\n---------------------\n"; -printf OUTPUT "%0.2f\t", (($time_t2/$time_t)*100); -#printf OUTPUT "instrCnt: %0.2f\t",(($instrCnt2/$instrCnt)*100); -printf OUTPUT "time: %0.2f\n---------------------\n",$time_t2; -close(LLC); -close(TRACE); -close(OUTPUT); - - - +$pct = "n/a"; +$pct = sprintf("%.2f", ($time_t2/$time_t)*100.0) if ($time_t != 0); +$report = "$prog percentage: $pct; time: $time_t2\n"; +if (open(OUTPUT, ">>$runs")) { + print OUTPUT $report; + close OUTPUT; +} +print $report; +exit 0; From criswell at cs.uiuc.edu Mon Jul 21 17:24:03 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Jul 21 17:24:03 2003 Subject: [llvm-commits] CVS: llvm/www/docs/ReleaseTasks.html Message-ID: <200307212222.RAA25626@tank.cs.uiuc.edu> Changes in directory llvm/www/docs: ReleaseTasks.html updated: 1.3 -> 1.4 --- Log message: Updated from the discussion on July 21, 2003. Expanded upon testing priorities. --- Diffs of the changes: Index: llvm/www/docs/ReleaseTasks.html diff -u llvm/www/docs/ReleaseTasks.html:1.3 llvm/www/docs/ReleaseTasks.html:1.4 --- llvm/www/docs/ReleaseTasks.html:1.3 Wed Jul 2 18:03:18 2003 +++ llvm/www/docs/ReleaseTasks.html Mon Jul 21 17:22:48 2003 @@ -3,188 +3,249 @@ LLVM Public Release Project - - -
+ + +

LLVM Public Release Project

-
- +
+ -
- - +
+ + - - - + - - - + + +
+
What is this?
- +
    - - This document is a list of things to do before the LLVM project is publicly - released.  It will provide a checklist so that we know what has been - done and what is left to be done.  It will also keep a "wishlist" of - desirable features. -

    + + This document is a list of things to do before the LLVM project is publicly + released.  It will provide a checklist so that we know what has been + done and what is left to be done.  It will also keep a "wishlist" +of desirable features. +

    - +
- + - - - + - - - + + +
+
Priorities
- +
    - The - list of things to do... -

    + The + list of things to do... +

    - +
- + - - - - + + - - - + + +
    +
   High Priority
- +
    - +
      - + +
        + + +
      +
    • Fix currently known bugs and write regression tests.
    • +
        +
      • The gccld segfault from GlobalDCE.cpp.
      • +
      • The infinite loop for Tail Recursion.
      • +
      • The C++ constructor on dlopen() bug on Solaris.
        +
      • +
      +
    • Get autoconf to configure source and build directories according +to normal autoconf procedures.
    • +
        +
      • Get test tree to work properly when configuring for a different +object root.
      • +
      • Get lex/yacc/etc output to be placed into the build tree, not the +source tree.
        +
      • +
      +
    • Test Suite
      • - +
      • Create a nightly tester for Sparc.
      • +
      • Modify the test suite to have consistent output.
      • +
      • Add Pass/Fail tests to nightly tester.
        +
      • +
      • Make the USE_SPEC option work for the test directory.
      • +
      • Cleanup test/Programs.
      -
    • Document the procedure for extracting, building, and installing -LLVM.
    • -
    • Document how to start a project that uses LLVM and its build system.
      +
    • Move the pool allocator and Reoptimizer code out of mainline CVS +and the release.
    • +
    • Documentation
    • +
        +
      • Write documentation on the LLVM tools.
      • +
      • Review docs, ensuring that the information is up to date.
      • +
      +
    • GCC C Front End
    • -
    • Ensure that the C front end compiles and installs nicely.
    • -
    • Place the C front end into the CVS repository.
      -
    • -
    • Get the Reoptimizer code to work, ensuring that it does not -rely upon code outside of the source tree.
      -
    • -
    • Create a system for managing development and releases +
        +
      • Create a fix (i.e. better hack) for the sys/select.h hack.
      • +
      +
    • Licenses
    • +
        +
      • Ensure all software in source tree has proper license.
        +
      • +
      +
        +
      • Check licenses in test/Programs to ensure everything is good.
      • +
      • Create license files for anything in the distribution that is not +under our license.
        +
      • +
      +
    • Ensure SafeCode builds.
    • +
    • Create a system for managing development and releases (i.e. CVS branching, labeling revisions, etc).
      -
    • - + +
    - -

    + +

    - +
- + - - - - + + - - - + + +
    +
   Medium Priority
- +
    - -
      -
    • Improve the testing framework.
    • +
        +
      • Improve documentation on how to create an LLVM project.
        +
      • +
      • Testing
      • +
          -
        • Cleanup Reoptimizer tests so that they fit into the framework.
          -
        • -
        • Create descriptions of what each test is doing (test specifications).
        • - -
        -
      • Get the Reoptimizer tests to compile under x86.
        -
      • -
      • Determine which sub-projects of LLVM will be distributed.
      • -
      • Create an installer for the software.
      • -
      • Move over to the autoconf method of specifying object code directories.
      • -
      • Add an install target in the Makefiles that will "install" LLVM, -easing deployment.
        +
      • Cleanup Reoptimizer tests so that they fit into the framework.
        +
      • + +
      +
    • Create an installer for the software.
    • +
    • Put autoconf files into a separate directory (i.e. not llvm).
    • - +
    - -

    + +

    - +
- + - - - - + + - - - + + +
    +
   Low Priority
- +
    - +
      -
    • Make the projects/sample directory an actual example of LLVM -code.
    • -
    • Find and implement a bug reporting system (i.e. Bugzilla).
    • -
    • Test installations on various Linux distributions.
    • -
    • Create a license for the UIUC specific LLVM code.
    • -
    • Add a license file to the distribution.
    • -
    • Add a copyright notice and license information to each source - file.
    • -
    • Create man pages for the LLVM utilities.
      -
    • - +
    • GCC C Front End
    • +
        +
      • Place the C front end into the CVS repository.
      • +
      • Ensure that the C front end compiles and installs nicely.
      • +
      • Add C++ support.
        +
      • +
      +
    • Release Management
    • +
        +
      • Find and implement a bug reporting system (i.e. Bugzilla).
      • +
      +
    • Make the projects/sample directory an actual example of LLVM code.
    • +
    • Testing
    • +
        +
      • Create descriptions of what each test is doing (test specifications).
        +
      • +
      • Test LLVM on various Linux distributions.
      • +
      • Test LLVM on various Solaris distributions.
      • +
      • Test LLVM on Solaris/x86.
        +
      • +
      +
    • Licenses
    • +
        +
      • Create a license for the UIUC specific LLVM code.
      • +
      • Add a license file to the distribution.
      • +
      • Add a copyright notice and license information to each source +file.
      • +
      +
    • Documentation
    • +
        +
      • Create man pages for the LLVM utilities.
      • +
      • Create man pages for the LLVM libraries.
        +
      • +
      +
    - +
- +
John Criswell
- -Last modified: Sat May 31 14:54:03 CDT 2003

-
-
+ + Last modified: Sat May 31 14:54:03 CDT 2003

+
+
+

From vadve at cs.uiuc.edu Mon Jul 21 18:06:02 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Mon Jul 21 18:06:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Ptrdist-ks/Makefile Message-ID: <200307212305.SAA28560@tank.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Ptrdist-ks: Makefile updated: 1.3 -> 1.4 --- Log message: Use spaces around words in the PROG = command line to allow extracting PROG name with tools like awk. --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Ptrdist-ks/Makefile diff -u llvm/test/Programs/MultiSource/Ptrdist-ks/Makefile:1.3 llvm/test/Programs/MultiSource/Ptrdist-ks/Makefile:1.4 --- llvm/test/Programs/MultiSource/Ptrdist-ks/Makefile:1.3 Fri Jul 11 15:43:21 2003 +++ llvm/test/Programs/MultiSource/Ptrdist-ks/Makefile Mon Jul 21 18:05:24 2003 @@ -1,5 +1,5 @@ LEVEL = ../../../.. -PROG=ks +PROG = ks #OBJS = KS-1.o KS-2.o RUN_OPTIONS += KL-4.in RUNTIMELIMIT = 120 From vadve at cs.uiuc.edu Mon Jul 21 18:06:04 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Mon Jul 21 18:06:04 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Ptrdist-ft/Makefile Message-ID: <200307212305.SAA28551@tank.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Ptrdist-ft: Makefile updated: 1.3 -> 1.4 --- Log message: Use spaces around words in the PROG = command line to allow extracting PROG name with tools like awk. --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Ptrdist-ft/Makefile diff -u llvm/test/Programs/MultiSource/Ptrdist-ft/Makefile:1.3 llvm/test/Programs/MultiSource/Ptrdist-ft/Makefile:1.4 --- llvm/test/Programs/MultiSource/Ptrdist-ft/Makefile:1.3 Fri Jun 6 23:38:47 2003 +++ llvm/test/Programs/MultiSource/Ptrdist-ft/Makefile Mon Jul 21 18:05:21 2003 @@ -1,5 +1,5 @@ LEVEL = ../../../.. -PROG=ft +PROG = ft RUN_OPTIONS += 1500 100000 include ../Makefile.multisrc From vadve at cs.uiuc.edu Mon Jul 21 18:06:06 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Mon Jul 21 18:06:06 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Ptrdist-anagram/Makefile Message-ID: <200307212305.SAA28542@tank.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Ptrdist-anagram: Makefile updated: 1.2 -> 1.3 --- Log message: Use spaces around words in the PROG = command line to allow extracting PROG name with tools like awk. --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Ptrdist-anagram/Makefile diff -u llvm/test/Programs/MultiSource/Ptrdist-anagram/Makefile:1.2 llvm/test/Programs/MultiSource/Ptrdist-anagram/Makefile:1.3 --- llvm/test/Programs/MultiSource/Ptrdist-anagram/Makefile:1.2 Mon Jun 16 10:51:33 2003 +++ llvm/test/Programs/MultiSource/Ptrdist-anagram/Makefile Mon Jul 21 18:05:15 2003 @@ -1,5 +1,5 @@ LEVEL=../../../.. -PROG=anagram +PROG = anagram #OBJS = anagram.o RUN_OPTIONS = words STDIN_FILENAME = input.OUT From vadve at cs.uiuc.edu Tue Jul 22 07:10:01 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Tue Jul 22 07:10:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp Message-ID: <200307221209.HAA27913@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: DataStructure.cpp updated: 1.115 -> 1.116 --- Log message: Fix comment. --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.115 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.116 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.115 Wed Jul 16 16:36:31 2003 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Tue Jul 22 07:08:58 2003 @@ -1529,9 +1529,9 @@ GlobalNodeMap.clear(); GlobalsGraph->removeTriviallyDeadNodes(); - // At this point, any nodes which are visited, but not alive, are nodes which - // should be moved to the globals graph. Loop over all nodes, eliminating - // completely unreachable nodes, and moving visited nodes to the globals graph + // At this point, any nodes which are visited, but not alive, are nodes + // which can be removed. Loop over all nodes, eliminating completely + // unreachable nodes. // std::vector DeadNodes; DeadNodes.reserve(Nodes.size()); From vadve at cs.uiuc.edu Tue Jul 22 07:36:01 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Tue Jul 22 07:36:01 2003 Subject: [llvm-commits] CVS: llvm/utils/makellvm Message-ID: <200307221235.HAA28622@psmith.cs.uiuc.edu> Changes in directory llvm/utils: makellvm updated: 1.5 -> 1.6 --- Log message: (1) Pass 'VAR=string' arguments to gmake (2) Detect LLVMDIR using the LEVEL variable in Makefile. (3) To perform #2 propertly, use the same Makefile search rules as gmake. --- Diffs of the changes: Index: llvm/utils/makellvm diff -u llvm/utils/makellvm:1.5 llvm/utils/makellvm:1.6 --- llvm/utils/makellvm:1.5 Thu Sep 19 09:54:53 2002 +++ llvm/utils/makellvm Tue Jul 22 07:35:28 2003 @@ -2,11 +2,8 @@ set pstatus = 0 onintr cleanup -alias usage 'echo "USAGE: $0:t [-h] [-n] [gmake-flag...] [toolname]"; set pstatus = 1; goto cleanup' +alias usage 'echo "USAGE: $0:t [-h] [-n] [gmake-flag...] [VAR=...] [toolname (default: opt)]"; set pstatus = 1; goto cleanup' - ## LLVMDIR is simply the directory where this script resides! -set thisExec = $0 ## cannot use :h on $0 for some reason -set LLVMDIR = `echo {$thisExec:h} | sed 's/\/utils$//'` set EXEC = opt set GMAKE_OPTS = "" @@ -16,17 +13,55 @@ switch ($argv[1]) case -h : usage + case -f : + if ($#argv < 2) usage + shift argv; set MFILE = $argv[1]; shift argv; breaksw case -n : set doit = 0; shift argv; breaksw case -* : set GMAKE_OPTS = ( $GMAKE_OPTS $argv[1] ); shift argv; breaksw default : - set options_done; breaksw + set optarg = `echo -n $argv[1] | sed 's/^[^=]*$//'` + if ($#optarg) then + set GMAKE_OPTS = ( $GMAKE_OPTS $optarg ) + shift argv + else + set options_done + endif + breaksw endsw end +if ($#argv > 1) then + echo 'ERROR: More than one tool is not supported by "makellvm"' + usage +endif if ($#argv > 0) then set EXEC = $argv[1] +endif + +## Compute LLVMDIR: the root of the current LLVM tree. +## It is recorded in the variable LEVEL in Makefile, to compute it +## +if (! $?MFILE) then + if (-f GNUmakefile) then + set MFILE = GNUmakefile + else if (-f makefile) then + set MFILE = makefile + else + set MFILE = Makefile + endif +endif +if (! -f $MFILE) then + echo "Missing or invalid makefile: $MFILE" + exit 1 +endif + +set LLVMDIR = `awk '/LEVEL[ ]*=/ {print $NF}' $MFILE` + +if ($?LLVMDIR == 0 || ! -d $LLVMDIR) then + echo "Unable to find LEVEL or LEVEL is invalid ($LEVEL)" + exit 1 endif set CMD = "gmake $GMAKE_OPTS && (cd $LLVMDIR/tools/$EXEC && gmake $GMAKE_OPTS)" From lattner at cs.uiuc.edu Tue Jul 22 11:19:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jul 22 11:19:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2003-07-22-ArrayAccessTypeSafety.c.tr Makefile Message-ID: <200307221618.LAA04978@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2003-07-22-ArrayAccessTypeSafety.c.tr added (r1.1) Makefile updated: 1.4 -> 1.5 --- Log message: Add new testcase --- Diffs of the changes: Index: llvm/test/Regression/CFrontend/2003-07-22-ArrayAccessTypeSafety.c.tr diff -c /dev/null llvm/test/Regression/CFrontend/2003-07-22-ArrayAccessTypeSafety.c.tr:1.1 *** /dev/null Tue Jul 22 11:18:19 2003 --- llvm/test/Regression/CFrontend/2003-07-22-ArrayAccessTypeSafety.c.tr Tue Jul 22 11:18:09 2003 *************** *** 0 **** --- 1,7 ---- + /* RUN: llvmgcc -xc %s -c -o - | dis | not grep cast + */ + + void test(int* array, long long N) { + array[N] = 33; + } + Index: llvm/test/Regression/CFrontend/Makefile diff -u llvm/test/Regression/CFrontend/Makefile:1.4 llvm/test/Regression/CFrontend/Makefile:1.5 --- llvm/test/Regression/CFrontend/Makefile:1.4 Fri Aug 2 11:44:09 2002 +++ llvm/test/Regression/CFrontend/Makefile Tue Jul 22 11:18:09 2003 @@ -11,5 +11,10 @@ include $(LEVEL)/test/Makefile.tests TESTS := $(wildcard *.c) +TR_TESTS := $(wildcard *.c.tr) all:: $(addprefix Output/, $(TESTS:%.c=%.tbc)) +all:: $(addprefix Output/, $(TR_TESTS:%=%.out)) + +Output/%.c.tr.out: %.c.tr Output/.dir $(LCC1) + -$(TESTRUNR) $< From gaeke at cs.uiuc.edu Tue Jul 22 13:29:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jul 22 13:29:01 2003 Subject: [llvm-commits] CVS: llvm/configure.ac Message-ID: <200307221828.NAA05944@neo.cs.uiuc.edu> Changes in directory llvm: configure.ac updated: 1.5 -> 1.6 --- Log message: turn off DISABLE_LLC_DIFFS for x86. --- Diffs of the changes: Index: llvm/configure.ac diff -u llvm/configure.ac:1.5 llvm/configure.ac:1.6 --- llvm/configure.ac:1.5 Wed Jul 2 15:49:38 2003 +++ llvm/configure.ac Tue Jul 22 13:28:17 2003 @@ -37,7 +37,9 @@ dnl case $build in *i*86*) AC_SUBST(OS,[Linux]) - AC_SUBST(DISABLE_LLC_DIFFS,[[DISABLE_LLC_DIFFS:=1]]) + dnl Turned off DISABLE_LLC_DIFFS now that LLC/x86 is + dnl viable for almost all our test cases. + dnl AC_SUBST(DISABLE_LLC_DIFFS,[[DISABLE_LLC_DIFFS:=1]]) AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/x86/llvm-gcc/]) ;; From criswell at choi.cs.uiuc.edu Tue Jul 22 14:12:00 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Tue Jul 22 14:12:00 2003 Subject: [llvm-commits] CVS: llvm/configure.ac Message-ID: <200307221911.h6MJB8522897@choi.cs.uiuc.edu> Changes in directory llvm: configure.ac (r1.6) removed --- Log message: Moved configure.ac to the autoconf directory. --- Diffs of the changes: From criswell at choi.cs.uiuc.edu Tue Jul 22 14:13:01 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Tue Jul 22 14:13:01 2003 Subject: [llvm-commits] CVS: llvm/aclocal.m4 config.guess config.sub install-sh ltmain.sh mkinstalldirs Message-ID: <200307221912.h6MJCCY22913@choi.cs.uiuc.edu> Changes in directory llvm: aclocal.m4 (r1.3) removed config.guess (r1.3) removed config.sub (r1.3) removed install-sh (r1.2) removed ltmain.sh (r1.3) removed mkinstalldirs (r1.2) removed --- Log message: Moving these files to the llvm/autoconf directory. --- Diffs of the changes: From criswell at choi.cs.uiuc.edu Tue Jul 22 14:14:00 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Tue Jul 22 14:14:00 2003 Subject: [llvm-commits] CVS: llvm/autoconf/ Message-ID: <200307221913.h6MJD1O22935@choi.cs.uiuc.edu> Changes in directory llvm/autoconf: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/autoconf added to the repository --- Diffs of the changes: From criswell at choi.cs.uiuc.edu Tue Jul 22 14:14:03 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Tue Jul 22 14:14:03 2003 Subject: [llvm-commits] CVS: llvm/autoconf/aclocal.m4 config.guess config.sub configure.ac install-sh ltmain.sh mkinstalldirs Message-ID: <200307221913.h6MJDVe22958@choi.cs.uiuc.edu> Changes in directory llvm/autoconf: aclocal.m4 added (r1.1) config.guess added (r1.1) config.sub added (r1.1) configure.ac added (r1.1) install-sh added (r1.1) ltmain.sh added (r1.1) mkinstalldirs added (r1.1) --- Log message: These are the autoconf files in their new home. --- Diffs of the changes: Index: llvm/autoconf/aclocal.m4 diff -c /dev/null llvm/autoconf/aclocal.m4:1.1 *** /dev/null Tue Jul 22 14:13:30 2003 --- llvm/autoconf/aclocal.m4 Tue Jul 22 14:13:20 2003 *************** *** 0 **** --- 1,6158 ---- + # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + ## Copyright 1996, 1997, 1998, 1999, 2000, 2001 + ## 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)/libtool' + 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 + + # 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 && + 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*) + 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_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 + 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 + ]) + 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" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + 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" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + 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 + ])# AC_LIBTOOL_DLOPEN_SELF + + + # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) + # --------------------------------- + # Check to see if options -c and -o are simultaneously supported by compiler + AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], + [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + 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_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm conftest* + ]) + ])# AC_LIBTOOL_PROG_CC_C_O + + + # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) + # ----------------------------------------- + # Check to see if we can do hard links to lock some files if needed + AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], + [AC_REQUIRE([_LT_AC_LOCK])dnl + + hard_links="nottested" + if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + 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 + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi + else + need_locks=no + fi + ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + + # AC_LIBTOOL_OBJDIR + # ----------------- + AC_DEFUN([AC_LIBTOOL_OBJDIR], + [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], + [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]) + objdir=$lt_cv_objdir + ])# AC_LIBTOOL_OBJDIR + + + # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) + # ---------------------------------------------- + # Check hardcoding attributes. + AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], + [AC_MSG_CHECKING([how to hardcode library paths into programs]) + _LT_AC_TAGVAR(hardcode_action, $1)= + if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != 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, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi + else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported + fi + AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + + if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = 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 + ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + + # AC_LIBTOOL_SYS_LIB_STRIP + # ------------------------ + AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], + [striplib= + old_striplib= + AC_MSG_CHECKING([whether stripping libraries is possible]) + 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" + AC_MSG_RESULT([yes]) + 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" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac + fi + ])# AC_LIBTOOL_SYS_LIB_STRIP + + + # AC_LIBTOOL_SYS_DYNAMIC_LINKER + # ----------------------------- + # PORTME Fill in your ld.so characteristics + AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], + [AC_MSG_CHECKING([dynamic linker characteristics]) + 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 + AC_MSG_RESULT([$dynamic_linker]) + test "$dynamic_linker" = no && can_build_shared=no + ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + + # _LT_AC_TAGCONFIG + # ---------------- + AC_DEFUN([_LT_AC_TAGCONFIG], + [AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + + if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + 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 + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + 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_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + 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" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi + fi + ])# _LT_AC_TAGCONFIG + + + # AC_LIBTOOL_DLOPEN + # ----------------- + # enable checks for dlopen support + AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) + ])# AC_LIBTOOL_DLOPEN + + + # AC_LIBTOOL_WIN32_DLL + # -------------------- + # declare package support for building win32 dll's + AC_DEFUN([AC_LIBTOOL_WIN32_DLL], + [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) + ])# AC_LIBTOOL_WIN32_DLL + + + # AC_ENABLE_SHARED([DEFAULT]) + # --------------------------- + # implement the --enable-shared flag + # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. + AC_DEFUN([AC_ENABLE_SHARED], + [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl + AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [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], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) + ])# AC_ENABLE_SHARED + + + # AC_DISABLE_SHARED + # ----------------- + #- set the default shared flag to --disable-shared + AC_DEFUN([AC_DISABLE_SHARED], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_ENABLE_SHARED(no) + ])# AC_DISABLE_SHARED + + + # AC_ENABLE_STATIC([DEFAULT]) + # --------------------------- + # implement the --enable-static flag + # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. + AC_DEFUN([AC_ENABLE_STATIC], + [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl + AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [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], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) + ])# AC_ENABLE_STATIC + + + # AC_DISABLE_STATIC + # ----------------- + # set the default static flag to --disable-static + AC_DEFUN([AC_DISABLE_STATIC], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_ENABLE_STATIC(no) + ])# AC_DISABLE_STATIC + + + # AC_ENABLE_FAST_INSTALL([DEFAULT]) + # --------------------------------- + # implement the --enable-fast-install flag + # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. + AC_DEFUN([AC_ENABLE_FAST_INSTALL], + [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl + AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [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], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) + ])# AC_ENABLE_FAST_INSTALL + + + # AC_DISABLE_FAST_INSTALL + # ----------------------- + # set the default to --disable-fast-install + AC_DEFUN([AC_DISABLE_FAST_INSTALL], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_ENABLE_FAST_INSTALL(no) + ])# AC_DISABLE_FAST_INSTALL + + + # AC_LIBTOOL_PICMODE([MODE]) + # -------------------------- + # implement the --with-pic flag + # MODE is either `yes' or `no'. If omitted, it defaults to `both'. + AC_DEFUN([AC_LIBTOOL_PICMODE], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + pic_mode=ifelse($#,1,$1,default) + ])# AC_LIBTOOL_PICMODE + + + # AC_PROG_EGREP + # ------------- + # This is predefined starting with Autoconf 2.54, so this conditional + # definition can be removed once we require Autoconf 2.54 or later. + m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], + [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [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]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) + ])]) + + + # AC_PATH_TOOL_PREFIX + # ------------------- + # find a file program which can recognise shared library + AC_DEFUN([AC_PATH_TOOL_PREFIX], + [AC_REQUIRE([AC_PROG_EGREP])dnl + AC_MSG_CHECKING([for $1]) + AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, + [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 + dnl $ac_dummy forces splitting on constant user-supplied paths. + dnl POSIX.2 word splitting is done only on the output of word expansions, + dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + 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]) + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) + else + AC_MSG_RESULT(no) + fi + ])# AC_PATH_TOOL_PREFIX + + + # AC_PATH_MAGIC + # ------------- + # find a file program which can recognise a shared library + AC_DEFUN([AC_PATH_MAGIC], + [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) + if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi + fi + ])# AC_PATH_MAGIC + + + # AC_PROG_LD + # ---------- + # find the path to the GNU or non-GNU linker + AC_DEFUN([AC_PROG_LD], + [AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) + AC_REQUIRE([LT_AC_PROG_SED])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl + AC_REQUIRE([AC_CANONICAL_BUILD])dnl + ac_prog=ld + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + 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 + AC_MSG_CHECKING([for GNU ld]) + else + AC_MSG_CHECKING([for non-GNU ld]) + fi + AC_CACHE_VAL(lt_cv_path_LD, + [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 &1 /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 + ]) + 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 + ])# AC_DEPLIBS_CHECK_METHOD + + + # AC_PROG_NM + # ---------- + # find the path to a BSD-compatible name lister + AC_DEFUN([AC_PROG_NM], + [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, + [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]) + NM="$lt_cv_path_NM" + ])# AC_PROG_NM + + + # AC_CHECK_LIBM + # ------------- + # check for math library + AC_DEFUN([AC_CHECK_LIBM], + [AC_REQUIRE([AC_CANONICAL_HOST])dnl + LIBM= + case $host in + *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; + *-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; + *) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; + esac + ])# AC_CHECK_LIBM + + + # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) + # ----------------------------------- + # sets LIBLTDL to the link flags for the libltdl convenience library and + # LTDLINCL to the include flags for the libltdl header and adds + # --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL + # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If + # DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will + # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with + # '${top_srcdir}/' (note the single quotes!). If your package is not + # flat and you're not using automake, define top_builddir and + # top_srcdir appropriately in the Makefiles. + AC_DEFUN([AC_LIBLTDL_CONVENIENCE], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" + ])# AC_LIBLTDL_CONVENIENCE + + + # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) + # ----------------------------------- + # sets LIBLTDL to the link flags for the libltdl installable library and + # LTDLINCL to the include flags for the libltdl header and adds + # --enable-ltdl-install to the configure arguments. Note that LIBLTDL + # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If + # DIRECTORY is not provided and an installed libltdl is not found, it is + # assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' + # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single + # quotes!). If your package is not flat and you're not using automake, + # define top_builddir and top_srcdir appropriately in the Makefiles. + # In the future, this macro may have to be called after AC_PROG_LIBTOOL. + AC_DEFUN([AC_LIBLTDL_INSTALLABLE], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" + ])# AC_LIBLTDL_INSTALLABLE + + + # AC_LIBTOOL_CXX + # -------------- + # enable support for C++ libraries + AC_DEFUN([AC_LIBTOOL_CXX], + [AC_REQUIRE([_LT_AC_LANG_CXX]) + ])# AC_LIBTOOL_CXX + + + # _LT_AC_LANG_CXX + # --------------- + AC_DEFUN([_LT_AC_LANG_CXX], + [AC_REQUIRE([AC_PROG_CXX]) + AC_REQUIRE([AC_PROG_CXXCPP]) + _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,CXX" | sed 's/^,//'`]) + ])# _LT_AC_LANG_CXX + + + # AC_LIBTOOL_F77 + # -------------- + # enable support for Fortran 77 libraries + AC_DEFUN([AC_LIBTOOL_F77], + [AC_REQUIRE([_LT_AC_LANG_F77]) + ])# AC_LIBTOOL_F77 + + + # _LT_AC_LANG_F77 + # --------------- + AC_DEFUN([_LT_AC_LANG_F77], + [AC_REQUIRE([AC_PROG_F77]) + _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,F77" | sed 's/^,//'`]) + ])# _LT_AC_LANG_F77 + + + # AC_LIBTOOL_GCJ + # -------------- + # enable support for GCJ libraries + AC_DEFUN([AC_LIBTOOL_GCJ], + [AC_REQUIRE([_LT_AC_LANG_GCJ]) + ])# AC_LIBTOOL_GCJ + + + # _LT_AC_LANG_GCJ + # --------------- + AC_DEFUN([_LT_AC_LANG_GCJ], + [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) + _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,GCJ" | sed 's/^,//'`]) + ])# _LT_AC_LANG_GCJ + + + # AC_LIBTOOL_RC + # -------------- + # enable support for Windows resource files + AC_DEFUN([AC_LIBTOOL_RC], + [AC_REQUIRE([LT_AC_PROG_RC]) + _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,RC" | sed 's/^,//'`]) + ])# AC_LIBTOOL_RC + + + # AC_LIBTOOL_LANG_C_CONFIG + # ------------------------ + # Ensure that the configuration vars for the C compiler are + # suitably defined. Those variables are subsequently used by + # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. + AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) + AC_DEFUN([_LT_AC_LANG_C_CONFIG], + [lt_save_CC="$CC" + AC_LANG_PUSH(C) + + # Source file extension for C test sources. + ac_ext=c + + # Object file extension for compiled C test sources. + objext=o + _LT_AC_TAGVAR(objext, $1)=$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' + + _LT_AC_SYS_COMPILER + + # + # Check for any special shared library compilation flags. + # + _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= + if test "$GCC" = no; then + case $host_os in + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' + ;; + esac + fi + if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then + AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) + if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then : + else + AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) + _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no + fi + fi + + + # + # Check to make sure the static flag actually works. + # + AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) + + + ## 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... + AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) + AC_LIBTOOL_PROG_COMPILER_PIC($1) + AC_LIBTOOL_PROG_CC_C_O($1) + AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) + AC_LIBTOOL_PROG_LD_SHLIBS($1) + AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + AC_LIBTOOL_SYS_LIB_STRIP + AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) + AC_LIBTOOL_DLOPEN_SELF($1) + + # Report which librarie types wil actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + 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 + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-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' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$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 + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='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}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + AC_LIBTOOL_CONFIG($1) + + AC_LANG_POP + CC="$lt_save_CC" + ])# AC_LIBTOOL_LANG_C_CONFIG + + + # AC_LIBTOOL_LANG_CXX_CONFIG + # -------------------------- + # Ensure that the configuration vars for the C compiler are + # suitably defined. Those variables are subsequently used by + # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. + AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) + AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], + [AC_LANG_PUSH(C++) + AC_REQUIRE([AC_PROG_CXX]) + AC_REQUIRE([AC_PROG_CXXCPP]) + + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds + _LT_AC_TAGVAR(no_undefined_flag, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + + # Dependencies to place before and after the object being linked: + _LT_AC_TAGVAR(predep_objects, $1)= + _LT_AC_TAGVAR(postdep_objects, $1)= + _LT_AC_TAGVAR(predeps, $1)= + _LT_AC_TAGVAR(postdeps, $1)= + _LT_AC_TAGVAR(compiler_lib_search_path, $1)= + + # Source file extension for C++ test sources. + ac_ext=cc + + # Object file extension for compiled C++ test sources. + objext=o + _LT_AC_TAGVAR(objext, $1)=$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. + _LT_AC_SYS_COMPILER + + # 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 + _LT_AC_TAGVAR(compiler, $1)=$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_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_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 + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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 + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + 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. + _LT_AC_TAGVAR(archive_cmds, $1)='$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 + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=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. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=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 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=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 + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + 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. + _LT_AC_TAGVAR(always_export_symbols, $1)=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. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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 + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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 + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$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... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-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 + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$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 + _LT_AC_TAGVAR(module_cmds, $1)='$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 + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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 + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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 + _LT_AC_TAGVAR(module_expsym_cmds, $1)='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}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + fi + ;; + + dgux*) + case $cc_basename in + ec++) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=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 + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC) + _LT_AC_TAGVAR(archive_cmds, $1)='$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 + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=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 + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC) + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$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*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + irix5* | irix6*) + case $cc_basename in + CC) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$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. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$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 + _LT_AC_TAGVAR(archive_cmds, $1)='$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 + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + 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. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # 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' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc) + # Intel C++ + with_gnu_ld=yes + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + cxx) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # 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 + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=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. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # 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 + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # 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 + _LT_AC_TAGVAR(ld_shlibs, $1)=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. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # 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 + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # 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 + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sco*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=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?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=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. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$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. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $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. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $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 + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) + test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_AC_TAGVAR(GCC, $1)="$GXX" + _LT_AC_TAGVAR(LD, $1)="$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... + AC_LIBTOOL_POSTDEP_PREDEP($1) + AC_LIBTOOL_PROG_COMPILER_PIC($1) + AC_LIBTOOL_PROG_CC_C_O($1) + AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) + AC_LIBTOOL_PROG_LD_SHLIBS($1) + AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + AC_LIBTOOL_SYS_LIB_STRIP + AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) + AC_LIBTOOL_DLOPEN_SELF($1) + + AC_LIBTOOL_CONFIG($1) + + AC_LANG_POP + 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 + ])# AC_LIBTOOL_LANG_CXX_CONFIG + + # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) + # ------------------------ + # Figure out "hidden" library dependencies from verbose + # compiler output when linking a shared library. + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ + dnl we can't use the lt_simple_compile_test_code here, + dnl because it contains code intended for an executable, + dnl not a library. It's possible we should let each + dnl tag define a new lt_????_link_test_code variable, + dnl but it's only used here... + ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" + ifelse([$1], [], + [#! $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], + [# ### 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=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + + # Whether or not to disallow shared libs when runtime libs are static + allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + + # 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_[]_LT_AC_TAGVAR(compiler, $1) + + # Is the compiler the GNU C compiler? + with_gcc=$_LT_AC_TAGVAR(GCC, $1) + + # An ERE matcher. + EGREP=$lt_EGREP + + # The linker used to build libraries. + LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + + # 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_AC_TAGVAR(lt_prog_compiler_wl, $1) + + # 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_AC_TAGVAR(lt_prog_compiler_pic, $1) + 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_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + + # 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_AC_TAGVAR(lt_prog_compiler_static, $1) + + # Compiler flag to turn off builtin functions. + no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + + # Compiler flag to allow reflexive dlopens. + export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + + # Compiler flag to generate shared objects directly from archives. + whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + + # Compiler flag to generate thread-safe objects. + thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + + # 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_[]_LT_AC_TAGVAR(old_archive_cmds, $1) + 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_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + + # Create a temporary old-style archive to link instead of a shared archive. + old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + + # Commands used to build and install a shared archive. + archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) + archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) + 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_[]_LT_AC_TAGVAR(module_cmds, $1) + module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + + # 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_[]_LT_AC_TAGVAR(predep_objects, $1) + + # Dependencies to place after the objects being linked to create a + # shared library. + postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + + # Dependencies to place before the objects being linked to create a + # shared library. + predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + + # Dependencies to place after the objects being linked to create a + # shared library. + postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + + # The library search path used internally by the compiler when linking + # a shared library. + compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + + # 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_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + + # Flag that forces no undefined symbols. + no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + + # 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=$_LT_AC_TAGVAR(hardcode_action, $1) + + # 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_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + + # If ld is used when linking, flag to hardcode \$libdir into + # a binary during linking. This must work even if \$libdir does + # not exist. + hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + + # Whether we need a single -rpath flag with a separated argument. + hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + + # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the + # resulting binary. + hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + + # Set to yes if using the -LDIR flag during linking hardcodes DIR into the + # resulting binary. + hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + + # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into + # the resulting binary. + hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + + # 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=$_LT_AC_TAGVAR(hardcode_automatic, $1) + + # 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=$_LT_AC_TAGVAR(link_all_deplibs, $1) + + # 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="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" + + # Set to yes if exported symbols are required. + always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + + # The commands to list exported symbols. + export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + + # 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_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + + # Symbols that must always be exported. + include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + + ifelse([$1],[], + [# ### END LIBTOOL CONFIG], + [# ### END LIBTOOL TAG CONFIG: $tagname]) + + __EOF__ + + ifelse([$1],[], [ + 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_LIBTOOL_CONFIG + + + # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) + # ------------------------------------------- + AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], + [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) + fi + ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + + # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + # --------------------------------- + AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], + [AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_PROG_NM]) + AC_REQUIRE([AC_OBJEXT]) + # Check for command to grab the raw symbol name followed by C symbol from nm. + AC_MSG_CHECKING([command to parse $NM output from $compiler object]) + AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], + [ + # 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 < $nlist) && 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_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + 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 + ]) + 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 + AC_MSG_RESULT(failed) + else + AC_MSG_RESULT(ok) + fi + ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + + # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) + # --------------------------------------- + AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], + [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + + AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-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_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + sco*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + *) + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + unixware*) + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi + ], + [ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux*) + case $CC in + icc|ecc) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + ccc) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi + ]) + AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + + # + # Check to make sure the PIC flag actually works. + # + if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) + fi + case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; + esac + ]) + + + # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) + # ------------------------------------ + # See if the linker supports building shared libraries. + AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], + [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$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 + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + ],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$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 + _LT_AC_TAGVAR(include_expsyms, $1)= + # 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'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_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 + + _LT_AC_TAGVAR(ld_shlibs, $1)=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 + _LT_AC_TAGVAR(ld_shlibs, $1)=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*) + _LT_AC_TAGVAR(archive_cmds, $1)='$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)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=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. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$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 + _LT_AC_TAGVAR(archive_cmds, $1)='$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... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $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 + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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 + _LT_AC_TAGVAR(ld_shlibs, $1)=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 + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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 + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=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 + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$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. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=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 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=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 + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + 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. + _LT_AC_TAGVAR(always_export_symbols, $1)=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. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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 + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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*) + _LT_AC_TAGVAR(archive_cmds, $1)='$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)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi4*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-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. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$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. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-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 + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$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 + _LT_AC_TAGVAR(module_cmds, $1)='$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 + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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 + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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 + _LT_AC_TAGVAR(module_expsym_cmds, $1)='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}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$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*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$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*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$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 + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$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' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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 + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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 + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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 + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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 + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=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. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4.2uw2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv5*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -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 + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ]) + AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) + test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = 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$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in + x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) 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. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; + esac + ])# AC_LIBTOOL_PROG_LD_SHLIBS + + + # _LT_AC_FILE_LTDLL_C + # ------------------- + # Be careful that the start marker always follows a newline. + AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ + # /* ltdll.c starts here */ + # #define WIN32_LEAN_AND_MEAN + # #include + # #undef WIN32_LEAN_AND_MEAN + # #include + # + # #ifndef __CYGWIN__ + # # ifdef __CYGWIN32__ + # # define __CYGWIN__ __CYGWIN32__ + # # endif + # #endif + # + # #ifdef __cplusplus + # extern "C" { + # #endif + # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); + # #ifdef __cplusplus + # } + # #endif + # + # #ifdef __CYGWIN__ + # #include + # DECLARE_CYGWIN_DLL( DllMain ); + # #endif + # HINSTANCE __hDllInstance_base; + # + # BOOL APIENTRY + # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) + # { + # __hDllInstance_base = hInst; + # return TRUE; + # } + # /* ltdll.c ends here */ + ])# _LT_AC_FILE_LTDLL_C + + + # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) + # --------------------------------- + AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + + # old names + AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) + AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) + AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) + AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) + AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + + # This is just to silence aclocal about the macro not being used + ifelse([AC_DISABLE_FAST_INSTALL]) + + AC_DEFUN([LT_AC_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) + ]) + + AC_DEFUN([LT_AC_PROG_RC], + [AC_CHECK_TOOL(RC, windres, no) + ]) + + ############################################################ + # NOTE: This macro has been submitted for inclusion into # + # GNU Autoconf as AC_PROG_SED. When it is available in # + # a released version of Autoconf we should remove this # + # macro and use it instead. # + ############################################################ + # LT_AC_PROG_SED + # -------------- + # Check for a fully-functional sed program, that truncates + # as few characters as possible. Prefer GNU sed if found. + AC_DEFUN([LT_AC_PROG_SED], + [AC_MSG_CHECKING([for a sed that does not truncate output]) + AC_CACHE_VAL(lt_cv_path_SED, + [# 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 + ]) + AC_MSG_RESULT([$SED]) + ]) + ############################################################################# + # Additional Macros + ############################################################################# + + # + # Check for C++ namespace support. This is from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_namespaces.html + # + AC_DEFUN([AC_CXX_NAMESPACES], + [AC_CACHE_CHECK(whether the compiler implements namespaces, + ac_cv_cxx_namespaces, + [AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], + [using namespace Outer::Inner; return i;], + ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) + AC_LANG_RESTORE + ]) + if test "$ac_cv_cxx_namespaces" = yes; then + AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) + fi + ]) + + # + # Check for hash_map extension. This is from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_map.html + # + AC_DEFUN([AC_CXX_HAVE_EXT_HASH_MAP], + [AC_CACHE_CHECK(whether the compiler has ext/hash_map, + ac_cv_cxx_have_ext_hash_map, + [AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace std; + #endif],[hash_map t; return 0;], + ac_cv_cxx_have_ext_hash_map=std, ac_cv_cxx_have_ext_hash_map=no) + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace __gnu_cxx; + #endif],[hash_map t; return 0;], + ac_cv_cxx_have_ext_hash_map=gnu, ac_cv_cxx_have_ext_hash_map=no) + AC_LANG_RESTORE + ]) + if test "$ac_cv_cxx_have_ext_hash_map" = std; then + AC_DEFINE(HAVE_STD_EXT_HASH_MAP,,[define if the compiler has ext/hash_map]) + fi + if test "$ac_cv_cxx_have_ext_hash_map" = gnu; then + AC_DEFINE(HAVE_GNU_EXT_HASH_MAP,,[define if the compiler has ext/hash_map]) + fi + ]) + + # + # Check for hash_set extension. This is modified from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html + # + AC_DEFUN([AC_CXX_HAVE_EXT_HASH_SET], + [AC_CACHE_CHECK(whether the compiler has ext/hash_set, + ac_cv_cxx_have_ext_hash_set, + [AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace std; + #endif],[hash_set t; return 0;], + ac_cv_cxx_have_ext_hash_set=std, ac_cv_cxx_have_ext_hash_set=no) + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace __gnu_cxx; + #endif],[hash_set t; return 0;], + ac_cv_cxx_have_ext_hash_set=gnu, ac_cv_cxx_have_ext_hash_set=no) + AC_LANG_RESTORE + ]) + if test "$ac_cv_cxx_have_ext_hash_set" = std; then + AC_DEFINE(HAVE_STD_EXT_HASH_SET,,[define if the compiler has ext/hash_set in std]) + fi + if test "$ac_cv_cxx_have_ext_hash_set" = gnu; then + AC_DEFINE(HAVE_GNU_EXT_HASH_SET,,[define if the compiler has ext/hash_set in __gnu_cc]) + fi + ]) + + # + # Check for standard iterator extension. This is modified from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html + # + AC_DEFUN([AC_CXX_HAVE_STD_ITERATOR], + [AC_CACHE_CHECK(whether the compiler has the standard iterator, + ac_cv_cxx_have_std_iterator, + [AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace std; + #endif],[iterator t; return 0;], + ac_cv_cxx_have_std_iterator=yes, ac_cv_cxx_have_std_iterator=no) + AC_LANG_RESTORE + ]) + if test "$ac_cv_cxx_have_std_iterator" = yes; then + AC_DEFINE(HAVE_STD_ITERATOR,,[define if the compiler has STL iterators]) + fi + ]) + + # + # Check for bidirectional iterator extension. This is modified from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html + # + AC_DEFUN([AC_CXX_HAVE_BI_ITERATOR], + [AC_CACHE_CHECK(whether the compiler has the bidirectional iterator, + ac_cv_cxx_have_bi_iterator, + [AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace std; + #endif],[bidirectional_iterator t; return 0;], + ac_cv_cxx_have_bi_iterator=yes, ac_cv_cxx_have_bi_iterator=no) + AC_LANG_RESTORE + ]) + if test "$ac_cv_cxx_have_bi_iterator" = yes; then + AC_DEFINE(HAVE_BI_ITERATOR,,[define if the compiler has bidirectional iterator]) + fi + ]) + + # + # Check for standard iterator extension. This is modified from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html + # + AC_DEFUN([AC_CXX_HAVE_FWD_ITERATOR], + [AC_CACHE_CHECK(whether the compiler has forward iterators, + ac_cv_cxx_have_fwd_iterator, + [AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace std; + #endif],[forward_iterator t; return 0;], + ac_cv_cxx_have_fwd_iterator=yes, ac_cv_cxx_have_fwd_iterator=no) + AC_LANG_RESTORE + ]) + if test "$ac_cv_cxx_have_fwd_iterator" = yes; then + AC_DEFINE(HAVE_FWD_ITERATOR,,[define if the compiler has STL iterators]) + fi + ]) + + # + # Check for slist extension. This is from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html + # + AC_DEFUN([AC_CXX_HAVE_EXT_SLIST], + [AC_CACHE_CHECK(whether the compiler has ext/slist, + ac_cv_cxx_have_ext_slist, + [AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace std; + #endif],[slist s; return 0;], + ac_cv_cxx_have_ext_slist=std, ac_cv_cxx_have_ext_slist=no) + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace __gnu_cxx; + #endif],[slist s; return 0;], + ac_cv_cxx_have_ext_slist=gnu, ac_cv_cxx_have_ext_slist=no) + + AC_LANG_RESTORE + ]) + if test "$ac_cv_cxx_have_ext_slist" = std; then + AC_DEFINE(HAVE_EXT_SLIST,std,[define if the compiler has ext/slist]) + fi + if test "$ac_cv_cxx_have_ext_slist" = gnu; then + AC_DEFINE(HAVE_EXT_SLIST,gnu,[define if the compiler has ext/slist]) + fi + ]) + + # + # Check for FLEX. This is modified from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_namespaces.html + # + AC_DEFUN([AC_PROG_FLEX], + [AC_CACHE_CHECK(, + ac_cv_has_flex, + [AC_PROG_LEX() + ]) + if test "$LEX" != "flex"; then + AC_MSG_ERROR([flex not found but required]) + fi + ]) + + # + # Check for Bison. This is modified from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_namespaces.html + # + AC_DEFUN([AC_PROG_BISON], + [AC_CACHE_CHECK(, + ac_cv_has_bison, + [AC_PROG_YACC() + ]) + if test "$YACC" != "bison -y"; then + AC_MSG_ERROR([bison not found but required]) + else + AC_SUBST(YACC,[bison],[location of bison]) + fi + ]) + + # + # Check for GNU Make. This is from + # http://www.gnu.org/software/ac-archive/htmldoc/check_gnu_make.html + # + AC_DEFUN( + [CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command, + _cv_gnu_make_command='' ; + dnl Search all the common names for GNU make + for a in "$MAKE" make gmake gnumake ; do + if test -z "$a" ; then continue ; fi ; + if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then + _cv_gnu_make_command=$a ; + break; + fi + done ; + ) ; + dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise + if test "x$_cv_gnu_make_command" != "x" ; then + ifGNUmake='' ; + else + ifGNUmake='#' ; + AC_MSG_RESULT("Not found"); + fi + AC_SUBST(ifGNUmake) + ] ) + + # + # Check for the ability to mmap a file. This is modified from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html + # + AC_DEFUN([AC_FUNC_MMAP_FILE], + [AC_CACHE_CHECK(for mmap of files, + ac_cv_func_mmap_file, + [AC_LANG_SAVE + AC_LANG_C + AC_TRY_RUN([ + #ifdef HAVE_SYS_MMAN_H + #include + #endif + + #ifdef HAVE_SYS_TYPES_H + #include + #endif + + #ifdef HAVE_FCNTL_H + #include + #endif + + int fd; + int main () { + fd = creat ("foo",0777); fd = (int) mmap (0, 1, PROT_READ, MAP_SHARED, fd, 0); unlink ("foo"); return (fd != MAP_FAILED);}], + ac_cv_func_mmap_file=yes, ac_cv_func_mmap_file=no) + AC_LANG_RESTORE + ]) + if test "$ac_cv_func_mmap_file" = yes; then + AC_DEFINE(HAVE_MMAP_FILE) + AC_SUBST(MMAP_FILE,[yes]) + fi + ]) + + # + # Check for anonymous mmap macros. This is modified from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html + # + AC_DEFUN([AC_HEADER_MMAP_ANONYMOUS], + [AC_CACHE_CHECK(for MAP_ANONYMOUS vs. MAP_ANON, + ac_cv_header_mmap_anon, + [AC_LANG_SAVE + AC_LANG_C + AC_TRY_COMPILE([#include + #include + #include ], + [mmap (0, 1, PROT_READ, MAP_ANONYMOUS, -1, 0); return (0);], + ac_cv_header_mmap_anon=yes, ac_cv_header_mmap_anon=no) + AC_LANG_RESTORE + ]) + if test "$ac_cv_header_mmap_anon" = yes; then + AC_DEFINE(HAVE_MMAP_ANONYMOUS) + fi + ]) + Index: llvm/autoconf/config.guess diff -c /dev/null llvm/autoconf/config.guess:1.1 *** /dev/null Tue Jul 22 14:13:31 2003 --- llvm/autoconf/config.guess Tue Jul 22 14:13:20 2003 *************** *** 0 **** --- 1,1388 ---- + #! /bin/sh + # Attempt to guess a canonical system name. + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + + timestamp='2003-02-22' + + # This file 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. + + # Originally written by Per Bothner . + # Please send patches to . Submit a context + # diff and a properly formatted ChangeLog entry. + # + # This script attempts to guess a canonical system name similar to + # config.sub. If it succeeds, it prints the system name on stdout, and + # exits with 0. Otherwise, it exits with 1. + # + # The plan is that this can be called by configure scripts if you + # don't specify an explicit build system type. + + me=`echo "$0" | sed -e 's,.*/,,'` + + usage="\ + Usage: $0 [OPTION] + + Output the configuration name of the system \`$me' is run on. + + Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + + Report bugs and patches to ." + + version="\ + GNU config.guess ($timestamp) + + Originally written by Per Bothner. + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + + help=" + Try \`$me --help' for more information." + + # Parse command line + while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac + done + + if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 + fi + + trap 'exit 1' 1 2 15 + + # CC_FOR_BUILD -- compiler used by this script. Note that the use of a + # compiler to aid in system detection is discouraged as it requires + # temporary files to be created and, as you can see below, it is a + # headache to deal with in a portable fashion. + + # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still + # use `HOST_CC' if defined, but it is deprecated. + + # Portable tmp directory creation inspired by the Autoconf team. + + set_cc_for_build=' + trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; + trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; + : ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; + dummy=$tmp/dummy ; + tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; + case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac ;' + + # This is needed to find uname on a Pyramid OSx when run in the BSD universe. + # (ghazi at noc.rutgers.edu 1994-08-24) + if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH + fi + + UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown + UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown + UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown + UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + + # Note: order is significant - the case branches are not exclusive. + + case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __cplusplus + #include /* for printf() prototype */ + int main (int argc, char *argv[]) { + #else + int main (argc, argv) int argc; char *argv[]; { + #endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } + EOF + $CC_FOR_BUILD -o $dummy $dummy.c \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && exit 0 + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } + EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } + EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + # avoid double evaluation of $set_cc_for_build + test -n "$CC_FOR_BUILD" || eval $set_cc_for_build + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } + EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + *:UNICOS/mp:*:*) + echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:3*) + echo i586-pc-interix3 + exit 0 ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf at swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green at stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + case `uname -p` in + *86) UNAME_PROCESSOR=i686 ;; + powerpc) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + esac + + #echo '(No uname command or uname output not recognized.)' 1>&2 + #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + + eval $set_cc_for_build + cat >$dummy.c < + # include + #endif + main () + { + #if defined (sony) + #if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); + #else + #include + printf ("m68k-sony-newsos%s\n", + #ifdef NEWSOS4 + "4" + #else + "" + #endif + ); exit (0); + #endif + #endif + + #if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); + #endif + + #if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); + #endif + + #if defined (NeXT) + #if !defined (__ARCHITECTURE__) + #define __ARCHITECTURE__ "m68k" + #endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); + #endif + + #if defined (MULTIMAX) || defined (n16) + #if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); + #else + #if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); + #else + printf ("ns32k-encore-bsd\n"); exit (0); + #endif + #endif + #endif + + #if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); + #endif + + #if defined (sequent) + #if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); + #endif + #if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); + #endif + #endif + + #if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + + #endif + + #if defined (vax) + # if !defined (ultrix) + # include + # if defined (BSD) + # if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); + # else + # if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); + # else + printf ("vax-dec-bsd\n"); exit (0); + # endif + # endif + # else + printf ("vax-dec-bsd\n"); exit (0); + # endif + # else + printf ("vax-dec-ultrix\n"); exit (0); + # endif + #endif + + #if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); + #endif + + exit (1); + } + EOF + + $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 + + # Apollos put the system type in the environment. + + test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + + # Convex versions that predate uname can use getsysinfo(1) + + if [ -x /usr/convex/getsysinfo ] + then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac + fi + + cat >&2 < in order to provide the needed + information to handle your system. + + config.guess timestamp = $timestamp + + uname -m = `(uname -m) 2>/dev/null || echo unknown` + uname -r = `(uname -r) 2>/dev/null || echo unknown` + uname -s = `(uname -s) 2>/dev/null || echo unknown` + uname -v = `(uname -v) 2>/dev/null || echo unknown` + + /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` + /bin/uname -X = `(/bin/uname -X) 2>/dev/null` + + hostinfo = `(hostinfo) 2>/dev/null` + /bin/universe = `(/bin/universe) 2>/dev/null` + /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` + /bin/arch = `(/bin/arch) 2>/dev/null` + /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` + /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + + UNAME_MACHINE = ${UNAME_MACHINE} + UNAME_RELEASE = ${UNAME_RELEASE} + UNAME_SYSTEM = ${UNAME_SYSTEM} + UNAME_VERSION = ${UNAME_VERSION} + EOF + + exit 1 + + # Local variables: + # eval: (add-hook 'write-file-hooks 'time-stamp) + # time-stamp-start: "timestamp='" + # time-stamp-format: "%:y-%02m-%02d" + # time-stamp-end: "'" + # End: Index: llvm/autoconf/config.sub diff -c /dev/null llvm/autoconf/config.sub:1.1 *** /dev/null Tue Jul 22 14:13:31 2003 --- llvm/autoconf/config.sub Tue Jul 22 14:13:20 2003 *************** *** 0 **** --- 1,1489 ---- + #! /bin/sh + # Configuration validation subroutine script. + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + + timestamp='2003-02-22' + + # This file is (in principle) common to ALL GNU software. + # The presence of a machine in this file suggests that SOME GNU software + # can handle that machine. It does not imply ALL GNU software can. + # + # This file 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. + + # Please send patches to . Submit a context + # diff and a properly formatted ChangeLog entry. + # + # Configuration subroutine to validate and canonicalize a configuration type. + # Supply the specified configuration type as an argument. + # If it is invalid, we print an error message on stderr and exit with code 1. + # Otherwise, we print the canonical config type on stdout and succeed. + + # This file is supposed to be the same for all GNU packages + # and recognize all the CPU types, system types and aliases + # that are meaningful with *any* GNU software. + # Each package is responsible for reporting which valid configurations + # it does not support. The user should be able to distinguish + # a failure to support a valid configuration from a meaningless + # configuration. + + # The goal of this file is to map all the various variations of a given + # machine specification into a single specification in the form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM + # or in some cases, the newer four-part form: + # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM + # It is wrong to echo any other type of specification. + + me=`echo "$0" | sed -e 's,.*/,,'` + + usage="\ + Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + + Canonicalize a configuration name. + + Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + + Report bugs and patches to ." + + version="\ + GNU config.sub ($timestamp) + + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + + help=" + Try \`$me --help' for more information." + + # Parse command line + while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac + done + + case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; + esac + + # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). + # Here we must recognize all the valid KERNEL-OS combinations. + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in + nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; + esac + + ### Let's recognize common machines as not being operating systems so + ### that things like config.sub decstation-3100 work. We also + ### recognize some manufacturers as not being operating systems, so we + ### can provide default operating systems below. + case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + esac + + # Decode aliases for certain CPU-COMPANY combinations. + case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | msp430 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | msp430-* \ + | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + # I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nv1) + basic_machine=nv1-cray + os=-unicosmp + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i686-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic4x | c4x*) + basic_machine=tic4x-unknown + os=-coff + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + esac + + # Here we canonicalize certain aliases for manufacturers. + case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; + esac + + # Decode manufacturer-specific aliases for certain operating systems. + + if [ x"$os" != x"" ] + then + case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; + esac + else + + # Here we handle the default operating systems that come with various machines. + # The value should be what the vendor currently ships out the door with their + # machine or put another way, the most popular os provided with the machine. + + # Note that if you're going to try to match "-MANUFACTURER" here (say, + # "-sun"), then you have to tell the case statement up towards the top + # that MANUFACTURER isn't an operating system. Otherwise, code above + # will signal an error saying that MANUFACTURER isn't an operating + # system, and we'll never get to this point. + + case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; + esac + fi + + # Here we handle the case where we know the os, and the CPU type, but not the + # manufacturer. We pick the logical manufacturer. + vendor=unknown + case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; + esac + + echo $basic_machine$os + exit 0 + + # Local variables: + # eval: (add-hook 'write-file-hooks 'time-stamp) + # time-stamp-start: "timestamp='" + # time-stamp-format: "%:y-%02m-%02d" + # time-stamp-end: "'" + # End: Index: llvm/autoconf/configure.ac diff -c /dev/null llvm/autoconf/configure.ac:1.1 *** /dev/null Tue Jul 22 14:13:31 2003 --- llvm/autoconf/configure.ac Tue Jul 22 14:13:20 2003 *************** *** 0 **** --- 1,251 ---- + dnl Autoconf requirements + dnl AC_INIT(package, version, bug-report-address) + dnl information on the package + dnl checks for programs + dnl checks for libraries + dnl checks for header files + dnl checks for types + dnl checks for structures + dnl checks for compiler characteristics + dnl checks for library functions + dnl checks for system services + dnl AC_CONFIG_FILES([file...]) + dnl AC_OUTPUT + + dnl ************************************************************************** + dnl * Initialize + dnl ************************************************************************** + AC_INIT([[[LLVM]]],[[[1.0]]],[llvmbugs at cs.uiuc.edu]) + + dnl Place all of the extra autoconf files into the config subdirectory + AC_CONFIG_AUX_DIR([autoconf]) + + dnl Configure a header file + AC_CONFIG_HEADERS(include/Config/config.h) + + dnl ************************************************************************** + dnl * Determine which system we are building on + dnl ************************************************************************** + + dnl Check the install program (needs to be done before canonical stuff) + AC_PROG_INSTALL + + dnl Check which host for which we're compiling. This will tell us which LLVM + dnl compiler will be used for compiling SSA into object code. + AC_CANONICAL_TARGET + + dnl + dnl Now, for some of our own magic: + dnl We will use the build machine information to set some variables. + dnl + case $build in + *i*86*) AC_SUBST(OS,[Linux]) + dnl Turned off DISABLE_LLC_DIFFS now that LLC/x86 is + dnl viable for almost all our test cases. + dnl AC_SUBST(DISABLE_LLC_DIFFS,[[DISABLE_LLC_DIFFS:=1]]) + AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/x86/llvm-gcc/]) + ;; + + *sparc*) AC_SUBST(OS,[SunOS]) + AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/sparc/llvm-gcc/]) + ;; + + *) AC_SUBST(OS,[Unknown]) + ;; + esac + + dnl + dnl If we are targetting a Sparc machine running Solaris, pretend that it is + dnl V9, since that is all that we support at the moment, and autoconf will only + dnl tell us we're a sparc. + dnl + case $target in + *sparc*solaris*) AC_SUBST(target,[[sparcv9-sun-solaris2.8]]) + ;; + esac + + dnl + dnl Determine what our target architecture is and configure accordingly. + dnl This will allow Makefiles to make a distinction between the hardware and + dnl the OS. + dnl + case $target in + *i*86*) AC_SUBST(ARCH,[x86]) + ;; + *sparc*solaris*) AC_SUBST(ARCH,[Sparc]) + ;; + esac + + dnl ************************************************************************** + dnl * Check for programs. + dnl ************************************************************************** + + dnl Check for compilation tools + AC_PROG_CXX + AC_PROG_CC(gcc) + AC_PROG_CPP + + dnl Ensure that compilation tools are GCC; we use GCC specific extensions + if test "$GCC" != "yes" + then + AC_MSG_ERROR([gcc required but not found]) + fi + + if test "$GXX" != "yes" + then + AC_MSG_ERROR([g++ required but not found]) + fi + + dnl Check for GNU Make. We use its extensions to, so don't build without it + CHECK_GNU_MAKE + if test -z "$_cv_gnu_make_command" + then + AC_MSG_ERROR([GNU Make required but not found]) + fi + + dnl Check for compiler-compiler tools (reminds me of Little Caesar's Pizza) + AC_PROG_FLEX + AC_PROG_BISON + + dnl Check for libtool + AC_PROG_LIBTOOL + + dnl Check for our special programs + AC_PATH_PROG(AR,[ar]) + AC_PATH_PROG(SED,[sed]) + AC_PATH_PROG(RM,[rm]) + AC_PATH_PROG(ECHO,[echo]) + AC_PATH_PROG(MKDIR,[mkdir]) + AC_PATH_PROG(DATE,[date]) + AC_PATH_PROG(MV,[mv]) + AC_PATH_PROG(DOT,[dot]) + AC_PATH_PROG(ETAGS,[etags]) + AC_PATH_PROG(PURIFY,[purify]) + + dnl Verify that the source directory is valid + AC_CONFIG_SRCDIR(["Makefile.config.in"]) + + dnl ************************************************************************** + dnl * Check for libraries. + dnl ************************************************************************** + + dnl libelf is for sparc only; we can ignore it if we don't have it + AC_CHECK_LIB(elf, elf_begin) + + dnl dlopen() is required. If we don't find it, quit. + AC_SEARCH_LIBS(dlopen,dl,,AC_MSG_ERROR([dlopen() required but not found])) + + dnl mallinfo is optional; the code can compile (minus features) without it + AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1])) + + dnl + dnl The math libraries are used by the test code, but not by the actual LLVM + dnl code. + dnl + dnl AC_CHECK_LIB(m, cos) + + dnl ************************************************************************** + dnl * Checks for header files. + dnl * Chances are, if the standard C or POSIX type header files are missing, + dnl * then LLVM just isn't going to compile. However, it is possible that + dnl * the necessary functions/macros will be included from other + dnl * (non-standard and non-obvious) header files. + dnl * + dnl * So, we'll be gracious, give it a chance, and try to go on without + dnl * them. + dnl ************************************************************************** + AC_HEADER_STDC + AC_HEADER_SYS_WAIT + + dnl Check for ANSI C/POSIX header files + AC_CHECK_HEADERS(assert.h fcntl.h limits.h sys/time.h unistd.h errno.h signal.h math.h) + + dnl Check for system specific header files + AC_CHECK_HEADERS(malloc.h strings.h sys/mman.h sys/resource.h) + + dnl Check for header files associated with dlopen and friends + AC_CHECK_HEADERS(dlfcn.h link.h) + + dnl ************************************************************************** + dnl * Checks for typedefs, structures, and compiler characteristics. + dnl ************************************************************************** + + dnl Check for const and inline keywords + AC_C_CONST + AC_C_INLINE + + dnl Check for machine endian-ness + AC_C_BIGENDIAN(AC_DEFINE([ENDIAN_BIG]),AC_DEFINE(ENDIAN_LITTLE)) + + dnl Check for types + AC_TYPE_PID_T + AC_TYPE_SIZE_T + AC_CHECK_TYPES([int64_t],,AC_MSG_ERROR([Type int64_t required but not found])) + AC_CHECK_TYPES([uint64_t],,AC_MSG_ERROR([Type uint64_t required but not found])) + AC_HEADER_TIME + AC_STRUCT_TM + + dnl Check for C++ extensions + AC_CXX_HAVE_EXT_HASH_MAP + AC_CXX_HAVE_EXT_HASH_SET + AC_CXX_HAVE_EXT_SLIST + AC_CXX_HAVE_STD_ITERATOR + AC_CXX_HAVE_BI_ITERATOR + AC_CXX_HAVE_FWD_ITERATOR + + dnl ************************************************************************** + dnl * Checks for library functions. + dnl ************************************************************************** + AC_FUNC_ALLOCA + AC_PROG_GCC_TRADITIONAL + AC_FUNC_MEMCMP + AC_FUNC_MMAP + AC_FUNC_MMAP_FILE + if test ${ac_cv_func_mmap_file} = "no" + then + AC_MSG_ERROR([mmap() of files required but not found]) + fi + AC_HEADER_MMAP_ANONYMOUS + AC_TYPE_SIGNAL + AC_CHECK_FUNCS(getcwd gettimeofday strcspn strdup strerror strspn strstr strtod strtol) + + dnl + dnl Need to check mmap for MAP_PRIVATE, MAP_ANONYMOUS, MAP_ANON, MAP_FIXED + dnl MAP_FIXED is only needed for Sparc + dnl MAP_ANON is used for Sparc and BSD + dnl Everyone should have MAP_PRIVATE + dnl + + dnl Check for certain functions (even if we've already found them) so that we + dnl can quit with an error if they are unavailable. + dnl + dnl As the code is made more portable (i.e. less reliant on these functions, + dnl these checks should go away. + AC_CHECK_FUNC(mmap,,AC_MSG_ERROR([Function mmap() required but not found])) + AC_CHECK_FUNC(mprotect,,AC_MSG_ERROR([Function mprotect() required but not found])) + + dnl ************************************************************************** + dnl * Enable various compile-time options + dnl ************************************************************************** + AC_ARG_ENABLE(purify,AC_HELP_STRING([--enable-purify],[Compile with purify (default is NO)]), AC_SUBST(ENABLE_PURIFY,[[ENABLE_PURIFY=1]]), AC_SUBST(ENABLE_PURIFY,[[]])) + AC_ARG_ENABLE(optimized,AC_HELP_STRING([--enable-optimized],[Compile with optimizations enabled (default is NO)]), AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]]), AC_SUBST(ENABLE_OPTIMIZED,[[]])) + AC_ARG_ENABLE(spec,AC_HELP_STRING([--enable-spec],[Compile SPEC benchmarks (default is NO)]), AC_SUBST(USE_SPEC,[[USE_SPEC=1]]), AC_SUBST(USE_SPEC,[[]])) + AC_ARG_ENABLE(precompiled_bytecode,AC_HELP_STRING([--enable-precompiled_bytecode],[Use pre-compiled bytecode (default is NO)]), AC_SUBST(UPB,[[USE_PRECOMPILED_BYTECODE=1]]), AC_SUBST(UPB,[[]])) + case $build in + *i*86*) AC_ARG_ENABLE(jit,AC_HELP_STRING([--enable-jit],[Enable Just In Time Compiling (default is NO)]), AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]), AC_SUBST(JIT,[[]])) + ;; + *) + ;; + esac + + dnl ************************************************************************** + dnl * Set the location of various third-party software packages + dnl ************************************************************************** + AC_ARG_WITH(spec,AC_HELP_STRING([--with-spec],[Location of SPEC benchmarks]),AC_SUBST(SPEC_ROOT,[$withval]),AC_SUBST(SPEC_ROOT,[/home/vadve/shared/benchmarks/speccpu2000/benchspec])) + AC_ARG_WITH(llvmgccdir,AC_HELP_STRING([--with-llvmgccdir],[Location of LLVM GCC front-end]),AC_SUBST(LLVMGCCDIR,[$withval])) + AC_ARG_WITH(bcrepos,AC_HELP_STRING([--with-bcrepos],[Location of Bytecode Repository]),AC_SUBST(BCR,[$withval]),AC_SUBST(BCR,[/home/vadve/lattner/LLVMPrograms])) + AC_ARG_WITH(papi,AC_HELP_STRING([--with-papi],[Location of PAPI]),AC_SUBST(PAPIDIR,[$withval]),AC_SUBST(PAPIDIR,[/home/vadve/shared/papi-2.3.4.1])) + AC_ARG_WITH(objroot,AC_HELP_STRING([--with-objroot],[Location where object files should be placed (default is .)]),AC_SUBST(OBJROOT,[$withval]),AC_SUBST(OBJROOT,[.])) + AC_ARG_WITH(purify,AC_HELP_STRING([--with-purify],[Location of purify program]),AC_SUBST(PURIFY,[$withval])) + + AC_OUTPUT(Makefile.config) Index: llvm/autoconf/install-sh diff -c /dev/null llvm/autoconf/install-sh:1.1 *** /dev/null Tue Jul 22 14:13:31 2003 --- llvm/autoconf/install-sh Tue Jul 22 14:13:20 2003 *************** *** 0 **** --- 1,251 ---- + #!/bin/sh + # + # install - install a program, script, or datafile + # This comes from X11R5 (mit/util/scripts/install.sh). + # + # Copyright 1991 by the Massachusetts Institute of Technology + # + # Permission to use, copy, modify, distribute, and sell this software and its + # documentation for any purpose is hereby granted without fee, provided that + # the above copyright notice appear in all copies and that both that + # copyright notice and this permission notice appear in supporting + # documentation, and that the name of M.I.T. not be used in advertising or + # publicity pertaining to distribution of the software without specific, + # written prior permission. M.I.T. makes no representations about the + # suitability of this software for any purpose. It is provided "as is" + # without express or implied warranty. + # + # Calling this script install-sh is preferred over install.sh, to prevent + # `make' implicit rules from creating a file called install from it + # when there is no Makefile. + # + # This script is compatible with the BSD install script, but was written + # from scratch. It can only install one file at a time, a restriction + # shared with many OS's install programs. + + + # set DOITPROG to echo to test this script + + # Don't use :- since 4.3BSD and earlier shells don't like it. + doit="${DOITPROG-}" + + + # put in absolute paths if you don't have them in your path; or use env. vars. + + mvprog="${MVPROG-mv}" + cpprog="${CPPROG-cp}" + chmodprog="${CHMODPROG-chmod}" + chownprog="${CHOWNPROG-chown}" + chgrpprog="${CHGRPPROG-chgrp}" + stripprog="${STRIPPROG-strip}" + rmprog="${RMPROG-rm}" + mkdirprog="${MKDIRPROG-mkdir}" + + transformbasename="" + transform_arg="" + instcmd="$mvprog" + chmodcmd="$chmodprog 0755" + chowncmd="" + chgrpcmd="" + stripcmd="" + rmcmd="$rmprog -f" + mvcmd="$mvprog" + src="" + dst="" + dir_arg="" + + while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac + done + + if [ x"$src" = x ] + then + echo "install: no input file specified" + exit 1 + else + : + fi + + if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=$mkdirprog + fi + else + + # Waiting for this to be detected by the "$instcmd $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + : + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + : + fi + + # If destination is a directory, append the input filename; if your system + # does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + : + fi + fi + + ## this sed command emulates the dirname command + dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + # this part is taken from Noah Friedman's mkinstalldirs script + + # Skip lots of stat calls in the usual case. + if [ ! -d "$dstdir" ]; then + defaultIFS=' + ' + IFS="${IFS-${defaultIFS}}" + + oIFS="${IFS}" + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` + IFS="${oIFS}" + + pathcomp='' + + while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + : + fi + + pathcomp="${pathcomp}/" + done + fi + + if [ x"$dir_arg" != x ] + then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi + else + + # If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + + # don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + : + fi + + # Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + + # Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + + # and set any options; do chmod last to preserve setuid bits + + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && + + # Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + + fi && + + + exit 0 Index: llvm/autoconf/ltmain.sh diff -c /dev/null llvm/autoconf/ltmain.sh:1.1 *** /dev/null Tue Jul 22 14:13:31 2003 --- llvm/autoconf/ltmain.sh Tue Jul 22 14:13:20 2003 *************** *** 0 **** --- 1,6295 ---- + # ltmain.sh - Provide generalized library-building support services. + # NOTE: Changing this file will not affect anything until you rerun configure. + # + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 + # 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. + + # Check that we have a working $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, and then maybe $echo will work. + exec $SHELL "$0" --no-reexec ${1+"$@"} + fi + + if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit 1 + fi + + # Global variables. + mode=$default_mode + nonopt= + prev= + prevopt= + run= + show="$echo" + show_help= + execute_dlfiles= + lo2o="s/\\.lo\$/.${objext}/" + o2lo="s/\\.${objext}\$/.lo/" + + ##################################### + # Shell function definitions: + # This seems to be the best place for them + + # Need a lot of goo to handle *both* DLLs and import libs + # Has to be a shell function in order to 'eat' the argument + # that is supplied when $file_magic_command is called. + win32_libid () { + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ + grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` + if test "X$win32_nmres" = "Ximport" ; then + win32_libid_type="x86 archive import" + else + win32_libid_type="x86 archive static" + fi + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $echo $win32_libid_type + } + + # End of Shell function definitions + ##################################### + + # Parse our command line options once, thoroughly. + while test "$#" -gt 0 + do + arg="$1" + shift + + case $arg in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + execute_dlfiles) + execute_dlfiles="$execute_dlfiles $arg" + ;; + tag) + tagname="$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit 1 + ;; + esac + + case $tagname in + CC) + # Don't test for the "default" C tag, as we know, it's there, but + # not specially marked. + ;; + *) + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" + else + $echo "$progname: ignoring unknown tag $tagname" 1>&2 + fi + ;; + esac + ;; + *) + eval "$prev=\$arg" + ;; + esac + + prev= + prevopt= + continue + fi + + # Have we seen a non-optional argument yet? + case $arg in + --help) + show_help=yes + ;; + + --version) + $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" + $echo + $echo "Copyright (C) 2003 Free Software Foundation, Inc." + $echo "This is free software; see the source for copying conditions. There is NO" + $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + exit 0 + ;; + + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 + # Now print the configurations for the tags. + for tagname in $taglist; do + ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" + done + exit 0 + ;; + + --debug) + $echo "$progname: enabling shell trace mode" + set -x + ;; + + --dry-run | -n) + run=: + ;; + + --features) + $echo "host: $host" + if test "$build_libtool_libs" = yes; then + $echo "enable shared libraries" + else + $echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + $echo "enable static libraries" + else + $echo "disable static libraries" + fi + exit 0 + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --preserve-dup-deps) duplicate_deps="yes" ;; + + --quiet | --silent) + show=: + ;; + + --tag) prevopt="--tag" prev=tag ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + + *) + nonopt="$arg" + break + ;; + esac + done + + if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # If this variable is set in any of the actions, the command in it + # will be execed at the end. This prevents here-documents from being + # left over by shells. + exec_cmd= + + if test -z "$show_help"; then + + # Infer the operation mode. + if test -z "$mode"; then + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 + $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 + case $nonopt in + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) + mode=link + for arg + do + case $arg in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute + + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case $mode in + # libtool compile mode + compile) + modename="$modename: compile" + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_output= + arg_mode=normal + libobj= + + for arg + do + case "$arg_mode" in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + if test -n "$libobj" ; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit 1 + fi + arg_mode=target + continue + ;; + + -static) + build_old_libs=yes + continue + ;; + + -only-static) + build_libtool_libs=no + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + base_compile="$base_compile $lastarg" + continue + ;; + + * ) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + case $lastarg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + + base_compile="$base_compile $lastarg" + done # for arg + + case $arg_mode in + arg) + $echo "$modename: you must specify an argument for -Xcompile" + exit 1 + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit 1 + ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSifmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.ii) xform=ii ;; + *.class) xform=class ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.f90) xform=f90 ;; + *.for) xform=for ;; + *.java) xform=java ;; + esac + + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` + + case $libobj in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit 1 + ;; + esac + + # Infer tagged configuration to use if any are available and + # if one wasn't chosen via the "--tag" command line option. + # Only attempt this if the compiler in the base compile + # command doesn't match the default compiler. + if test -n "$available_tags" && test -z "$tagname"; then + case $base_compile in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" + case "$base_compile " in + "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit 1 + # else + # $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi + + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir= + else + xdir=$xdir/ + fi + lobj=${xdir}$objdir/$objname + + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + $run $rm $removelist + trap "$run $rm $removelist; exit 1" 1 2 15 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit 1" 1 2 15 + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $run ln "$0" "$lockfile" 2>/dev/null; do + $show "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $echo "\ + *** ERROR, $lockfile exists and contains: + `cat $lockfile 2>/dev/null` + + This indicates that another process is trying to use the same + temporary object file, and libtool could not work around it because + your compiler does not support \`-c' and \`-o' together. If you + repeat this compilation, it may succeed, by chance, but you had better + avoid parallel builds (make -j) in this platform, or get a better + compiler." + + $run $rm $removelist + exit 1 + fi + $echo $srcfile > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + + $run $rm "$libobj" "${libobj}T" + + # Create a libtool object file (analogous to a ".la" file), + # but don't create it if we're doing a dry run. + test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ + *** ERROR, $lockfile contains: + `cat $lockfile 2>/dev/null` + + but it should contain: + $srcfile + + This indicates that another process is trying to use the same + temporary object file, and libtool could not work around it because + your compiler does not support \`-c' and \`-o' together. If you + repeat this compilation, it may succeed, by chance, but you had better + avoid parallel builds (make -j) in this platform, or get a better + compiler." + + $run $rm $removelist + exit 1 + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + $show "$mv $output_obj $lobj" + if $run $mv $output_obj $lobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the PIC object to the libtool object file. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ + *** ERROR, $lockfile contains: + `cat $lockfile 2>/dev/null` + + but it should contain: + $srcfile + + This indicates that another process is trying to use the same + temporary object file, and libtool could not work around it because + your compiler does not support \`-c' and \`-o' together. If you + repeat this compilation, it may succeed, by chance, but you had better + avoid parallel builds (make -j) in this platform, or get a better + compiler." + + $run $rm $removelist + exit 1 + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the non-PIC object the libtool object file. + # Only append if the libtool object file exists. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + fi + build_libtool_libs=no + build_old_libs=yes + prefer_static_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + base_compile="$base_compile $arg" + shift + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit 1 + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do + # moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit 1 + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit 1 + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit 1 + fi + arg=$save_arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: more than one -exported-symbols argument is not allowed" + exit 1 + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac + continue + ;; + + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + exit 1 + fi + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-mingw* | *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # gcc -m* arguments should be passed to the linker via $compiler_flags + # in order to pass architecture information to the linker + # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo + # but this is not reliable with gcc because gcc may use -mfoo to + # select a different linker, different libraries, etc, while + # -Wl,-mfoo simply passes -mfoo to the linker. + -m*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + if test "$with_gcc" = "yes" ; then + compiler_flags="$compiler_flags $arg" + fi + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # The PATH hackery in wrapper scripts is required on Windows + # in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -static) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit 1 + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit 1 + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done # argument parsing loop + + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Infer tagged configuration to use if any are available and + # if one wasn't chosen via the "--tag" command line option. + # Only attempt this if the compiler in the base link + # command doesn't match the default compiler. + if test -n "$available_tags" && test -z "$tagname"; then + case $base_compile in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" + case $base_compile in + "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) + # The compiler in $compile_command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit 1 + # else + # $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + if test ! -d "$output_objdir"; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + status=$? + if test "$status" -ne 0 && test ! -d "$output_objdir"; then + exit $status + fi + fi + + # Determine the type of output + case $output in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplcations in $postdeps and $predeps + duplicate_compiler_generated_deps=yes + ;; + *) + duplicate_compiler_generated_deps=$duplicate_deps + ;; + esac + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if test "X$duplicate_deps" = "Xyes" ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + case $linkmode in + lib) + passes="conv link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit 1 + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + for pass in $passes; do + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + for deplib in $libs; do + lib= + found=no + case $deplib in + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + continue + fi + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` + for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do + # Search the libtool library + lib="$searchdir/lib${name}.la" + if test -f "$lib"; then + found=yes + break + fi + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if (${SED} -e '2q' $lib | + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + library_names= + old_library= + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + if test "$deplibs_check_method" != pass_all; then + $echo + $echo "*** Warning: Trying to link with static lib archive $deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because the file extensions .$libext of this argument makes me believe" + $echo "*** that it is just a static archive that I should not used here." + else + $echo + $echo "*** Warning: Linking the shared library $output against the" + $echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test "$found" = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib'" 1>&2 + exit 1 + fi + + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit 1 + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit 1 + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit 1 + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit 1 + fi + if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi + ;; + esac + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit 1 + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var"; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $dir" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + # This is a shared library + + # Warn about portability, can't link against -module's on some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then + $echo + if test "$linkmode" = prog; then + $echo "*** Warning: Linking the executable $output against the loadable module" + else + $echo "*** Warning: Linking the shared library $output against the loadable module" + fi + $echo "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; shift + libname=`eval \\$echo \"$libname_spec\"` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`$echo $soroot | ${SED} -e 's/^.*\///'` + newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + save_ifs="$IFS"; IFS='~' + eval cmds=\"$extract_expsyms_cmds\" + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + save_ifs="$IFS"; IFS='~' + eval cmds=\"$old_archive_from_expsyms_cmds\" + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5* ) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a module then we can not link against it, someone + # is ignoring the new warnings I added + if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then + $echo "** Warning, lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $echo + $echo "** And there doesn't seem to be a static archive available" + $echo "** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case "$libdir" in + [\\/]*) + add_dir="-L$inst_prefix_dir$libdir $add_dir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit 1 + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case "$libdir" in + [\\/]*) + add_dir="-L$inst_prefix_dir$libdir $add_dir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $echo + $echo "*** Warning: This system can not link to static lib archive $lib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $echo "*** But as you try to build a module library, libtool will still create " + $echo "*** a static module, that should work as long as the dlopening application" + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + convenience="$convenience $dir/$old_library" + old_convenience="$old_convenience $dir/$old_library" + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="$absdir/$objdir" + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit 1 + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="$absdir" + fi + depdepl= + case $host in + *-*-darwin*) + # we do not want to link against static libs, but need to link against shared + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$path/$depdepl" ; then + depdepl="$path/$depdepl" + fi + newlib_search_path="$newlib_search_path $path" + path="" + fi + ;; + *) + path="-L$path" + ;; + esac + + ;; + -l*) + case $host in + *-*-darwin*) + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" + ;; + *) continue ;; + esac + ;; + *) continue ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$deplibs $depdepl" ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$deplibs $path" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi + + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval shared_ext=\"$shrext\" + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval shared_ext=\"$shrext\" + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit 1 + else + $echo + $echo "*** Warning: Linking the shared library $output against the non-libtool" + $echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 + fi + + set dummy $rpath + if test "$#" -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" + + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$2" + number_minor="$3" + number_revision="$4" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor - 1` + age="$number_minor" + revision="$number_minor" + ;; + esac + ;; + no) + current="$2" + revision="$3" + age="$4" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; + *) + $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + case $revision in + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + case $age in + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; + *) + $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + if test "$age" -gt "$current"; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + irix | nonstopux) + major=`expr $current - $age + 1` + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=.`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + major=`expr $current - $age` + versuffix="-$major" + ;; + + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit 1 + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + fi + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$echo "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + removelist="$removelist $p" + ;; + *) ;; + esac + done + if test -n "$removelist"; then + $show "${rm}r $removelist" + $run ${rm}r $removelist + fi + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + for path in $notinst_path; do + lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` + deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` + dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` + done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null \ + | grep " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for file magic test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a file magic. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name="`expr $a_deplib : '-l\(.*\)'`" + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval $echo \"$potent_lib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a regex pattern. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` + done + fi + if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ + | grep . >/dev/null; then + $echo + if test "X$deplibs_check_method" = "Xnone"; then + $echo "*** Warning: inter-library dependencies are not supported in this platform." + else + $echo "*** Warning: inter-library dependencies are not known to be supported." + fi + $echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + $echo + $echo "*** Warning: libtool could not satisfy all declared inter-library" + $echo "*** dependencies of module $libname. Therefore, libtool will create" + $echo "*** a static module, that should work as long as the dlopening" + $echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + $echo "*** The inter-library dependencies that have been dropped here will be" + $echo "*** automatically added whenever a program is linked with this library" + $echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + $echo + $echo "*** Since this library must not contain undefined symbols," + $echo "*** because either the platform does not support them or" + $echo "*** it was explicitly requested with -no-undefined," + $echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + realname="$2" + shift; shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + eval cmds=\"$export_symbols_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + $show "$cmd" + $run eval "$cmd" || exit $? + skipped_export=false + else + # The command line is too long to execute in one step. + $show "using reloadable object file for export list..." + skipped_export=: + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex"; then + $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + status=$? + if test "$status" -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "$mkdir $xdir" + $run $mkdir "$xdir" + status=$? + if test "$status" -ne 0 && test ! -d "$xdir"; then + exit $status + fi + # We will extract separately just the conflicting names and we will no + # longer touch any unique names. It is faster to leave these extract + # automatically by $AR in one run. + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 + $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 + $AR t "$xabs" | sort | uniq -cd | while read -r count name + do + i=1 + while test "$i" -le "$count" + do + # Put our $i before any first dot (extension) + # Never overwrite any file + name_to="$name" + while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" + do + name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` + done + $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" + $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? + i=`expr $i + 1` + done + done + fi + + libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval cmds=\"$module_expsym_cmds\" + else + eval cmds=\"$module_cmds\" + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval cmds=\"$archive_expsym_cmds\" + else + eval cmds=\"$archive_cmds\" + fi + fi + + if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise. + $echo "creating reloadable object files..." + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + delfiles= + last_robj= + k=1 + output=$output_objdir/$save_output-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*"` && + test "$len" -le "$max_cmd_len"; }; then + objlist="$objlist $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + fi + last_robj=$output_objdir/$save_output-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$save_output-${k}.$objext + objlist=$obj + len=1 + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + + # Set up a command to remove the reloadale object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" + done + + $echo "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval cmds=\"$archive_expsym_cmds\" + else + eval cmds=\"$archive_cmds\" + fi + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~$rm $delfiles\" + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + exit 0 + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi + + case $output in + *.lo) + if test -n "$objs$old_deplibs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit 1 + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $run $rm $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${obj}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + status=$? + if test "$status" -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "$mkdir $xdir" + $run $mkdir "$xdir" + status=$? + if test "$status" -ne 0 && test ! -d "$xdir"; then + exit $status + fi + # We will extract separately just the conflicting names and we will no + # longer touch any unique names. It is faster to leave these extract + # automatically by $AR in one run. + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 + $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 + $AR t "$xabs" | sort | uniq -cd | while read -r count name + do + i=1 + while test "$i" -le "$count" + do + # Put our $i before any first dot (extension) + # Never overwrite any file + name_to="$name" + while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" + do + name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` + done + $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" + $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? + i=`expr $i + 1` + done + done + fi + + reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + eval cmds=\"$reload_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit 0 + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $run eval "echo timestamp > $libobj" || exit $? + exit 0 + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + eval cmds=\"$reload_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit 0 + ;; + + prog) + case $host in + *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; + esac + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi + + if test "$preload" = yes; then + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + if test "$tagname" = CXX ; then + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + fi + ;; + esac + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi + + if test -n "$dlsyms"; then + case $dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" + + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" + + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" + + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ + /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ + /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ + + #ifdef __cplusplus + extern \"C\" { + #endif + + /* Prevent the only kind of declaration conflicts we can make. */ + #define lt_preloaded_symbols some_other_symbol + + /* External symbol declarations for the compiler. */\ + " + + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" + + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$output.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + else + $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' + $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + fi + fi + + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` + $run eval '$echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -z "$run"; then + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if grep -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' + else + $echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi + + $echo >> "$output_objdir/$dlsyms" "\ + + #undef lt_preloaded_symbols + + #if defined (__STDC__) && __STDC__ + # define lt_ptr void * + #else + # define lt_ptr char * + # define const + #endif + + /* The mapping between symbol names and symbols. */ + const struct { + const char *name; + lt_ptr address; + } + lt_preloaded_symbols[] = + {\ + " + + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" + + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr) 0} + }; + + /* This works around a problem in FreeBSD linker */ + #ifdef FREEBSD_WORKAROUND + static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; + } + #endif + + #ifdef __cplusplus + } + #endif\ + " + fi + + pic_flag_for_symtable= + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag";; + esac + esac + + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + + # Clean up the generated files. + $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" + $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" + + # Transform the symbol file into the correct name. + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit 1 + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + fi + + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + status=$? + + # Delete the generated files. + if test -n "$dlsyms"; then + $show "$rm $output_objdir/${outputname}S.${objext}" + $run $rm "$output_objdir/${outputname}S.${objext}" + fi + + exit $status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" + ;; + *) + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" + ;; + esac + done + temp_rpath="$rpath" + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + exit 0 + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $0 --fallback-echo"; then + case $0 in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; + *) qecho="$SHELL `pwd`/$0 --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + cwrappersource=`$echo ${objdir}/lt-${output}.c` + cwrapper=`$echo ${output}.exe` + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15 + + cat > $cwrappersource <> $cwrappersource<<"EOF" + #include + #include + #include + #include + #include + #include + + #if defined(PATH_MAX) + # define LT_PATHMAX PATH_MAX + #elif defined(MAXPATHLEN) + # define LT_PATHMAX MAXPATHLEN + #else + # define LT_PATHMAX 1024 + #endif + + #ifndef DIR_SEPARATOR + #define DIR_SEPARATOR '/' + #endif + + #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) + #define HAVE_DOS_BASED_FILE_SYSTEM + #ifndef DIR_SEPARATOR_2 + #define DIR_SEPARATOR_2 '\\' + #endif + #endif + + #ifndef DIR_SEPARATOR_2 + # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) + #else /* DIR_SEPARATOR_2 */ + # define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) + #endif /* DIR_SEPARATOR_2 */ + + #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) + #define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ + } while (0) + + const char *program_name = NULL; + + void * xmalloc (size_t num); + char * xstrdup (const char *string); + char * basename (const char *name); + char * fnqualify(const char *path); + char * strendzap(char *str, const char *pat); + void lt_fatal (const char *message, ...); + + int + main (int argc, char *argv[]) + { + char **newargz; + int i; + + program_name = (char *) xstrdup ((char *) basename (argv[0])); + newargz = XMALLOC(char *, argc+2); + EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = fnqualify(argv[0]); + /* we know the script has the same name, without the .exe */ + /* so make sure newargz[1] doesn't end in .exe */ + strendzap(newargz[1],".exe"); + for (i = 1; i < argc; i++) + newargz[i+1] = xstrdup(argv[i]); + newargz[argc+1] = NULL; + EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + } + + void * + xmalloc (size_t num) + { + void * p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; + } + + char * + xstrdup (const char *string) + { + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL + ; + } + + char * + basename (const char *name) + { + const char *base; + + #if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha (name[0]) && name[1] == ':') + name += 2; + #endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return (char *) base; + } + + char * + fnqualify(const char *path) + { + size_t size; + char *p; + char tmp[LT_PATHMAX + 1]; + + assert(path != NULL); + + /* Is it qualified already? */ + #if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha (path[0]) && path[1] == ':') + return xstrdup (path); + #endif + if (IS_DIR_SEPARATOR (path[0])) + return xstrdup (path); + + /* prepend the current directory */ + /* doesn't handle '~' */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ + p = XMALLOC(char, size); + sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); + return p; + } + + char * + strendzap(char *str, const char *pat) + { + size_t len, patlen; + + assert(str != NULL); + assert(pat != NULL); + + len = strlen(str); + patlen = strlen(pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp(str, pat) == 0) + *str = '\0'; + } + return str; + } + + static void + lt_error_core (int exit_status, const char * mode, + const char * message, va_list ap) + { + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); + } + + void + lt_fatal (const char *message, ...) + { + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); + } + EOF + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit 1" 1 2 15 + + $echo > $output "\ + #! $SHELL + + # $output - temporary wrapper script for $objdir/$outputname + # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP + # + # The $output program cannot be directly executed until all the libtool + # libraries that it depends on are installed. + # + # This wrapper script should never be moved out of the build directory. + # If it is, it will not operate correctly. + + # Sed substitution that helps us do robust quoting. It backslashifies + # metacharacters that are still active within double-quoted strings. + Xsed='${SED} -e 1s/^X//' + sed_quote_subst='$sed_quote_subst' + + # The HP-UX ksh and POSIX shell print the target directory to stdout + # if CDPATH is set. + if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi + + relink_command=\"$relink_command\" + + # This environment variable determines our operation mode. + if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variable: + notinst_deplibs='$notinst_deplibs' + else + # When we are sourced in execute mode, \$file and \$echo are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ + " + $echo >> $output "\ + + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" + " + + if test "$fast_install" = yes; then + $echo >> $output "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $mkdir \"\$progdir\" + else + $rm \"\$progdir/\$file\" + fi" + + $echo >> $output "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $echo \"\$relink_command_output\" >&2 + $rm \"\$progdir/\$file\" + exit 1 + fi + fi + + $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $rm \"\$progdir/\$program\"; + $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $rm \"\$progdir/\$file\" + fi" + else + $echo >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" + " + fi + + $echo >> $output "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var + " + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH + " + fi + + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + " + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \$progdir\\\\\$program \${1+\"\$@\"} + " + ;; + + *) + $echo >> $output "\ + exec \$progdir/\$program \${1+\"\$@\"} + " + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + exit 1 + fi + else + # The program doesn't exist. + \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 + \$echo \"This script is just a wrapper for \$program.\" 1>&2 + $echo \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi + fi\ + " + chmod +x $output + fi + exit 0 + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + status=$? + if test "$status" -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + # Add in members from convenience archives. + for xlib in $addlibs; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "$mkdir $xdir" + $run $mkdir "$xdir" + status=$? + if test "$status" -ne 0 && test ! -d "$xdir"; then + exit $status + fi + # We will extract separately just the conflicting names and we will no + # longer touch any unique names. It is faster to leave these extract + # automatically by $AR in one run. + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 + $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 + $AR t "$xabs" | sort | uniq -cd | while read -r count name + do + i=1 + while test "$i" -le "$count" + do + # Put our $i before any first dot (extension) + # Never overwrite any file + name_to="$name" + while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" + do + name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` + done + $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" + $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? + i=`expr $i + 1` + done + done + fi + + oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` + done + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + eval cmds=\"$old_archive_from_new_cmds\" + else + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # the command line is too long to link in one step, link in parts + $echo "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + # GNU ar 2.10+ was changed to match POSIX; thus no paths are + # encoded into archives. This makes 'ar r' malfunction in + # this piecewise linking case whenever conflicting object + # names appear in distinct ar calls; check, warn and compensate. + if (for obj in $save_oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 + $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 + AR_FLAGS=cq + fi + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*"` && + test "$len" -le "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~$old_archive_cmds\" + fi + fi + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + + # Only create the output if not a dry run. + if test -z "$run"; then + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + fi + $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $echo > $output "\ + # $outputname - a libtool library file + # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP + # + # Please DO NOT delete this file! + # It is necessary for linking the library. + + # The name that we can dlopen(3). + dlname='$tdlname' + + # Names of this library. + library_names='$library_names' + + # The name of the static archive. + old_library='$old_library' + + # Libraries that this one depends upon. + dependency_libs='$dependency_libs' + + # Version information for $libname. + current=$current + age=$age + revision=$revision + + # Is this an already installed library? + installed=$installed + + # Should we warn about portability when linking against -modules? + shouldnotlink=$module + + # Files to dlopen/dlpreopen + dlopen='$dlfiles' + dlpreopen='$dlprefiles' + + # Directory that this library needs to be installed in: + libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $echo >> $output "\ + relink_command=\"$relink_command\"" + fi + done + fi + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? + ;; + esac + exit 0 + ;; + + # libtool install mode + install) + modename="$modename: install" + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg="$nonopt" + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest="$arg" + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) prev="-f" ;; + -g) prev="-g" ;; + -m) prev="-m" ;; + -o) prev="-o" ;; + -s) + stripme=" -s" + continue + ;; + -*) ;; + + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest="$arg" + continue + fi + ;; + esac + + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done + + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 + fi + $echo "$help" 1>&2 + exit 1 + fi + + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` + + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test "$#" -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + library_names= + old_library= + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ + test "X$dir" = "X$file/" && dir= + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit 1 + fi + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + exit 1 + fi + fi + + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run eval "$striplib $destdir/$realname" || exit $? + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + eval cmds=\"$postinstall_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + esac + + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? + fi + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` + + $show "$install_prog $staticobj $staticdest" + $run eval "$install_prog \$staticobj \$staticdest" || exit $? + fi + exit 0 + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + file=`$echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin*|*mingw*) + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` + ;; + *) + wrapper=$file + ;; + esac + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # To insure that "foo" is sourced, and not "foo.exe", + # finese the cygwin/MSYS system by explicitly sourcing "foo." + # which disallows the automatic-append-.exe behavior. + case $build in + *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; + *) wrapperdot=${wrapper} ;; + esac + # If there is no directory component, then add one. + case $file in + */* | *\\*) . ${wrapperdot} ;; + *) . ./${wrapperdot} ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 + exit 1 + fi + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done + + relink_command= + # To insure that "foo" is sourced, and not "foo.exe", + # finese the cygwin/MSYS system by explicitly sourcing "foo." + # which disallows the automatic-append-.exe behavior. + case $build in + *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; + *) wrapperdot=${wrapper} ;; + esac + # If there is no directory component, then add one. + case $file in + */* | *\\*) . ${wrapperdot} ;; + *) . ./${wrapperdot} ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir="/tmp" + test -n "$TMPDIR" && tmpdir="$TMPDIR" + tmpdir="$tmpdir/libtool-$$" + if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : + else + $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 + continue + fi + file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue + fi + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyways + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` + ;; + esac + ;; + esac + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done + + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? + + if test -n "$stripme" && test -n "$striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + eval cmds=\"$old_postinstall_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $0 --finish$current_libdirs' + else + exit 0 + fi + ;; + + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + eval cmds=\"$finish_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" + done + IFS="$save_ifs" + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + test "$show" = : && exit 0 + + $echo "----------------------------------------------------------------------" + $echo "Libraries have been installed in:" + for libdir in $libdirs; do + $echo " $libdir" + done + $echo + $echo "If you ever happen to want to link against installed libraries" + $echo "in a given directory, LIBDIR, you must either use libtool, and" + $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + $echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + $echo " during execution" + fi + if test -n "$runpath_var"; then + $echo " - add LIBDIR to the \`$runpath_var' environment variable" + $echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $echo " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $echo " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + $echo + $echo "See any operating system documentation about shared libraries for" + $echo "more information, such as the ld(1) and ld.so(8) manual pages." + $echo "----------------------------------------------------------------------" + exit 0 + ;; + + # libtool execute mode + execute) + modename="$modename: execute" + + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit 1 + fi + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Read the libtool library. + dlname= + library_names= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit 1 + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; + + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done + + if test -z "$run"; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + if test "${save_LC_ALL+set}" = set; then + LC_ALL="$save_LC_ALL"; export LC_ALL + fi + if test "${save_LANG+set}" = set; then + LANG="$save_LANG"; export LANG + fi + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi + $echo "$cmd$args" + exit 0 + fi + ;; + + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" + rm="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) rm="$rm $arg"; rmforce=yes ;; + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; + esac + done + + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if (test -L "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ + || test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + + if test "$mode" = uninstall; then + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + eval cmds=\"$postuninstall_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + eval cmds=\"$old_postuninstall_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + fi + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + + # Read the .lo file + . $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" \ + && test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" \ + && test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + file=`$echo $file|${SED} 's,.exe$,,'` + noexename=`$echo $name|${SED} 's,.exe$,,'` + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$noexename + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + + exit $exit_status + ;; + + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit 1 + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit 1 + fi + fi # test -z "$show_help" + + if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit 1 + fi + + # We need to display help for each of the modes. + case $mode in + "") $echo \ + "Usage: $modename [OPTION]... [MODE-ARG]... + + Provide generalized library-building support services. + + --config show all configuration variables + --debug enable verbose shell tracing + -n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + --version print version information + + MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + + MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for + a more detailed description of MODE. + + Report bugs to ." + exit 0 + ;; + + clean) + $echo \ + "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + + Remove files from the build directory. + + RM is the name of the program to use to delete files associated with each FILE + (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed + to RM. + + If FILE is a libtool library, object or program, all the files associated + with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $echo \ + "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + + Compile a source file into a libtool library object. + + This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a \`.o' file suitable for static linking + + COMPILE-COMMAND is a command to be used in creating a \`standard' object file + from the given SOURCEFILE. + + The output file name is determined by removing the directory component from + SOURCEFILE, then substituting the C source code suffix \`.c' with the + library object suffix, \`.lo'." + ;; + + execute) + $echo \ + "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... + + Automatically set library path, then run a program. + + This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + + This mode sets the library path environment variable according to \`-dlopen' + flags. + + If any of the ARGS are libtool executable wrappers, then they are translated + into their corresponding uninstalled binary, and any of their required library + directories are added to the library path. + + Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $echo \ + "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... + + Complete the installation of libtool libraries. + + Each LIBDIR is a directory that contains libtool libraries. + + The commands that this mode executes may require superuser privileges. Use + the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $echo \ + "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... + + Install executables or libraries. + + INSTALL-COMMAND is the installation command. The first component should be + either the \`install' or \`cp' program. + + The rest of the components are interpreted as arguments to that command (only + BSD-compatible install options are recognized)." + ;; + + link) + $echo \ + "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... + + Link object files or libraries together to form another library, or to + create an executable program. + + LINK-COMMAND is a command using the C compiler that you would use to create + a program from several object files. + + The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -static do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + + All other options (arguments beginning with \`-') are ignored. + + Every other argument is treated as a filename. Files ending in \`.la' are + treated as uninstalled libtool libraries, other files are standard or library + object files. + + If the OUTPUT-FILE ends in \`.la', then a libtool library is created, + only library objects (\`.lo' files) may be specified, and \`-rpath' is + required, except when creating a convenience library. + + If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created + using \`ar' and \`ranlib', or on Windows using \`lib'. + + If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file + is created, otherwise an executable program is created." + ;; + + uninstall) + $echo \ + "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + + Remove libraries from an installation directory. + + RM is the name of the program to use to delete files associated with each FILE + (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed + to RM. + + If FILE is a libtool library, all the files associated with it are deleted. + Otherwise, only FILE itself is deleted using RM." + ;; + + *) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + esac + + $echo + $echo "Try \`$modename --help' for more information about other modes." + + exit 0 + + # The TAGs below are defined such that we never get into a situation + # in which we disable both kinds of libraries. Given conflicting + # choices, we go for a static library, that is the most portable, + # since we can't tell whether shared libraries were disabled because + # the user asked for that or because the platform doesn't support + # them. This is particularly important on AIX, because we don't + # support having both static and shared libraries enabled at the same + # time on that platform, so we default to a shared-only configuration. + # If a disable-shared tag is given, we'll fallback to a static-only + # configuration. But we'll never go from static-only to shared-only. + + # ### BEGIN LIBTOOL TAG CONFIG: disable-shared + build_libtool_libs=no + build_old_libs=yes + # ### END LIBTOOL TAG CONFIG: disable-shared + + # ### BEGIN LIBTOOL TAG CONFIG: disable-static + build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` + # ### END LIBTOOL TAG CONFIG: disable-static + + # Local Variables: + # mode:shell-script + # sh-indentation:2 + # End: Index: llvm/autoconf/mkinstalldirs diff -c /dev/null llvm/autoconf/mkinstalldirs:1.1 *** /dev/null Tue Jul 22 14:13:31 2003 --- llvm/autoconf/mkinstalldirs Tue Jul 22 14:13:20 2003 *************** *** 0 **** --- 1,101 ---- + #! /bin/sh + # mkinstalldirs --- make directory hierarchy + # Author: Noah Friedman + # Created: 1993-05-16 + # Public domain + + # $Id: mkinstalldirs,v 1.1 2003/07/22 19:13:20 criswell Exp $ + + errstatus=0 + dirmode="" + + usage="\ + Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." + + # process command line arguments + while test $# -gt 0 ; do + case "${1}" in + -h | --help | --h* ) # -h for help + echo "${usage}" 1>&2; exit 0 ;; + -m ) # -m PERM arg + shift + test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } + dirmode="${1}" + shift ;; + -- ) shift; break ;; # stop option processing + -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option + * ) break ;; # first non-opt arg + esac + done + + for file + do + if test -d "$file"; then + shift + else + break + fi + done + + case $# in + 0) exit 0 ;; + esac + + case $dirmode in + '') + if mkdir -p -- . 2>/dev/null; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + fi ;; + *) + if mkdir -m "$dirmode" -p -- . 2>/dev/null; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + fi ;; + esac + + for file + do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp="$pathcomp/" + done + done + + exit $errstatus + + # Local Variables: + # mode: shell-script + # sh-indentation: 3 + # End: + # mkinstalldirs ends here From criswell at choi.cs.uiuc.edu Tue Jul 22 14:19:01 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Tue Jul 22 14:19:01 2003 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200307221918.h6MJIJq23145@choi.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.6 -> 1.7 --- Log message: Generated a new configure script. This script uses files within the new autoconf subdirectory and includes changes from Brian Gaeke's recent changes to configure.ac. --- Diffs of the changes: Index: llvm/configure diff -u llvm/configure:1.6 llvm/configure:1.7 --- llvm/configure:1.6 Mon Jul 14 11:52:07 2003 +++ llvm/configure Tue Jul 22 14:18:09 2003 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.53 for [LLVM] [1.0]. +# Generated by GNU Autoconf 2.57 for [LLVM] [1.0]. # # Report bugs to . # @@ -8,168 +8,6 @@ # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. - - -# 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/^,//'` - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - - ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -178,11 +16,13 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi -# NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset @@ -190,34 +30,42 @@ as_unset=false fi -(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && - { $as_unset LANG || test "${LANG+set}" != set; } || - { LANG=C; export LANG; } -(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && - { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || - { LC_ALL=C; export LC_ALL; } -(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && - { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || - { LC_TIME=C; export LC_TIME; } -(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && - { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || - { LC_CTYPE=C; export LC_CTYPE; } -(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && - { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || - { LANGUAGE=C; export LANGUAGE; } -(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && - { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || - { LC_COLLATE=C; export LC_COLLATE; } -(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && - { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || - { LC_NUMERIC=C; export LC_NUMERIC; } -(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && - { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || - { LC_MESSAGES=C; export LC_MESSAGES; } + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi # Name of the executable. -as_me=`(basename "$0") 2>/dev/null || +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ @@ -228,6 +76,7 @@ /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` + # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' @@ -238,15 +87,15 @@ # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conftest.sh - echo "exit 0" >>conftest.sh - chmod +x conftest.sh - if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conftest.sh + rm -f conf$$.sh fi @@ -294,6 +143,8 @@ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} @@ -366,6 +217,12 @@ fi rm -f conf$$ conf$$.exe conf$$.file +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. @@ -382,9 +239,163 @@ IFS=" $as_nl" # CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } +$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. @@ -396,6 +407,7 @@ # Initializations. # ac_default_prefix=/usr/local +ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= @@ -452,6 +464,8 @@ #endif" ac_unique_file=""Makefile.config.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 INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVMGCCDIR ARCH CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT YACC EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL SED RM MKDIR DATE MV DOT ETAGS PURIFY ALLOCA LIBOBJS MMAP_FILE ENABLE_PURIFY ENABLE_OPTIMIZED USE_SPEC UPB JIT SPEC_ROOT BCR PAPIDIR OBJROOT LTLIBOBJS' +ac_subst_files='' # Initialize some variables set by options. ac_init_help= @@ -875,6 +889,9 @@ { (exit 1); exit 1; }; } fi fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias @@ -1089,7 +1106,7 @@ # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` @@ -1116,7 +1133,7 @@ if $ac_init_version; then cat <<\_ACEOF [LLVM] configure [1.0] -generated by GNU Autoconf 2.53 +generated by GNU Autoconf 2.57 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. @@ -1131,7 +1148,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by [LLVM] $as_me [1.0], which was -generated by GNU Autoconf 2.53. Invocation command line was +generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ @@ -1183,27 +1200,54 @@ # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= +ac_configure_args0= +ac_configure_args1= ac_sep= -for ac_arg +ac_must_keep_next=false +for ac_pass in 1 2 do - case $ac_arg in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n ) continue ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - ac_sep=" " ;; - esac - # Get rid of the leading space. + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there @@ -1214,6 +1258,7 @@ # Save into config.log some information that might help in debugging. { echo + cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## @@ -1236,6 +1281,35 @@ esac; } echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## @@ -1243,7 +1317,7 @@ ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h + sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && @@ -1409,12 +1483,9 @@ -ac_config_headers="$ac_config_headers include/Config/config.h" - - ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do +for ac_dir in autoconf $srcdir/autoconf; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" @@ -1430,14 +1501,19 @@ fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in autoconf $srcdir/autoconf" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in autoconf $srcdir/autoconf" >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + + ac_config_headers="$ac_config_headers include/Config/config.h" + + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -1602,9 +1678,7 @@ case $build in *i*86*) OS=Linux - DISABLE_LLC_DIFFS=DISABLE_LLC_DIFFS:=1 - - LLVMGCCDIR=/home/vadve/lattner/local/x86/llvm-gcc/ + LLVMGCCDIR=/home/vadve/lattner/local/x86/llvm-gcc/ ;; @@ -1750,14 +1824,12 @@ cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -1767,7 +1839,7 @@ } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe" +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. @@ -1786,26 +1858,39 @@ # 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= -for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; - ls a.out conftest 2>/dev/null; - ls a.* conftest.* 2>/dev/null`; do +# 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 | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; - a.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 --akim. - export ac_cv_exeext - break;; - * ) break;; + *.$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 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C++ compiler cannot create executables" >&5 -echo "$as_me: error: C++ compiler cannot create executables" >&2;} +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 @@ -1832,9 +1917,11 @@ cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C++ compiled programs. -If you meant to cross compile, use \`--host'." >&5 +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'." >&2;} +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi @@ -1842,7 +1929,7 @@ echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 -rm -f a.out a.exe conftest$ac_cv_exeext +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. @@ -1862,9 +1949,10 @@ # 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 `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; @@ -1872,8 +1960,10 @@ esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} + { { 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 @@ -1891,14 +1981,12 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -1915,16 +2003,19 @@ (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 ) ;; + *.$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 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} +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 @@ -1941,14 +2032,12 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -1975,7 +2064,8 @@ ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -1995,14 +2085,12 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2026,7 +2114,8 @@ ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_prog_cxx_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -2059,15 +2148,13 @@ do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include $ac_declaration -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2091,20 +2178,19 @@ : else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_declaration -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2128,7 +2214,8 @@ break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest.$ac_ext done @@ -2237,8 +2324,10 @@ fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} +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. @@ -2268,14 +2357,12 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2302,7 +2389,8 @@ ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -2322,14 +2410,12 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2353,7 +2439,8 @@ ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -2375,6 +2462,102 @@ 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 +#line $LINENO "configure" +/* 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; +} +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>&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.$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 @@ -2407,15 +2590,13 @@ do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include $ac_declaration -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2439,20 +2620,19 @@ : else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_declaration -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2476,7 +2656,8 @@ break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest.$ac_ext done @@ -2489,7 +2670,8 @@ else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c @@ -2521,18 +2703,28 @@ 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 #line $LINENO "configure" -#include "confdefs.h" -#include +/* 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=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -2549,7 +2741,8 @@ : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi @@ -2559,13 +2752,17 @@ # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -2583,7 +2780,8 @@ continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -2612,18 +2810,28 @@ 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 #line $LINENO "configure" -#include "confdefs.h" -#include +/* 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=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -2640,7 +2848,8 @@ : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi @@ -2650,13 +2859,17 @@ # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -2674,7 +2887,8 @@ continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -2687,8 +2901,10 @@ if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { { 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 @@ -2804,7 +3020,11 @@ LIBS="-lfl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -2813,12 +3033,6 @@ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2842,7 +3056,8 @@ ac_cv_lib_fl_yywrap=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_fl_yywrap=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -2862,7 +3077,11 @@ LIBS="-ll $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -2871,12 +3090,6 @@ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2900,7 +3113,8 @@ ac_cv_lib_l_yywrap=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_l_yywrap=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -2978,7 +3192,8 @@ ac_cv_prog_lex_yytext_pointer=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS @@ -3636,7 +3851,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 3639 "configure"' > conftest.$ac_ext + echo '#line 3854 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -3734,14 +3949,12 @@ cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -3765,7 +3978,8 @@ lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + lt_cv_cc_needs_belf=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -3797,48 +4011,59 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 ac_status=$? - egrep -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 - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (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 - cat conftest.$ac_ext >&5 - ac_cv_header_stdc=no +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f 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 #line $LINENO "configure" -#include "confdefs.h" +/* 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 + $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -3851,12 +4076,16 @@ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 + $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -3872,13 +4101,18 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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') \ +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) @@ -3911,11 +4145,12 @@ else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi @@ -3950,7 +4185,11 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> @@ -3970,7 +4209,8 @@ eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -4005,7 +4245,11 @@ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF @@ -4024,7 +4268,8 @@ ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -4036,13 +4281,17 @@ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -4059,7 +4308,8 @@ ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -4072,14 +4322,32 @@ { 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 preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf at gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; 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: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf at gnu.org. ## +## ------------------------------------ ## +_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 @@ -4120,18 +4388,28 @@ 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 #line $LINENO "configure" -#include "confdefs.h" -#include +/* 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=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -4148,7 +4426,8 @@ : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi @@ -4158,13 +4437,17 @@ # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -4182,7 +4465,8 @@ continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -4211,18 +4495,28 @@ 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 #line $LINENO "configure" -#include "confdefs.h" -#include +/* 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=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -4239,7 +4533,8 @@ : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi @@ -4249,13 +4544,17 @@ # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -4273,7 +4572,8 @@ continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -4286,8 +4586,10 @@ if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&5 -echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&2;} + { { 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 @@ -4303,7 +4605,7 @@ 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 cf77 cft77 frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 fc + for ac_prog in g77 f77 xlf frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 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 @@ -4345,7 +4647,7 @@ fi if test -z "$F77"; then ac_ct_F77=$F77 - for ac_prog in g77 f77 xlf cf77 cft77 frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 fc + for ac_prog in g77 f77 xlf frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4390,7 +4692,7 @@ # Provide some information about the compiler. -echo "$as_me:4393:" \ +echo "$as_me:4695:" \ "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 @@ -4441,7 +4743,8 @@ ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -4481,7 +4784,8 @@ ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_prog_f77_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -5397,11 +5701,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5400: $lt_compile\"" >&5) + (eval echo "\"\$as_me:5704: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:5404: \$? = $ac_status" >&5 + echo "$as_me:5708: \$? = $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 @@ -5629,11 +5933,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5632: $lt_compile\"" >&5) + (eval echo "\"\$as_me:5936: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:5636: \$? = $ac_status" >&5 + echo "$as_me:5940: \$? = $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 @@ -5696,11 +6000,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5699: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6003: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:5703: \$? = $ac_status" >&5 + echo "$as_me:6007: \$? = $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 @@ -6037,14 +6341,12 @@ # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -6073,7 +6375,8 @@ }'`; fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -6089,14 +6392,12 @@ # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -6125,7 +6426,8 @@ }'`; fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -7227,7 +7529,11 @@ LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -7236,12 +7542,6 @@ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -7265,7 +7565,8 @@ ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_dl_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -7293,37 +7594,44 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. */ -#include + 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 /* 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 (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* 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 -f = shl_load; +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != shl_load; ; return 0; } @@ -7343,7 +7651,8 @@ ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_shl_load=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -7362,7 +7671,11 @@ LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -7371,12 +7684,6 @@ /* 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 (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -7400,7 +7707,8 @@ ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_dld_shl_load=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -7418,37 +7726,44 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. */ -#include + 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 /* 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 (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* 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 -f = dlopen; +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != dlopen; ; return 0; } @@ -7468,7 +7783,8 @@ ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -7487,7 +7803,11 @@ LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -7496,12 +7816,6 @@ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -7525,7 +7839,8 @@ ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_dl_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -7545,7 +7860,11 @@ LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -7554,12 +7873,6 @@ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -7583,7 +7896,8 @@ ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_svld_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -7603,7 +7917,11 @@ LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -7612,12 +7930,6 @@ /* 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 (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -7641,7 +7953,8 @@ ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_dld_dld_link=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -7699,7 +8012,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -8870,7 +9181,8 @@ }'`; fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -8887,14 +9199,12 @@ # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -8923,7 +9233,8 @@ }'`; fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -9935,11 +10246,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9938: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10249: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9942: \$? = $ac_status" >&5 + echo "$as_me:10253: \$? = $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 @@ -10002,11 +10313,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10005: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10316: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10009: \$? = $ac_status" >&5 + echo "$as_me:10320: \$? = $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 @@ -10762,7 +11073,11 @@ LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -10771,12 +11086,6 @@ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -10800,7 +11109,8 @@ ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_dl_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -10828,37 +11138,44 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. */ -#include + 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 /* 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 (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* 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 -f = shl_load; +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != shl_load; ; return 0; } @@ -10878,7 +11195,8 @@ ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_shl_load=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -10897,7 +11215,11 @@ LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -10906,12 +11228,6 @@ /* 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 (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -10935,7 +11251,8 @@ ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_dld_shl_load=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -10953,37 +11270,44 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. */ -#include + 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 /* 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 (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* 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 -f = dlopen; +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != dlopen; ; return 0; } @@ -11003,7 +11327,8 @@ ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -11022,7 +11347,11 @@ LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -11031,12 +11360,6 @@ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -11060,7 +11383,8 @@ ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_dl_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -11080,7 +11404,11 @@ LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -11089,12 +11417,6 @@ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -11118,7 +11440,8 @@ ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_svld_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -11138,7 +11461,11 @@ LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -11147,12 +11474,6 @@ /* 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 (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -11176,7 +11497,8 @@ ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_dld_dld_link=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -11234,7 +11556,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:12479: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12161: \$? = $ac_status" >&5 + echo "$as_me:12483: \$? = $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 @@ -12221,11 +12543,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12224: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12546: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12228: \$? = $ac_status" >&5 + echo "$as_me:12550: \$? = $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 @@ -12585,7 +12907,8 @@ }'`; fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -12624,7 +12947,8 @@ }'`; fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -14163,11 +14487,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14166: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14490: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14170: \$? = $ac_status" >&5 + echo "$as_me:14494: \$? = $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 @@ -14395,11 +14719,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14398: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14722: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14402: \$? = $ac_status" >&5 + echo "$as_me:14726: \$? = $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 @@ -14462,11 +14786,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14465: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14789: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14469: \$? = $ac_status" >&5 + echo "$as_me:14793: \$? = $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 @@ -14803,14 +15127,12 @@ # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -14839,7 +15161,8 @@ }'`; fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -14855,14 +15178,12 @@ # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -14891,7 +15212,8 @@ }'`; fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -15993,7 +16315,11 @@ LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -16002,12 +16328,6 @@ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -16031,7 +16351,8 @@ ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_dl_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -16059,37 +16380,44 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. */ -#include + 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 /* 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 (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* 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 -f = shl_load; +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != shl_load; ; return 0; } @@ -16109,7 +16437,8 @@ ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_shl_load=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -16128,7 +16457,11 @@ LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -16137,12 +16470,6 @@ /* 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 (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -16166,7 +16493,8 @@ ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_dld_shl_load=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -16184,37 +16512,44 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. */ -#include + 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 /* 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 (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* 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 -f = dlopen; +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != dlopen; ; return 0; } @@ -16234,7 +16569,8 @@ ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -16253,7 +16589,11 @@ LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -16262,12 +16602,6 @@ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -16291,7 +16625,8 @@ ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_dl_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -16311,7 +16646,11 @@ LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -16320,12 +16659,6 @@ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -16349,7 +16682,8 @@ ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_svld_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -16369,7 +16703,11 @@ LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -16378,12 +16716,6 @@ /* 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 (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -16407,7 +16739,8 @@ ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_dld_dld_link=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -16465,7 +16798,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -17983,12 +18320,6 @@ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char elf_begin (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -18012,7 +18343,8 @@ ac_cv_lib_elf_elf_begin=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_elf_elf_begin=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -18039,7 +18371,11 @@ ac_cv_search_dlopen=no cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -18048,12 +18384,6 @@ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -18077,7 +18407,8 @@ ac_cv_search_dlopen="none required" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_dlopen" = no; then @@ -18085,7 +18416,11 @@ LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -18094,12 +18429,6 @@ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -18124,7 +18453,8 @@ break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done @@ -18152,7 +18482,11 @@ ac_cv_search_mallinfo=no cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -18161,12 +18495,6 @@ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char mallinfo (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -18190,7 +18518,8 @@ ac_cv_search_mallinfo="none required" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_mallinfo" = no; then @@ -18198,7 +18527,11 @@ LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 @@ -18207,12 +18540,6 @@ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char mallinfo (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -18237,7 +18564,8 @@ break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done @@ -18263,48 +18591,59 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 ac_status=$? - egrep -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 - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (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 - cat conftest.$ac_ext >&5 - ac_cv_header_stdc=no +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f 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 #line $LINENO "configure" -#include "confdefs.h" +/* 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 + $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -18317,12 +18656,16 @@ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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 + $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -18338,13 +18681,18 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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') \ +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) @@ -18377,11 +18725,12 @@ else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi @@ -18402,7 +18751,11 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #ifndef WEXITSTATUS @@ -18412,12 +18765,6 @@ # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -18443,7 +18790,8 @@ ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_header_sys_wait_h=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -18484,7 +18832,11 @@ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF @@ -18503,7 +18855,8 @@ ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -18515,13 +18868,17 @@ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -18538,7 +18895,8 @@ ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -18551,14 +18909,32 @@ { 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 preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf at gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; 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: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf at gnu.org. ## +## ------------------------------------ ## +_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 @@ -18602,7 +18978,11 @@ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF @@ -18621,7 +19001,8 @@ ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -18633,13 +19014,17 @@ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -18656,7 +19041,8 @@ ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -18669,14 +19055,32 @@ { 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 preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf at gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; 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: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf at gnu.org. ## +## ------------------------------------ ## +_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 @@ -18718,7 +19122,11 @@ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF @@ -18737,7 +19145,8 @@ ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -18749,13 +19158,17 @@ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -18772,7 +19185,8 @@ ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -18785,14 +19199,32 @@ { 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 preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf at gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; 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: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf at gnu.org. ## +## ------------------------------------ ## +_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 @@ -18816,103 +19248,6 @@ -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 -#line $LINENO "configure" -#include "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; -} -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; -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -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>&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 -cat conftest.$ac_ext >&5 -fi -rm -f 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 - echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then @@ -18920,14 +19255,12 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -18997,7 +19330,8 @@ ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -19021,10 +19355,15 @@ for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifndef __cplusplus -static $ac_kw int static_foo () {return 0; } -$ac_kw int foo () {return 0; } +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } #endif _ACEOF @@ -19043,7 +19382,8 @@ ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest.$ac_ext done @@ -19073,16 +19413,14 @@ # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -19109,16 +19447,14 @@ # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -19145,32 +19481,32 @@ ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_c_bigendian=no fi rm -f conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # It does not; compile a test program. if test "$cross_compiling" = yes; then - # try to guess the endianess by grep'ing values into an object file + # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -19191,10 +19527,10 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - if fgrep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi -if fgrep LiTTleEnDian conftest.$ac_objext >/dev/null ; then +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else @@ -19204,13 +19540,18 @@ fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int main () { @@ -19239,11 +19580,12 @@ else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_c_bigendian=yes fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -19262,9 +19604,9 @@ _ACEOF ;; *) - { { echo "$as_me:$LINENO: error: unknown endianess + { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianess +echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac @@ -19277,14 +19619,12 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -19311,7 +19651,8 @@ ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_pid_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -19335,14 +19676,12 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -19369,7 +19708,8 @@ ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_size_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -19393,14 +19733,12 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -19427,7 +19765,8 @@ ac_cv_type_int64_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_int64_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -19454,14 +19793,12 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -19488,7 +19825,8 @@ ac_cv_type_uint64_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_uint64_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -19515,17 +19853,15 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -19550,7 +19886,8 @@ ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_header_time=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -19572,16 +19909,14 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -19605,7 +19940,8 @@ ac_cv_struct_tm=time.h else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_struct_tm=sys/time.h fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -19636,14 +19972,12 @@ cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ namespace Outer { namespace Inner { int i = 0; }} -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -19667,7 +20001,8 @@ ac_cv_cxx_namespaces=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_cxx_namespaces=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -19705,17 +20040,15 @@ cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #ifdef HAVE_NAMESPACES using namespace std; #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -19739,23 +20072,22 @@ ac_cv_cxx_have_ext_hash_map=std else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_cxx_have_ext_hash_map=no fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #ifdef HAVE_NAMESPACES using namespace __gnu_cxx; #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -19779,7 +20111,8 @@ ac_cv_cxx_have_ext_hash_map=gnu else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_cxx_have_ext_hash_map=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -19824,17 +20157,15 @@ cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #ifdef HAVE_NAMESPACES using namespace std; #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -19858,23 +20189,22 @@ ac_cv_cxx_have_ext_hash_set=std else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_cxx_have_ext_hash_set=no fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #ifdef HAVE_NAMESPACES using namespace __gnu_cxx; #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -19898,7 +20228,8 @@ ac_cv_cxx_have_ext_hash_set=gnu else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_cxx_have_ext_hash_set=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -19943,17 +20274,15 @@ cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #ifdef HAVE_NAMESPACES using namespace std; #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -19977,23 +20306,22 @@ ac_cv_cxx_have_ext_slist=std else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_cxx_have_ext_slist=no fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #ifdef HAVE_NAMESPACES using namespace __gnu_cxx; #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -20017,7 +20345,8 @@ ac_cv_cxx_have_ext_slist=gnu else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_cxx_have_ext_slist=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -20063,17 +20392,15 @@ cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #ifdef HAVE_NAMESPACES using namespace std; #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -20097,7 +20424,8 @@ ac_cv_cxx_have_std_iterator=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_cxx_have_std_iterator=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -20135,17 +20463,15 @@ cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #ifdef HAVE_NAMESPACES using namespace std; #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -20169,7 +20495,8 @@ ac_cv_cxx_have_bi_iterator=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_cxx_have_bi_iterator=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -20207,17 +20534,15 @@ cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #ifdef HAVE_NAMESPACES using namespace std; #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -20241,7 +20566,8 @@ ac_cv_cxx_have_fwd_iterator=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_cxx_have_fwd_iterator=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -20273,14 +20599,12 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -20304,7 +20628,8 @@ ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_working_alloca_h=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -20326,7 +20651,11 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else @@ -20348,12 +20677,6 @@ # endif #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -20377,7 +20700,8 @@ ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_alloca_works=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -20411,7 +20735,11 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #if defined(CRAY) && ! defined(CRAY2) webecray #else @@ -20420,7 +20748,7 @@ _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "webecray" >/dev/null 2>&1; then + $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no @@ -20440,37 +20768,44 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif /* 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 $ac_func (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else -f = $ac_func; +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != $ac_func; ; return 0; } @@ -20490,7 +20825,8 @@ eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -20519,7 +20855,11 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int find_stack_direction () { @@ -20555,11 +20895,12 @@ else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 @@ -20581,12 +20922,16 @@ ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "$ac_pattern" >/dev/null 2>&1; then + $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no @@ -20597,12 +20942,16 @@ if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "$ac_pattern" >/dev/null 2>&1; then + $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* @@ -20626,14 +20975,12 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -20681,11 +21028,12 @@ else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_func_memcmp_working=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 @@ -20711,7 +21059,11 @@ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF @@ -20730,7 +21082,8 @@ ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -20742,13 +21095,17 @@ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* 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=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -20765,7 +21122,8 @@ ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -20778,14 +21136,32 @@ { 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 preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf at gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; 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: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf at gnu.org. ## +## ------------------------------------ ## +_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 @@ -20818,37 +21194,44 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif /* 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 $ac_func (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else -f = $ac_func; +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != $ac_func; ; return 0; } @@ -20868,7 +21251,8 @@ eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -20893,7 +21277,11 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc @@ -21036,11 +21424,12 @@ else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 @@ -21068,13 +21457,19 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 -echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifdef HAVE_SYS_MMAN_H #include @@ -21107,11 +21502,12 @@ else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_func_mmap_file=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -21153,16 +21549,14 @@ cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -21186,7 +21580,8 @@ ac_cv_header_mmap_anon=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_header_mmap_anon=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -21214,7 +21609,11 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #ifdef signal @@ -21226,12 +21625,6 @@ void (*signal ()) (); #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -21255,7 +21648,8 @@ ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_signal=int fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -21287,37 +21681,44 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif /* 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 $ac_func (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else -f = $ac_func; +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != $ac_func; ; return 0; } @@ -21337,7 +21738,8 @@ eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -21361,37 +21763,44 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char mmap (); below. */ -#include + which can conflict with char mmap (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif /* 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 mmap (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* 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_mmap) || defined (__stub___mmap) choke me #else -f = mmap; +char (*f) () = mmap; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != mmap; ; return 0; } @@ -21411,7 +21820,8 @@ ac_cv_func_mmap=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_mmap=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -21433,37 +21843,44 @@ else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char mprotect (); below. */ -#include + which can conflict with char mprotect (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif /* 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 mprotect (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* 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_mprotect) || defined (__stub___mprotect) choke me #else -f = mprotect; +char (*f) () = mprotect; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != mprotect; ; return 0; } @@ -21483,7 +21900,8 @@ ac_cv_func_mprotect=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_mprotect=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -21605,7 +22023,7 @@ fi; -ac_config_files="$ac_config_files Makefile.config" + ac_config_files="$ac_config_files Makefile.config" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -21616,7 +22034,7 @@ # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overriden when +# `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. @@ -21651,7 +22069,7 @@ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache -if cmp -s $cache_file confcache; then :; else +if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file @@ -21682,6 +22100,21 @@ DEFS=-DHAVE_CONFIG_H +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -21696,11 +22129,12 @@ # configure, is in config.log if it exists. debug=false +ac_cs_recheck=false +ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -21709,11 +22143,13 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi -# NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset @@ -21721,34 +22157,42 @@ as_unset=false fi -(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && - { $as_unset LANG || test "${LANG+set}" != set; } || - { LANG=C; export LANG; } -(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && - { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || - { LC_ALL=C; export LC_ALL; } -(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && - { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || - { LC_TIME=C; export LC_TIME; } -(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && - { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || - { LC_CTYPE=C; export LC_CTYPE; } -(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && - { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || - { LANGUAGE=C; export LANGUAGE; } -(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && - { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || - { LC_COLLATE=C; export LC_COLLATE; } -(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && - { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || - { LC_NUMERIC=C; export LC_NUMERIC; } -(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && - { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || - { LC_MESSAGES=C; export LC_MESSAGES; } + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi # Name of the executable. -as_me=`(basename "$0") 2>/dev/null || +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ @@ -21759,6 +22203,7 @@ /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` + # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' @@ -21769,15 +22214,15 @@ # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conftest.sh - echo "exit 0" >>conftest.sh - chmod +x conftest.sh - if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conftest.sh + rm -f conf$$.sh fi @@ -21826,6 +22271,8 @@ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} @@ -21899,6 +22346,12 @@ fi rm -f conf$$ conf$$.exe conf$$.file +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. @@ -21915,7 +22368,7 @@ IFS=" $as_nl" # CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } +$as_unset CDPATH exec 6>&1 @@ -21932,7 +22385,7 @@ cat >&5 <<_CSEOF This file was extended by [LLVM] $as_me [1.0], which was -generated by GNU Autoconf 2.53. Invocation command line was +generated by GNU Autoconf 2.57. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -21972,6 +22425,7 @@ -h, --help print this help, then exit -V, --version print version number, then exit + -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] @@ -21991,7 +22445,7 @@ cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ [LLVM] config.status [1.0] -configured by $0, generated by GNU Autoconf 2.53, +configured by $0, generated by GNU Autoconf 2.57, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 @@ -22012,25 +22466,25 @@ --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - shift - set dummy "$ac_option" "$ac_optarg" ${1+"$@"} - shift + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift ;; - -*);; *) # This is not an option, so the user has probably given explicit # arguments. + ac_option=$1 ac_need_defaults=false;; esac - case $1 in + case $ac_option in # Handling of the options. _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" - exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; -_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) @@ -22045,13 +22499,16 @@ --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) - shift - CONFIG_FILES="$CONFIG_FILES $1" + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) - shift - CONFIG_HEADERS="$CONFIG_HEADERS $1" + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 @@ -22066,6 +22523,20 @@ shift done +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + _ACEOF @@ -22094,6 +22565,9 @@ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { @@ -22102,17 +22576,17 @@ } # Create a (secure) tmp directory for tmp files. -: ${TMPDIR=/tmp} + { - tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=$TMPDIR/cs$$-$RANDOM + tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { - echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } @@ -22176,7 +22650,6 @@ s, at target_vendor@,$target_vendor,;t t s, at target_os@,$target_os,;t t s, at OS@,$OS,;t t -s, at DISABLE_LLC_DIFFS@,$DISABLE_LLC_DIFFS,;t t s, at LLVMGCCDIR@,$LLVMGCCDIR,;t t s, at ARCH@,$ARCH,;t t s, at CXX@,$CXX,;t t @@ -22229,6 +22702,7 @@ s, at BCR@,$BCR,;t t s, at PAPIDIR@,$PAPIDIR,;t t s, at OBJROOT@,$OBJROOT,;t t +s, at LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF @@ -22299,25 +22773,30 @@ /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || - mkdir "$as_incr_dir" || - { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; } - ;; - esac -done; } + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } ac_builddir=. @@ -22347,7 +22826,7 @@ # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` @@ -22537,7 +23016,7 @@ # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail @@ -22561,7 +23040,7 @@ mv conftest.tail conftest.defines done rm -f conftest.defines -echo ' fi # egrep' >>$CONFIG_STATUS +echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size @@ -22601,7 +23080,7 @@ cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then - if cmp -s $ac_file $tmp/config.h 2>/dev/null; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else @@ -22617,25 +23096,30 @@ /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || - mkdir "$as_incr_dir" || - { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; } - ;; - esac -done; } + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file @@ -22665,8 +23149,11 @@ # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null - $SHELL $CONFIG_STATUS || ac_cs_success=false + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. From criswell at choi.cs.uiuc.edu Tue Jul 22 14:19:14 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Tue Jul 22 14:19:14 2003 Subject: [llvm-commits] CVS: llvm/Makefile.config.in Message-ID: <200307221918.h6MJIFE23135@choi.cs.uiuc.edu> Changes in directory llvm: Makefile.config.in updated: 1.9 -> 1.10 --- Log message: Updated to use files within the autoconf subdirectory. --- Diffs of the changes: Index: llvm/Makefile.config.in diff -u llvm/Makefile.config.in:1.9 llvm/Makefile.config.in:1.10 --- llvm/Makefile.config.in:1.9 Wed Jul 2 16:20:04 2003 +++ llvm/Makefile.config.in Tue Jul 22 14:17:35 2003 @@ -67,7 +67,7 @@ SED = @SED@ RM = @RM@ ECHO = @ECHO@ -MKDIR = @abs_top_srcdir@/mkinstalldirs +MKDIR = @abs_top_srcdir@/autoconf/mkinstalldirs DATE = @DATE@ MV = @MV@ INSTALL = @INSTALL@ From criswell at choi.cs.uiuc.edu Tue Jul 22 15:08:01 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Tue Jul 22 15:08:01 2003 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200307222008.h6MK80118132@choi.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.7 -> 1.8 --- Log message: Made some corrections to the enable-llc_diffs option. This should keep it from breaking for now. --- Diffs of the changes: Index: llvm/configure diff -u llvm/configure:1.7 llvm/configure:1.8 --- llvm/configure:1.7 Tue Jul 22 14:18:09 2003 +++ llvm/configure Tue Jul 22 15:07:49 2003 @@ -464,7 +464,7 @@ #endif" ac_unique_file=""Makefile.config.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 INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVMGCCDIR ARCH CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT YACC EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL SED RM MKDIR DATE MV DOT ETAGS PURIFY ALLOCA LIBOBJS MMAP_FILE ENABLE_PURIFY ENABLE_OPTIMIZED USE_SPEC UPB JIT SPEC_ROOT BCR PAPIDIR OBJROOT LTLIBOBJS' +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 INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVMGCCDIR ARCH CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT YACC EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL SED RM MKDIR DATE MV DOT ETAGS PURIFY ALLOCA LIBOBJS MMAP_FILE ENABLE_PURIFY ENABLE_OPTIMIZED USE_SPEC UPB DISABLE_LLC_DIFFS JIT SPEC_ROOT BCR PAPIDIR OBJROOT LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1034,6 +1034,7 @@ --enable-spec Compile SPEC benchmarks (default is NO) --enable-precompiled_bytecode Use pre-compiled bytecode (default is NO) + --enable-llc_diffs Enable LLC Diffs when testing (default is YES) --enable-jit Enable Just In Time Compiling (default is NO) Optional Packages: @@ -1678,7 +1679,7 @@ case $build in *i*86*) OS=Linux - LLVMGCCDIR=/home/vadve/lattner/local/x86/llvm-gcc/ + LLVMGCCDIR=/home/vadve/lattner/local/x86/llvm-gcc/ ;; @@ -3851,7 +3852,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 3854 "configure"' > conftest.$ac_ext + echo '#line 3855 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4692,7 +4693,7 @@ # Provide some information about the compiler. -echo "$as_me:4695:" \ +echo "$as_me:4696:" \ "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 @@ -5701,11 +5702,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5704: $lt_compile\"" >&5) + (eval echo "\"\$as_me:5705: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:5708: \$? = $ac_status" >&5 + echo "$as_me:5709: \$? = $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 @@ -5933,11 +5934,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5936: $lt_compile\"" >&5) + (eval echo "\"\$as_me:5937: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:5940: \$? = $ac_status" >&5 + echo "$as_me:5941: \$? = $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 @@ -6000,11 +6001,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6003: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6004: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6007: \$? = $ac_status" >&5 + echo "$as_me:6008: \$? = $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 @@ -8012,7 +8013,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:10250: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10253: \$? = $ac_status" >&5 + echo "$as_me:10254: \$? = $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 @@ -10313,11 +10314,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10316: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10317: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10320: \$? = $ac_status" >&5 + echo "$as_me:10321: \$? = $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 @@ -11556,7 +11557,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:12480: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12483: \$? = $ac_status" >&5 + echo "$as_me:12484: \$? = $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 @@ -12543,11 +12544,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12546: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12547: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12550: \$? = $ac_status" >&5 + echo "$as_me:12551: \$? = $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 @@ -14487,11 +14488,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14490: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14491: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14494: \$? = $ac_status" >&5 + echo "$as_me:14495: \$? = $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 @@ -14719,11 +14720,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14722: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14723: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14726: \$? = $ac_status" >&5 + echo "$as_me:14727: \$? = $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 @@ -14786,11 +14787,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14789: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14790: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14793: \$? = $ac_status" >&5 + echo "$as_me:14794: \$? = $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 @@ -16798,7 +16799,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < Changes in directory llvm/www/docs: WritingAnLLVMPass.html updated: 1.15 -> 1.16 --- Log message: Add documentation for runOnMachineFunction() --- Diffs of the changes: Index: llvm/www/docs/WritingAnLLVMPass.html diff -u llvm/www/docs/WritingAnLLVMPass.html:1.15 llvm/www/docs/WritingAnLLVMPass.html:1.16 --- llvm/www/docs/WritingAnLLVMPass.html:1.15 Thu Jul 17 13:53:20 2003 +++ llvm/www/docs/WritingAnLLVMPass.html Tue Jul 22 15:53:20 2003 @@ -42,6 +42,10 @@
  • The MachineFunctionPass class +
  • Pass Registration
      @@ -597,6 +601,28 @@

      + +


    The +runOnMachineFunction(MachineFunction &MF) method

    @@ -1250,6 +1276,6 @@
    Chris Lattner
    -Last modified: Mon Jul 14 12:12:53 CDT 2003 +Last modified: Tue Jul 22 15:52:30 CDT 2003
    From criswell at choi.cs.uiuc.edu Tue Jul 22 16:01:02 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Tue Jul 22 16:01:02 2003 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200307222100.h6ML0Ym06627@choi.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.8 -> 1.9 --- Log message: Repaired the --enable and --disable options. --- Diffs of the changes: Index: llvm/configure diff -u llvm/configure:1.8 llvm/configure:1.9 --- llvm/configure:1.8 Tue Jul 22 15:07:49 2003 +++ llvm/configure Tue Jul 22 16:00:24 2003 @@ -21918,70 +21918,104 @@ fi + # Check whether --enable-purify or --disable-purify was given. if test "${enable_purify+set}" = set; then enableval="$enable_purify" - ENABLE_PURIFY=ENABLE_PURIFY=1 else - ENABLE_PURIFY= - + enableval="no" fi; +if test ${enableval} = "no" +then + ENABLE_PURIFY= + +else + ENABLE_PURIFY=ENABLE_PURIFY=1 + +fi + # Check whether --enable-optimized or --disable-optimized was given. if test "${enable_optimized+set}" = set; then enableval="$enable_optimized" - ENABLE_OPTIMIZED=ENABLE_OPTIMIZED=1 else - ENABLE_OPTIMIZED= - + enableval=no fi; +if test ${enableval} = "no" +then + ENABLE_OPTIMIZED= + +else + ENABLE_OPTIMIZED=ENABLE_OPTIMIZED=1 + +fi + # Check whether --enable-spec or --disable-spec was given. if test "${enable_spec+set}" = set; then enableval="$enable_spec" - USE_SPEC=USE_SPEC=1 else - USE_SPEC= - + enableval=no fi; +if test ${enableval} = "no" +then + USE_SPEC= + +else + USE_SPEC=USE_SPEC=1 + +fi + # Check whether --enable-precompiled_bytecode or --disable-precompiled_bytecode was given. if test "${enable_precompiled_bytecode+set}" = set; then enableval="$enable_precompiled_bytecode" - UPB=USE_PRECOMPILED_BYTECODE=1 else - UPB= - + enableval=no fi; +if test ${enableval} = "no" +then + UPB= -DISABLE_LLC_DIFFS= +else + UPB=USE_PRECOMPILED_BYTECODE=1 + +fi # Check whether --enable-llc_diffs or --disable-llc_diffs was given. if test "${enable_llc_diffs+set}" = set; then enableval="$enable_llc_diffs" - if test ${enableval} = "no"; then DISABLE_LLC_DIFFS=DISABLE_LLC_DIFFS:=1; fi; else - DISABLE_LLC_DIFFS= - + enableval=yes fi; +if test ${enableval} = "no" +then + DISABLE_LLC_DIFFS=DISABLE_LLC_DIFFS:=1 + +else + DISABLE_LLC_DIFFS= + +fi -case $build in - *i*86*) # Check whether --enable-jit or --disable-jit was given. +# Check whether --enable-jit or --disable-jit was given. if test "${enable_jit+set}" = set; then enableval="$enable_jit" - JIT=TARGET_HAS_JIT=1 else - JIT= - + enableval=no fi; - ;; - *) - ;; -esac + +if test ${enableval} = "no" +then + JIT= + +else + JIT=TARGET_HAS_JIT=1 + +fi # Check whether --with-spec or --without-spec was given. From criswell at choi.cs.uiuc.edu Tue Jul 22 16:01:10 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Tue Jul 22 16:01:10 2003 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200307222100.h6ML03f06610@choi.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.1 -> 1.2 --- Log message: Fixed the enable/disable options. The AC_ARG_ENABLE macro does not perform the *action-if-not-given* code when the --disable option is used. Rather, the AC_ARG_ENABLE macro sets the $enableval variable, which then needs to be checked to determine if --enable, --disable, or neither was specified. --- Diffs of the changes: Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.1 llvm/autoconf/configure.ac:1.2 --- llvm/autoconf/configure.ac:1.1 Tue Jul 22 14:13:20 2003 +++ llvm/autoconf/configure.ac Tue Jul 22 15:59:52 2003 @@ -40,9 +40,6 @@ dnl case $build in *i*86*) AC_SUBST(OS,[Linux]) - dnl Turned off DISABLE_LLC_DIFFS now that LLC/x86 is - dnl viable for almost all our test cases. - dnl AC_SUBST(DISABLE_LLC_DIFFS,[[DISABLE_LLC_DIFFS:=1]]) AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/x86/llvm-gcc/]) ;; @@ -227,16 +224,62 @@ dnl ************************************************************************** dnl * Enable various compile-time options dnl ************************************************************************** -AC_ARG_ENABLE(purify,AC_HELP_STRING([--enable-purify],[Compile with purify (default is NO)]), AC_SUBST(ENABLE_PURIFY,[[ENABLE_PURIFY=1]]), AC_SUBST(ENABLE_PURIFY,[[]])) -AC_ARG_ENABLE(optimized,AC_HELP_STRING([--enable-optimized],[Compile with optimizations enabled (default is NO)]), AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]]), AC_SUBST(ENABLE_OPTIMIZED,[[]])) -AC_ARG_ENABLE(spec,AC_HELP_STRING([--enable-spec],[Compile SPEC benchmarks (default is NO)]), AC_SUBST(USE_SPEC,[[USE_SPEC=1]]), AC_SUBST(USE_SPEC,[[]])) -AC_ARG_ENABLE(precompiled_bytecode,AC_HELP_STRING([--enable-precompiled_bytecode],[Use pre-compiled bytecode (default is NO)]), AC_SUBST(UPB,[[USE_PRECOMPILED_BYTECODE=1]]), AC_SUBST(UPB,[[]])) -case $build in - *i*86*) AC_ARG_ENABLE(jit,AC_HELP_STRING([--enable-jit],[Enable Just In Time Compiling (default is NO)]), AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]), AC_SUBST(JIT,[[]])) - ;; - *) - ;; -esac + +dnl Purify Option +AC_ARG_ENABLE(purify,AC_HELP_STRING([--enable-purify],[Compile with purify (default is NO)]),,enableval="no") +if test ${enableval} = "no" +then + AC_SUBST(ENABLE_PURIFY,[[]]) +else + AC_SUBST(ENABLE_PURIFY,[[ENABLE_PURIFY=1]]) +fi + +dnl Optimized Option +AC_ARG_ENABLE(optimized,AC_HELP_STRING([--enable-optimized],[Compile with optimizations enabled (default is NO)]),,enableval=no) +if test ${enableval} = "no" +then + AC_SUBST(ENABLE_OPTIMIZED,[[]]) +else + AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]]) +fi + +dnl Spec Benchmarks +AC_ARG_ENABLE(spec,AC_HELP_STRING([--enable-spec],[Compile SPEC benchmarks (default is NO)]),,enableval=no) +if test ${enableval} = "no" +then + AC_SUBST(USE_SPEC,[[]]) +else + AC_SUBST(USE_SPEC,[[USE_SPEC=1]]) +fi + +dnl Precompiled Bytecode Option +AC_ARG_ENABLE(precompiled_bytecode,AC_HELP_STRING([--enable-precompiled_bytecode],[Use pre-compiled bytecode (default is NO)]),,enableval=no) +if test ${enableval} = "no" +then + AC_SUBST(UPB,[[]]) +else + AC_SUBST(UPB,[[USE_PRECOMPILED_BYTECODE=1]]) +fi + + +dnl LLC Diff Option +AC_ARG_ENABLE(llc_diffs,AC_HELP_STRING([--enable-llc_diffs],[Enable LLC Diffs when testing (default is YES)]),,enableval=yes) +if test ${enableval} = "no" +then + AC_SUBST(DISABLE_LLC_DIFFS,[DISABLE_LLC_DIFFS:=1]) +else + AC_SUBST(DISABLE_LLC_DIFFS,[[]]) +fi + +dnl JIT Option +AC_ARG_ENABLE(jit,AC_HELP_STRING([--enable-jit],[Enable Just In Time Compiling (default is NO)]),,enableval=no) + +if test ${enableval} = "no" +then + AC_SUBST(JIT,[[]]) +else + AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) +fi dnl ************************************************************************** dnl * Set the location of various third-party software packages From lattner at cs.uiuc.edu Tue Jul 22 16:45:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jul 22 16:45:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/and.ll cast.ll Message-ID: <200307222144.QAA16587@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: and.ll updated: 1.9 -> 1.10 cast.ll updated: 1.11 -> 1.12 --- Log message: New testcases --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/and.ll diff -u llvm/test/Regression/Transforms/InstCombine/and.ll:1.9 llvm/test/Regression/Transforms/InstCombine/and.ll:1.10 --- llvm/test/Regression/Transforms/InstCombine/and.ll:1.9 Sat Jun 28 18:31:56 2003 +++ llvm/test/Regression/Transforms/InstCombine/and.ll Tue Jul 22 16:44:06 2003 @@ -47,3 +47,14 @@ ret ubyte %C } +bool %test9(int %A) { + %B = and int %A, -2147483648 ; Test of sign bit, convert to setle %A, 0 + %C = cast int %B to bool + ret bool %C +} + +bool %test9(uint %A) { + %B = and uint %A, 2147483648 ; Test of sign bit, convert to setle %A, 0 + %C = cast uint %B to bool + ret bool %C +} Index: llvm/test/Regression/Transforms/InstCombine/cast.ll diff -u llvm/test/Regression/Transforms/InstCombine/cast.ll:1.11 llvm/test/Regression/Transforms/InstCombine/cast.ll:1.12 --- llvm/test/Regression/Transforms/InstCombine/cast.ll:1.11 Sat Jun 28 18:31:56 2003 +++ llvm/test/Regression/Transforms/InstCombine/cast.ll Tue Jul 22 16:44:06 2003 @@ -68,19 +68,24 @@ bool %test11(ubyte %A, ubyte %B) { %C = sub ubyte %A, %B - %D = cast ubyte %C to bool ; == setne A, B - ret bool %D + %cD = cast ubyte %C to bool ; == setne A, B + ret bool %cD } bool %test12(ubyte %A) { %B = add ubyte %A, 255 - %C = cast ubyte %B to bool ; === A != 1 - ret bool %C + %c = cast ubyte %B to bool ; === A != 1 + ret bool %c } bool %test13(ubyte %A, ubyte %b) { %B = add ubyte %A, %b - %C = cast ubyte %B to bool ; === A != -b - ret bool %C + %c = cast ubyte %B to bool ; === A != -b + ret bool %c } +bool %test14(ubyte %A) { + %B = xor ubyte %A, 4 + %c = cast ubyte %B to bool + ret bool %c +} From lattner at cs.uiuc.edu Tue Jul 22 16:48:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jul 22 16:48:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200307222147.QAA16794@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.96 -> 1.97 --- Log message: - InstCombine (cast (xor A, B) to bool) ==> (setne A, B) - InstCombine (cast (and X, (1 << size(X)-1)) to bool) ==> x < 0 --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.96 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.97 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.96 Mon Jul 21 14:42:57 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Jul 22 16:46:59 2003 @@ -291,6 +291,13 @@ return Changed ? &I : 0; } +// isSignBit - Return true if the value represented by the constant only has the +// highest order bit set. +static bool isSignBit(ConstantInt *CI) { + unsigned NumBits = CI->getType()->getPrimitiveSize()*8; + return (CI->getRawValue() & ~(-1LL << NumBits)) == (1ULL << (NumBits-1)); +} + Instruction *InstCombiner::visitSub(BinaryOperator &I) { Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); @@ -959,13 +966,15 @@ if (BinaryOperator *BO = dyn_cast(Src)) { Value *Op0 = BO->getOperand(0), *Op1 = BO->getOperand(1); - // Replace (cast (sub A, B) to bool) with (setne A, B) - if (BO->getOpcode() == Instruction::Sub) + switch (BO->getOpcode()) { + case Instruction::Sub: + case Instruction::Xor: + // Replace (cast ([sub|xor] A, B) to bool) with (setne A, B) return new SetCondInst(Instruction::SetNE, Op0, Op1); // Replace (cast (add A, B) to bool) with (setne A, -B) if B is // efficiently invertible, or if the add has just this one use. - if (BO->getOpcode() == Instruction::Add) + case Instruction::Add: if (Value *NegVal = dyn_castNegVal(Op1)) return new SetCondInst(Instruction::SetNE, Op0, NegVal); else if (Value *NegVal = dyn_castNegVal(Op0)) @@ -976,6 +985,36 @@ InsertNewInstBefore(Neg, CI); return new SetCondInst(Instruction::SetNE, Op0, Neg); } + break; + + case Instruction::And: + // Replace (cast (and X, (1 << size(X)-1)) to bool) with x < 0, + // converting X to be a signed value as appropriate. Don't worry about + // bool values, as they will be optimized other ways if they occur in + // this configuration. + if (ConstantInt *CInt = dyn_cast(Op1)) + if (isSignBit(CInt)) { + // If 'X' is not signed, insert a cast now... + if (!CInt->getType()->isSigned()) { + const Type *DestTy; + switch (CInt->getType()->getPrimitiveID()) { + case Type::UByteTyID: DestTy = Type::SByteTy; break; + case Type::UShortTyID: DestTy = Type::ShortTy; break; + case Type::UIntTyID: DestTy = Type::IntTy; break; + case Type::ULongTyID: DestTy = Type::LongTy; break; + default: assert(0 && "Invalid unsigned integer type!"); abort(); + } + CastInst *NewCI = new CastInst(Op0, DestTy, + Op0->getName()+".signed"); + InsertNewInstBefore(NewCI, CI); + Op0 = NewCI; + } + return new SetCondInst(Instruction::SetLT, Op0, + Constant::getNullValue(Op0->getType())); + } + break; + default: break; + } } } @@ -1294,7 +1333,7 @@ // Instcombine load (constant global) into the value loaded... if (GlobalVariable *GV = dyn_cast(Op)) - if ((GV->isConstant()) && (!(GV->isExternal()))) + if (GV->isConstant() && !GV->isExternal()) return ReplaceInstUsesWith(LI, GV->getInitializer()); // Instcombine load (constantexpr_GEP global, 0, ...) into the value loaded... @@ -1302,7 +1341,7 @@ if (CE->getOpcode() == Instruction::GetElementPtr) if (ConstantPointerRef *G=dyn_cast(CE->getOperand(0))) if (GlobalVariable *GV = dyn_cast(G->getValue())) - if ((GV->isConstant()) && (!(GV->isExternal()))) + if (GV->isConstant() && !GV->isExternal()) if (Constant *V = GetGEPGlobalInitializer(GV->getInitializer(), CE)) return ReplaceInstUsesWith(LI, V); return 0; From lattner at cs.uiuc.edu Tue Jul 22 22:33:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jul 22 22:33:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/TailDuplication.cpp Message-ID: <200307230332.WAA31600@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: TailDuplication.cpp updated: 1.4 -> 1.5 --- Log message: Fix bug: TailDup/2003-07-22-InfiniteLoop.ll --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/TailDuplication.cpp diff -u llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.4 llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.5 --- llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.4 Tue Jun 24 14:48:06 2003 +++ llvm/lib/Transforms/Scalar/TailDuplication.cpp Tue Jul 22 22:32:41 2003 @@ -76,6 +76,11 @@ BasicBlock *Dest = BI->getSuccessor(0); if (Dest == BI->getParent()) return false; // Do not loop infinitely! + // Do not inline a block if we will just get another branch to the same block! + if (BranchInst *DBI = dyn_cast(Dest->getTerminator())) + if (DBI->isUnconditional() && DBI->getSuccessor(0) == Dest) + return false; // Do not loop infinitely! + // Do not bother working on dead blocks... pred_iterator PI = pred_begin(Dest), PE = pred_end(Dest); if (PI == PE && Dest != Dest->getParent()->begin()) From lattner at cs.uiuc.edu Tue Jul 22 22:33:09 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jul 22 22:33:09 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/TailDup/2003-07-22-InfiniteLoop.ll Message-ID: <200307230332.WAA31588@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/TailDup: 2003-07-22-InfiniteLoop.ll added (r1.1) --- Log message: New testcase that caused infinite loop in taildup --- Diffs of the changes: Index: llvm/test/Regression/Transforms/TailDup/2003-07-22-InfiniteLoop.ll diff -c /dev/null llvm/test/Regression/Transforms/TailDup/2003-07-22-InfiniteLoop.ll:1.1 *** /dev/null Tue Jul 22 22:32:22 2003 --- llvm/test/Regression/Transforms/TailDup/2003-07-22-InfiniteLoop.ll Tue Jul 22 22:32:11 2003 *************** *** 0 **** --- 1,13 ---- + ; RUN: as < %s | opt -tailduplicate -disable-output + + implementation + + int %sum() { + entry: + br label %loopentry + + loopentry: + %i.0 = phi int [ 1, %entry ], [ %tmp.3, %loopentry ] + %tmp.3 = add int %i.0, 1 + br label %loopentry + } From lattner at cs.uiuc.edu Wed Jul 23 09:50:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 09:50:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Constants.h Message-ID: <200307231449.JAA00361@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: Constants.h updated: 1.27 -> 1.28 --- Log message: Add more doxygen comments, add new ConstantInt::getRawValue method --- Diffs of the changes: Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.27 llvm/include/llvm/Constants.h:1.28 --- llvm/include/llvm/Constants.h:1.27 Sat Jun 21 22:07:32 2003 +++ llvm/include/llvm/Constants.h Wed Jul 23 09:49:06 2003 @@ -131,6 +131,11 @@ /// static ConstantInt *get(const Type *Ty, unsigned char V); + /// getRawValue - return the underlying value of this constant as a 64-bit + /// unsigned integer value. + /// + inline uint64_t getRawValue() const { return Val.Unsigned; } + /// isNullValue - Return true if this is the value that would be returned by /// getNullValue. virtual bool isNullValue() const { return Val.Unsigned == 0; } @@ -157,12 +162,15 @@ ConstantSInt(const Type *Ty, int64_t V); public: /// get() - Static factory methods - Return objects of the specified value + /// static ConstantSInt *get(const Type *Ty, int64_t V); /// isValueValidForType - return true if Ty is big enough to represent V. + /// static bool isValueValidForType(const Type *Ty, int64_t V); /// getValue - return the underlying value of this constant. + /// inline int64_t getValue() const { return Val.Signed; } virtual bool isAllOnesValue() const { return getValue() == -1; } @@ -188,6 +196,7 @@ } /// Methods for support type inquiry through isa, cast, and dyn_cast: + /// static inline bool classof(const ConstantSInt *) { return true; } static bool classof(const Constant *CPV); // defined in Constants.cpp static inline bool classof(const Value *V) { @@ -205,12 +214,15 @@ ConstantUInt(const Type *Ty, uint64_t V); public: /// get() - Static factory methods - Return objects of the specified value + /// static ConstantUInt *get(const Type *Ty, uint64_t V); /// isValueValidForType - return true if Ty is big enough to represent V. + /// static bool isValueValidForType(const Type *Ty, uint64_t V); /// getValue - return the underlying value of this constant. + /// inline uint64_t getValue() const { return Val.Unsigned; } /// isMaxValue - Return true if this is the largest value that may be From lattner at cs.uiuc.edu Wed Jul 23 09:55:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 09:55:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/WriteConst.cpp Message-ID: <200307231454.JAA00596@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: WriteConst.cpp updated: 1.21 -> 1.22 --- Log message: Remove explicit const qualifiers --- Diffs of the changes: Index: llvm/lib/Bytecode/Writer/WriteConst.cpp diff -u llvm/lib/Bytecode/Writer/WriteConst.cpp:1.21 llvm/lib/Bytecode/Writer/WriteConst.cpp:1.22 --- llvm/lib/Bytecode/Writer/WriteConst.cpp:1.21 Wed Mar 19 14:56:46 2003 +++ llvm/lib/Bytecode/Writer/WriteConst.cpp Wed Jul 23 09:54:33 2003 @@ -23,7 +23,7 @@ switch (T->getPrimitiveID()) { // Handle derived types now. case Type::FunctionTyID: { - const FunctionType *MT = cast(T); + const FunctionType *MT = cast(T); int Slot = Table.getValSlot(MT->getReturnType()); assert(Slot != -1 && "Type used but not available!!"); output_vbr((unsigned)Slot, Out); @@ -46,7 +46,7 @@ } case Type::ArrayTyID: { - const ArrayType *AT = cast(T); + const ArrayType *AT = cast(T); int Slot = Table.getValSlot(AT->getElementType()); assert(Slot != -1 && "Type used but not available!!"); output_vbr((unsigned)Slot, Out); @@ -57,7 +57,7 @@ } case Type::StructTyID: { - const StructType *ST = cast(T); + const StructType *ST = cast(T); // Output all of the element types... StructType::ElementTypes::const_iterator I = ST->getElementTypes().begin(); @@ -73,7 +73,7 @@ } case Type::PointerTyID: { - const PointerType *PT = cast(T); + const PointerType *PT = cast(T); int Slot = Table.getValSlot(PT->getElementType()); assert(Slot != -1 && "Type used but not available!!"); output_vbr((unsigned)Slot, Out); @@ -120,7 +120,7 @@ switch (CPV->getType()->getPrimitiveID()) { case Type::BoolTyID: // Boolean Types - if (cast(CPV)->getValue()) + if (cast(CPV)->getValue()) output_vbr(1U, Out); else output_vbr(0U, Out); @@ -130,14 +130,14 @@ case Type::UShortTyID: case Type::UIntTyID: case Type::ULongTyID: - output_vbr(cast(CPV)->getValue(), Out); + output_vbr(cast(CPV)->getValue(), Out); break; case Type::SByteTyID: // Signed integer types... case Type::ShortTyID: case Type::IntTyID: case Type::LongTyID: - output_vbr(cast(CPV)->getValue(), Out); + output_vbr(cast(CPV)->getValue(), Out); break; case Type::TypeTyID: // Serialize type type @@ -145,7 +145,7 @@ break; case Type::ArrayTyID: { - const ConstantArray *CPA = cast(CPV); + const ConstantArray *CPA = cast(CPV); unsigned size = CPA->getValues().size(); assert(size == cast(CPA->getType())->getNumElements() && "ConstantArray out of whack!"); @@ -158,7 +158,7 @@ } case Type::StructTyID: { - const ConstantStruct *CPS = cast(CPV); + const ConstantStruct *CPS = cast(CPV); const std::vector &Vals = CPS->getValues(); for (unsigned i = 0; i < Vals.size(); ++i) { @@ -170,7 +170,7 @@ } case Type::PointerTyID: { - const ConstantPointer *CPP = cast(CPV); + const ConstantPointer *CPP = cast(CPV); assert(!isa(CPP) && "Null should be already emitted!"); const ConstantPointerRef *CPR = cast(CPP); int Slot = Table.getValSlot((Value*)CPR->getValue()); From lattner at cs.uiuc.edu Wed Jul 23 09:57:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 09:57:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp Message-ID: <200307231456.JAA00778@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/InstrSelection: InstrSelectionSupport.cpp updated: 1.52 -> 1.53 --- Log message: Remove using decl --- Diffs of the changes: Index: llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp diff -u llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp:1.52 llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp:1.53 --- llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp:1.52 Sun Jul 6 15:33:21 2003 +++ llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp Wed Jul 23 09:55:59 2003 @@ -16,10 +16,7 @@ #include "llvm/Constants.h" #include "llvm/BasicBlock.h" #include "llvm/DerivedTypes.h" -#include "../../Target/Sparc/SparcInstrSelectionSupport.h" -using std::vector; - -//*************************** Local Functions ******************************/ +#include "../../Target/Sparc/SparcInstrSelectionSupport.h" // FIXME! // Generate code to load the constant into a TmpInstruction (virtual reg) and @@ -29,7 +26,7 @@ InsertCodeToLoadConstant(Function *F, Value* opValue, Instruction* vmInstr, - vector& loadConstVec, + std::vector& loadConstVec, TargetMachine& target) { // Create a tmp virtual register to hold the constant. @@ -143,12 +140,12 @@ // fall under case 3; these must be inserted before `minstr'. //--------------------------------------------------------------------------- -vector +std::vector FixConstantOperandsForInstr(Instruction* vmInstr, MachineInstr* minstr, TargetMachine& target) { - vector MVec; + std::vector MVec; MachineOpCode opCode = minstr->getOpCode(); const TargetInstrInfo& instrInfo = target.getInstrInfo(); From lattner at cs.uiuc.edu Wed Jul 23 10:00:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:00:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/ModuloScheduling/ModuloScheduling.cpp Message-ID: <200307231459.JAA01035@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/ModuloScheduling: ModuloScheduling.cpp updated: 1.9 -> 1.10 --- Log message: Random cleanups --- Diffs of the changes: Index: llvm/lib/CodeGen/ModuloScheduling/ModuloScheduling.cpp diff -u llvm/lib/CodeGen/ModuloScheduling/ModuloScheduling.cpp:1.9 llvm/lib/CodeGen/ModuloScheduling/ModuloScheduling.cpp:1.10 --- llvm/lib/CodeGen/ModuloScheduling/ModuloScheduling.cpp:1.9 Tue Jun 10 15:04:30 2003 +++ llvm/lib/CodeGen/ModuloScheduling/ModuloScheduling.cpp Wed Jul 23 09:59:40 2003 @@ -4,12 +4,8 @@ // //===----------------------------------------------------------------------===// -//#include "llvm/CodeGen/MachineCodeForBasicBlock.h" -//#include "llvm/CodeGen/MachineCodeForMethod.h" -//#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h" // FIXME: Remove when modularized better #include "llvm/BasicBlock.h" #include "llvm/Constants.h" -#include "llvm/Instruction.h" #include "llvm/iTerminators.h" #include "llvm/iPHINode.h" #include "llvm/CodeGen/MachineInstr.h" @@ -24,10 +20,6 @@ #include "ModuloScheduling.h" #include #include -#include - -using std::endl; -using std::cerr; //************************************************************ // printing Debug information @@ -455,9 +447,9 @@ kernel_ist.erase(--kernel_ist.end()); // set the first successor to itself - ((BranchInst *) cln)->setSuccessor(0, kernel); + cln->setSuccessor(0, kernel); // set the second successor to eiplogue - ((BranchInst *) cln)->setSuccessor(1, epilogue); + cln->setSuccessor(1, epilogue); //*****change the condition******* @@ -907,38 +899,38 @@ void ModuloScheduling::dumpFinalSchedule(){ - cerr << "dump schedule:" << endl; + std::cerr << "dump schedule:" << "\n"; const TargetSchedInfo & msi = target.getSchedInfo(); unsigned numIssueSlots = msi.maxNumIssueTotal; for (unsigned i = 0; i < numIssueSlots; i++) - cerr << "\t#"; - cerr << endl; + std::cerr << "\t#"; + std::cerr << "\n"; for (unsigned i = 0; i < schedule.size(); i++) { - cerr << "cycle" << i << ": "; + std::cerr << "cycle" << i << ": "; for (unsigned j = 0; j < schedule[i].size(); j++) if (schedule[i][j] != NULL) - cerr << schedule[i][j]->getNodeId() << "\t"; + std::cerr << schedule[i][j]->getNodeId() << "\t"; else - cerr << "\t"; - cerr << endl; + std::cerr << "\t"; + std::cerr << "\n"; } - cerr << "dump coreSchedule:" << endl; + std::cerr << "dump coreSchedule:" << "\n"; for (unsigned i = 0; i < numIssueSlots; i++) - cerr << "\t#"; - cerr << endl; + std::cerr << "\t#"; + std::cerr << "\n"; for (unsigned i = 0; i < coreSchedule.size(); i++) { - cerr << "cycle" << i << ": "; + std::cerr << "cycle" << i << ": "; for (unsigned j = 0; j < coreSchedule[i].size(); j++) if (coreSchedule[i][j] != NULL) - cerr << coreSchedule[i][j]->getNodeId() << "\t"; + std::cerr << coreSchedule[i][j]->getNodeId() << "\t"; else - cerr << "\t"; - cerr << endl; + std::cerr << "\t"; + std::cerr << "\n"; } } @@ -979,13 +971,13 @@ ModuloSchedulingSet ModuloSchedulingSet(*graphSet); - DEBUG_PRINT(cerr<<"runOnFunction in ModuloSchedulingPass returns\n"< Changes in directory llvm/lib/Analysis: Expressions.cpp updated: 1.34 -> 1.35 --- Log message: Eliminate old-style cast --- Diffs of the changes: Index: llvm/lib/Analysis/Expressions.cpp diff -u llvm/lib/Analysis/Expressions.cpp:1.34 llvm/lib/Analysis/Expressions.cpp:1.35 --- llvm/lib/Analysis/Expressions.cpp:1.34 Mon Jul 14 12:26:34 2003 +++ llvm/lib/Analysis/Expressions.cpp Wed Jul 23 10:16:40 2003 @@ -276,7 +276,7 @@ if (Right.Offset == 0) return Left; // shl x, 0 = x assert(Right.Offset->getType() == Type::UByteTy && "Shift amount must always be a unsigned byte!"); - uint64_t ShiftAmount = ((ConstantUInt*)Right.Offset)->getValue(); + uint64_t ShiftAmount = cast(Right.Offset)->getValue(); ConstantInt *Multiplier = getUnsignedConstant(1ULL << ShiftAmount, Ty); // We don't know how to classify it if they are shifting by more than what From lattner at cs.uiuc.edu Wed Jul 23 10:18:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:18:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/InductionVariable.cpp Message-ID: <200307231517.KAA03299@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: InductionVariable.cpp updated: 1.22 -> 1.23 --- Log message: Fit code into 80 columns --- Diffs of the changes: Index: llvm/lib/Analysis/InductionVariable.cpp diff -u llvm/lib/Analysis/InductionVariable.cpp:1.22 llvm/lib/Analysis/InductionVariable.cpp:1.23 --- llvm/lib/Analysis/InductionVariable.cpp:1.22 Wed Apr 23 11:36:06 2003 +++ llvm/lib/Analysis/InductionVariable.cpp Wed Jul 23 10:17:01 2003 @@ -254,14 +254,16 @@ End = ConstantSInt::get(ubSigned->getType(), ubSigned->getValue()+1); DEBUG(std::cerr << "signed int constant\n"); } else if (ConstantUInt *ubUnsigned = dyn_cast(End)) { - End = ConstantUInt::get(ubUnsigned->getType(), ubUnsigned->getValue()+1); + End = ConstantUInt::get(ubUnsigned->getType(), + ubUnsigned->getValue()+1); DEBUG(std::cerr << "unsigned int constant\n"); } else { DEBUG(std::cerr << "symbolic bound\n"); //End = NULL; // new expression N+1 End = BinaryOperator::create(Instruction::Add, End, - ConstantUInt::get(ubUnsigned->getType(), 1)); + ConstantUInt::get(ubUnsigned->getType(), + 1)); } break; } From lattner at cs.uiuc.edu Wed Jul 23 10:19:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:19:02 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp Message-ID: <200307231518.KAA04627@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/InstrSelection: InstrSelectionSupport.cpp updated: 1.53 -> 1.54 --- Log message: Remove unnecessary casts --- Diffs of the changes: Index: llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp diff -u llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp:1.53 llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp:1.54 --- llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp:1.53 Wed Jul 23 09:55:59 2003 +++ llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp Wed Jul 23 10:17:51 2003 @@ -103,12 +103,12 @@ if (isa(CPV->getType())) intValue = 0; // We checked above that it is NULL else if (ConstantBool* CB = dyn_cast(CPV)) - intValue = (int64_t) CB->getValue(); + intValue = CB->getValue(); else if (CPV->getType()->isSigned()) intValue = cast(CPV)->getValue(); else { // get the int value and sign-extend if original was less than 64 bits - intValue = (int64_t) cast(CPV)->getValue(); + intValue = cast(CPV)->getValue(); switch(CPV->getType()->getPrimitiveID()) { case Type::UByteTyID: intValue = (int64_t) (int8_t) intValue; break; From lattner at cs.uiuc.edu Wed Jul 23 10:22:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:22:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile.programs Message-ID: <200307231521.KAA05378@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile.programs updated: 1.73 -> 1.74 --- Log message: Make it fit in 80 cols --- Diffs of the changes: Index: llvm/test/Programs/Makefile.programs diff -u llvm/test/Programs/Makefile.programs:1.73 llvm/test/Programs/Makefile.programs:1.74 --- llvm/test/Programs/Makefile.programs:1.73 Mon Jul 21 16:56:58 2003 +++ llvm/test/Programs/Makefile.programs Wed Jul 23 10:20:54 2003 @@ -318,7 +318,7 @@ Output/%.run.s: Output/%.run.bc $(LLC) -$(LLC) -f $< -o $@ -STATIC_TRACE_LIBS = ${DESTLIBDEBUG}/firstTrigger.o ${DESTLIBDEBUG}/tracecache.o \ +STATIC_TRACE_LIBS = ${DESTLIBDEBUG}/firstTrigger.o ${DESTLIBDEBUG}/tracecache.o\ ${DESTLIBCURRENT}/mapinfo.o ${DESTLIBDEBUG}/scratchmemory.o DYNAMIC_TRACE_LIBS = ${DESTLIBCURRENT}/libscalaropts.a \ From lattner at cs.uiuc.edu Wed Jul 23 10:23:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:23:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp Message-ID: <200307231522.KAA06029@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CWriter: Writer.cpp updated: 1.107 -> 1.108 --- Log message: Simplify code by using ConstantInt::getRawValue instead of checking to see whether the constant is signed or unsigned, then casting --- Diffs of the changes: Index: llvm/lib/CWriter/Writer.cpp diff -u llvm/lib/CWriter/Writer.cpp:1.107 llvm/lib/CWriter/Writer.cpp:1.108 --- llvm/lib/CWriter/Writer.cpp:1.107 Mon Jul 21 11:34:35 2003 +++ llvm/lib/CWriter/Writer.cpp Wed Jul 23 10:22:15 2003 @@ -324,9 +324,7 @@ // Do not include the last character, which we know is null for (unsigned i = 0, e = CPA->getNumOperands()-1; i != e; ++i) { - unsigned char C = (ETy == Type::SByteTy) ? - (unsigned char)cast(CPA->getOperand(i))->getValue() : - (unsigned char)cast(CPA->getOperand(i))->getValue(); + unsigned char C = cast(CPA->getOperand(i))->getRawValue(); // Print it out literally if it is a printable character. The only thing // to be careful about is when the last letter output was a hex escape From lattner at cs.uiuc.edu Wed Jul 23 10:23:09 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:23:09 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Constants.cpp Message-ID: <200307231522.KAA05884@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.91 -> 1.92 Constants.cpp updated: 1.46 -> 1.47 --- Log message: Simplify code by using ConstantInt::getRawValue instead of checking to see whether the constant is signed or unsigned, then casting --- Diffs of the changes: Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.91 llvm/lib/VMCore/AsmWriter.cpp:1.92 --- llvm/lib/VMCore/AsmWriter.cpp:1.91 Mon Jul 14 12:18:22 2003 +++ llvm/lib/VMCore/AsmWriter.cpp Wed Jul 23 10:22:26 2003 @@ -274,9 +274,7 @@ if (isString) { Out << "c\""; for (unsigned i = 0; i < CA->getNumOperands(); ++i) { - unsigned char C = (ETy == Type::SByteTy) ? - (unsigned char)cast(CA->getOperand(i))->getValue() : - (unsigned char)cast(CA->getOperand(i))->getValue(); + unsigned char C = cast(CA->getOperand(i))->getRawValue(); if (isprint(C) && C != '"' && C != '\\') { Out << C; Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.46 llvm/lib/VMCore/Constants.cpp:1.47 --- llvm/lib/VMCore/Constants.cpp:1.46 Sun Jun 22 15:48:30 2003 +++ llvm/lib/VMCore/Constants.cpp Wed Jul 23 10:22:26 2003 @@ -601,15 +601,12 @@ // Otherwise, it asserts out. // std::string ConstantArray::getAsString() const { + assert((getType()->getElementType() == Type::UByteTy || + getType()->getElementType() == Type::SByteTy) && "Not a string!"); + std::string Result; - if (getType()->getElementType() == Type::SByteTy) - for (unsigned i = 0, e = getNumOperands(); i != e; ++i) - Result += (char)cast(getOperand(i))->getValue(); - else { - assert(getType()->getElementType() == Type::UByteTy && "Not a string!"); - for (unsigned i = 0, e = getNumOperands(); i != e; ++i) - Result += (char)cast(getOperand(i))->getValue(); - } + for (unsigned i = 0, e = getNumOperands(); i != e; ++i) + Result += (char)cast(getOperand(i))->getRawValue(); return Result; } From lattner at cs.uiuc.edu Wed Jul 23 10:23:17 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:23:17 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp ScalarReplAggregates.cpp Message-ID: <200307231522.KAA05875@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.97 -> 1.98 ScalarReplAggregates.cpp updated: 1.6 -> 1.7 --- Log message: Simplify code by using ConstantInt::getRawValue instead of checking to see whether the constant is signed or unsigned, then casting --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.97 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.98 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.97 Tue Jul 22 16:46:59 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jul 23 10:22:24 2003 @@ -370,8 +370,7 @@ if (Constant *Op1 = dyn_cast(I.getOperand(1))) { if (ConstantInt *CI = dyn_cast(Op1)) { const Type *Ty = CI->getType(); - int64_t Val = Ty->isSigned() ? cast(CI)->getValue() : - (int64_t)cast(CI)->getValue(); + int64_t Val = (int64_t)cast(CI)->getRawValue(); switch (Val) { case -1: // X * -1 -> -X return BinaryOperator::createNeg(Op0, I.getName()); Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.6 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.7 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.6 Fri May 30 14:22:14 2003 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Wed Jul 23 10:22:25 2003 @@ -103,11 +103,7 @@ Instruction *User = cast(*I); if (GetElementPtrInst *GEPI = dyn_cast(User)) { // We now know that the GEP is of the form: GEP , 0, - uint64_t Idx; - if (ConstantSInt *CSI = dyn_cast(GEPI->getOperand(2))) - Idx = CSI->getValue(); - else - Idx = cast(GEPI->getOperand(2))->getValue(); + uint64_t Idx = cast(GEPI->getOperand(2))->getRawValue(); assert(Idx < ElementAllocas.size() && "Index out of range?"); AllocaInst *AllocaToUse = ElementAllocas[Idx]; From lattner at cs.uiuc.edu Wed Jul 23 10:23:25 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:23:25 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/TransformInternals.h Message-ID: <200307231522.KAA05864@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms: TransformInternals.h updated: 1.18 -> 1.19 --- Log message: Simplify code by using ConstantInt::getRawValue instead of checking to see whether the constant is signed or unsigned, then casting --- Diffs of the changes: Index: llvm/lib/Transforms/TransformInternals.h diff -u llvm/lib/Transforms/TransformInternals.h:1.18 llvm/lib/Transforms/TransformInternals.h:1.19 --- llvm/lib/Transforms/TransformInternals.h:1.18 Tue May 20 13:45:33 2003 +++ llvm/lib/Transforms/TransformInternals.h Wed Jul 23 10:22:23 2003 @@ -16,9 +16,7 @@ #include static inline int64_t getConstantValue(const ConstantInt *CPI) { - if (const ConstantSInt *CSI = dyn_cast(CPI)) - return CSI->getValue(); - return (int64_t)cast(CPI)->getValue(); + return (int64_t)cast(CPI)->getRawValue(); } From lattner at cs.uiuc.edu Wed Jul 23 10:23:33 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:23:33 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp Printer.cpp Message-ID: <200307231522.KAA05859@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: InstSelectSimple.cpp updated: 1.114 -> 1.115 Printer.cpp updated: 1.44 -> 1.45 --- Log message: Simplify code by using ConstantInt::getRawValue instead of checking to see whether the constant is signed or unsigned, then casting --- Diffs of the changes: Index: llvm/lib/Target/X86/InstSelectSimple.cpp diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.114 llvm/lib/Target/X86/InstSelectSimple.cpp:1.115 --- llvm/lib/Target/X86/InstSelectSimple.cpp:1.114 Fri Jul 18 15:23:43 2003 +++ llvm/lib/Target/X86/InstSelectSimple.cpp Wed Jul 23 10:22:21 2003 @@ -343,12 +343,7 @@ if (Class == cLong) { // Copy the value into the register pair. - uint64_t Val; - if (C->getType()->isSigned()) - Val = cast(C)->getValue(); - else - Val = cast(C)->getValue(); - + uint64_t Val = cast(C)->getRawValue(); BMI(MBB, IP, X86::MOVir32, 1, R).addZImm(Val & 0xFFFFFFFF); BMI(MBB, IP, X86::MOVir32, 1, R+1).addZImm(Val >> 32); return; @@ -362,12 +357,9 @@ if (C->getType() == Type::BoolTy) { BMI(MBB, IP, X86::MOVir8, 1, R).addZImm(C == ConstantBool::True); - } else if (C->getType()->isSigned()) { - ConstantSInt *CSI = cast(C); - BMI(MBB, IP, IntegralOpcodeTab[Class], 1, R).addZImm(CSI->getValue()); } else { - ConstantUInt *CUI = cast(C); - BMI(MBB, IP, IntegralOpcodeTab[Class], 1, R).addZImm(CUI->getValue()); + ConstantInt *CI = cast(C); + BMI(MBB, IP, IntegralOpcodeTab[Class], 1, R).addZImm(CI->getRawValue()); } } else if (ConstantFP *CFP = dyn_cast(C)) { double Value = CFP->getValue(); @@ -585,11 +577,8 @@ // Special case handling of: cmp R, i if (Class == cByte || Class == cShort || Class == cInt) if (ConstantInt *CI = dyn_cast(Op1)) { - uint64_t Op1v; - if (ConstantSInt *CSI = dyn_cast(CI)) - Op1v = CSI->getValue(); - else - Op1v = cast(CI)->getValue(); + uint64_t Op1v = cast(CI)->getRawValue(); + // Mask off any upper bits of the constant, if there are any... Op1v &= (1ULL << (8 << Class)) - 1; @@ -1061,11 +1050,7 @@ assert(Class < 3 && "General code handles 64-bit integer types!"); unsigned Opcode = OpcodeTab[OperatorClass][Class]; unsigned Op0r = getReg(Op0, BB, IP); - uint64_t Op1v; - if (ConstantSInt *CSI = dyn_cast(Op1C)) - Op1v = CSI->getValue(); - else - Op1v = cast(Op1C)->getValue(); + uint64_t Op1v = cast(Op1C)->getRawValue(); // Mask off any upper bits of the constant, if there are any... Op1v &= (1ULL << (8 << Class)) - 1; @@ -2082,8 +2067,6 @@ unsigned Op1Reg = getReg(I.getOperand(0)); MachineBasicBlock::iterator MBBI = BB->end(); doMultiply(BB, MBBI, Arg, Type::UIntTy, Op0Reg, Op1Reg); - - } std::vector Args; Index: llvm/lib/Target/X86/Printer.cpp diff -u llvm/lib/Target/X86/Printer.cpp:1.44 llvm/lib/Target/X86/Printer.cpp:1.45 --- llvm/lib/Target/X86/Printer.cpp:1.44 Fri Jul 11 16:57:01 2003 +++ llvm/lib/Target/X86/Printer.cpp Wed Jul 23 10:22:22 2003 @@ -293,9 +293,7 @@ const Type *ETy = cast(CVA->getType())->getElementType(); Result = "\""; for (unsigned i = 0; i < CVA->getNumOperands(); ++i) { - unsigned char C = (ETy == Type::SByteTy) ? - (unsigned char)cast(CVA->getOperand(i))->getValue() : - (unsigned char)cast(CVA->getOperand(i))->getValue(); + unsigned char C = cast(CVA->getOperand(i))->getRawValue(); if (C == '"') { Result += "\\\""; @@ -943,19 +941,14 @@ return false; // success } -static const Function *isConstantFunctionPointerRef (const Constant *C) { - const ConstantPointerRef *R = dyn_cast(C); - if (R) { - const Function *F = dyn_cast(R->getValue()); - if (F) { +static const Function *isConstantFunctionPointerRef(const Constant *C) { + if (const ConstantPointerRef *R = dyn_cast(C)) + if (const Function *F = dyn_cast(R->getValue())) return F; - } - } - return NULL; + return 0; } -bool Printer::doFinalization(Module &M) -{ +bool Printer::doFinalization(Module &M) { // Print out module-level global variables here. for (Module::const_giterator I = M.gbegin(), E = M.gend(); I != E; ++I) { std::string name(getValueName(I)); @@ -989,5 +982,3 @@ MangledGlobals.clear(); return false; // success } - - From lattner at cs.uiuc.edu Wed Jul 23 10:23:40 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:23:40 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/EmitAssembly.cpp SparcInstrInfo.cpp Message-ID: <200307231522.KAA05849@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: EmitAssembly.cpp updated: 1.82 -> 1.83 SparcInstrInfo.cpp updated: 1.49 -> 1.50 --- Log message: Simplify code by using ConstantInt::getRawValue instead of checking to see whether the constant is signed or unsigned, then casting --- Diffs of the changes: Index: llvm/lib/Target/Sparc/EmitAssembly.cpp diff -u llvm/lib/Target/Sparc/EmitAssembly.cpp:1.82 llvm/lib/Target/Sparc/EmitAssembly.cpp:1.83 --- llvm/lib/Target/Sparc/EmitAssembly.cpp:1.82 Mon Jul 14 12:17:50 2003 +++ llvm/lib/Target/Sparc/EmitAssembly.cpp Wed Jul 23 10:22:19 2003 @@ -585,9 +585,7 @@ const Type *ETy = cast(CVA->getType())->getElementType(); Result = "\""; for (unsigned i = 0; i < CVA->getNumOperands(); ++i) { - unsigned char C = (ETy == Type::SByteTy) ? - (unsigned char)cast(CVA->getOperand(i))->getValue() : - (unsigned char)cast(CVA->getOperand(i))->getValue(); + unsigned char C = cast(CVA->getOperand(i))->getRawValue(); if (C == '"') { Result += "\\\""; Index: llvm/lib/Target/Sparc/SparcInstrInfo.cpp diff -u llvm/lib/Target/Sparc/SparcInstrInfo.cpp:1.49 llvm/lib/Target/Sparc/SparcInstrInfo.cpp:1.50 --- llvm/lib/Target/Sparc/SparcInstrInfo.cpp:1.49 Thu Jul 10 14:48:19 2003 +++ llvm/lib/Target/Sparc/SparcInstrInfo.cpp Wed Jul 23 10:22:19 2003 @@ -43,10 +43,8 @@ if (isa(V)) if (const ConstantBool *CB = dyn_cast(V)) return (int64_t)CB->getValue(); - else if (const ConstantSInt *CS = dyn_cast(V)) - return (uint64_t)CS->getValue(); - else if (const ConstantUInt *CU = dyn_cast(V)) - return CU->getValue(); + else if (const ConstantInt *CI = dyn_cast(V)) + return CI->getRawValue(); isValidConstant = false; return 0; @@ -377,15 +375,11 @@ if (isa(CV)) // can always use %g0 return false; - if (const ConstantUInt* U = dyn_cast(CV)) - /* Large unsigned longs may really just be small negative signed longs */ - return (labs((int64_t) U->getValue()) > MaxConstantsTable[I->getOpcode()]); - - if (const ConstantSInt* S = dyn_cast(CV)) - return (labs(S->getValue()) > MaxConstantsTable[I->getOpcode()]); + if (const ConstantInt* CI = dyn_cast(CV)) + return labs((int64_t)CI->getRawValue()) > MaxConstantsTable[I->getOpcode()]; if (isa(CV)) - return (1 > MaxConstantsTable[I->getOpcode()]); + return 1 > MaxConstantsTable[I->getOpcode()]; return true; } From lattner at cs.uiuc.edu Wed Jul 23 10:23:48 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:23:48 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/ConstantRange.cpp Message-ID: <200307231522.KAA05840@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Support: ConstantRange.cpp updated: 1.4 -> 1.5 --- Log message: Simplify code by using ConstantInt::getRawValue instead of checking to see whether the constant is signed or unsigned, then casting --- Diffs of the changes: Index: llvm/lib/Support/ConstantRange.cpp diff -u llvm/lib/Support/ConstantRange.cpp:1.4 llvm/lib/Support/ConstantRange.cpp:1.5 --- llvm/lib/Support/ConstantRange.cpp:1.4 Tue Sep 3 18:12:40 2002 +++ llvm/lib/Support/ConstantRange.cpp Wed Jul 23 10:22:17 2003 @@ -126,10 +126,7 @@ // Simply subtract the bounds... Constant *Result = *(Constant*)Upper - *(Constant*)Lower; assert(Result && "Subtraction of constant integers not implemented?"); - if (getType()->isSigned()) - return (uint64_t)cast(Result)->getValue(); - else - return cast(Result)->getValue(); + return cast(Result)->getRawValue(); } From lattner at cs.uiuc.edu Wed Jul 23 10:31:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:31:02 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/Interpreter/Execution.cpp Message-ID: <200307231530.KAA12194@apoc.cs.uiuc.edu> Changes in directory llvm/tools/lli/Interpreter: Execution.cpp updated: 1.90 -> 1.91 --- Log message: Remove redundant const qualifier --- Diffs of the changes: Index: llvm/tools/lli/Interpreter/Execution.cpp diff -u llvm/tools/lli/Interpreter/Execution.cpp:1.90 llvm/tools/lli/Interpreter/Execution.cpp:1.91 --- llvm/tools/lli/Interpreter/Execution.cpp:1.90 Wed May 14 09:21:30 2003 +++ llvm/tools/lli/Interpreter/Execution.cpp Wed Jul 23 10:30:32 2003 @@ -1266,11 +1266,11 @@ Value *PickedVal = ChooseOneOption(Name, LookupMatchingNames(Name)); if (!PickedVal) return; - if (const Function *F = dyn_cast(PickedVal)) { + if (const Function *F = dyn_cast(PickedVal)) { CW << F; // Print the function - } else if (const Type *Ty = dyn_cast(PickedVal)) { + } else if (const Type *Ty = dyn_cast(PickedVal)) { CW << "type %" << Name << " = " << Ty->getDescription() << "\n"; - } else if (const BasicBlock *BB = dyn_cast(PickedVal)) { + } else if (const BasicBlock *BB = dyn_cast(PickedVal)) { CW << BB; // Print the basic block } else { // Otherwise there should be an annotation for the slot# print(PickedVal->getType(), From lattner at cs.uiuc.edu Wed Jul 23 10:31:11 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:31:11 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp SlotCalculator.cpp SymbolTable.cpp Type.cpp Message-ID: <200307231530.KAA12180@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.92 -> 1.93 SlotCalculator.cpp updated: 1.26 -> 1.27 SymbolTable.cpp updated: 1.29 -> 1.30 Type.cpp updated: 1.48 -> 1.49 --- Log message: Remove redundant const qualifiers from cast<> expressions --- Diffs of the changes: Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.92 llvm/lib/VMCore/AsmWriter.cpp:1.93 --- llvm/lib/VMCore/AsmWriter.cpp:1.92 Wed Jul 23 10:22:26 2003 +++ llvm/lib/VMCore/AsmWriter.cpp Wed Jul 23 10:30:06 2003 @@ -36,29 +36,29 @@ SlotCalculator *Table); static const Module *getModuleFromVal(const Value *V) { - if (const Argument *MA = dyn_cast(V)) + if (const Argument *MA = dyn_cast(V)) return MA->getParent() ? MA->getParent()->getParent() : 0; - else if (const BasicBlock *BB = dyn_cast(V)) + else if (const BasicBlock *BB = dyn_cast(V)) return BB->getParent() ? BB->getParent()->getParent() : 0; - else if (const Instruction *I = dyn_cast(V)) { + else if (const Instruction *I = dyn_cast(V)) { const Function *M = I->getParent() ? I->getParent()->getParent() : 0; return M ? M->getParent() : 0; - } else if (const GlobalValue *GV = dyn_cast(V)) + } else if (const GlobalValue *GV = dyn_cast(V)) return GV->getParent(); return 0; } static SlotCalculator *createSlotCalculator(const Value *V) { assert(!isa(V) && "Can't create an SC for a type!"); - if (const Argument *FA = dyn_cast(V)) { + if (const Argument *FA = dyn_cast(V)) { return new SlotCalculator(FA->getParent(), true); - } else if (const Instruction *I = dyn_cast(V)) { + } else if (const Instruction *I = dyn_cast(V)) { return new SlotCalculator(I->getParent()->getParent(), true); - } else if (const BasicBlock *BB = dyn_cast(V)) { + } else if (const BasicBlock *BB = dyn_cast(V)) { return new SlotCalculator(BB->getParent(), true); - } else if (const GlobalVariable *GV = dyn_cast(V)){ + } else if (const GlobalVariable *GV = dyn_cast(V)){ return new SlotCalculator(GV->getParent(), true); - } else if (const Function *Func = dyn_cast(V)) { + } else if (const Function *Func = dyn_cast(V)) { return new SlotCalculator(Func, true); } return 0; @@ -79,7 +79,7 @@ // As a heuristic, don't insert pointer to primitive types, because // they are used too often to have a single useful name. // - const Type *Ty = cast(I->second); + const Type *Ty = cast(I->second); if (!isa(Ty) || !cast(Ty)->getElementType()->isPrimitiveType()) TypeNames.insert(std::make_pair(Ty, "%"+I->first)); @@ -114,7 +114,7 @@ std::string Result; switch (Ty->getPrimitiveID()) { case Type::FunctionTyID: { - const FunctionType *FTy = cast(Ty); + const FunctionType *FTy = cast(Ty); Result = calcTypeName(FTy->getReturnType(), TypeStack, TypeNames) + " ("; for (FunctionType::ParamTypes::const_iterator I = FTy->getParamTypes().begin(), @@ -131,7 +131,7 @@ break; } case Type::StructTyID: { - const StructType *STy = cast(Ty); + const StructType *STy = cast(Ty); Result = "{ "; for (StructType::ElementTypes::const_iterator I = STy->getElementTypes().begin(), @@ -144,11 +144,11 @@ break; } case Type::PointerTyID: - Result = calcTypeName(cast(Ty)->getElementType(), + Result = calcTypeName(cast(Ty)->getElementType(), TypeStack, TypeNames) + "*"; break; case Type::ArrayTyID: { - const ArrayType *ATy = cast(Ty); + const ArrayType *ATy = cast(Ty); Result = "[" + utostr(ATy->getNumElements()) + " x "; Result += calcTypeName(ATy->getElementType(), TypeStack, TypeNames) + "]"; break; @@ -377,14 +377,14 @@ if (PrintName && V->hasName()) { Out << "%" << V->getName(); } else { - if (const Constant *CV = dyn_cast(V)) { + if (const Constant *CV = dyn_cast(V)) { WriteConstantInt(Out, CV, PrintName, TypeTable, Table); } else { int Slot; if (Table) { Slot = Table->getValSlot(V); } else { - if (const Type *Ty = dyn_cast(V)) { + if (const Type *Ty = dyn_cast(V)) { Out << Ty->getDescription(); return; } @@ -580,9 +580,9 @@ for (; I != End; ++I) { const Value *V = I->second; - if (const Constant *CPV = dyn_cast(V)) { + if (const Constant *CPV = dyn_cast(V)) { printConstant(CPV); - } else if (const Type *Ty = dyn_cast(V)) { + } else if (const Type *Ty = dyn_cast(V)) { Out << "\t%" << I->first << " = type "; // Make sure we print out at least one level of the type structure, so @@ -959,7 +959,7 @@ switch (V->getValueType()) { case Value::ConstantVal: case Value::ArgumentVal: AW->writeOperand(V, true, true); break; - case Value::TypeVal: AW->write(cast(V)); break; + case Value::TypeVal: AW->write(cast(V)); break; case Value::InstructionVal: AW->write(cast(V)); break; case Value::BasicBlockVal: AW->write(cast(V)); break; case Value::FunctionVal: AW->write(cast(V)); break; Index: llvm/lib/VMCore/SlotCalculator.cpp diff -u llvm/lib/VMCore/SlotCalculator.cpp:1.26 llvm/lib/VMCore/SlotCalculator.cpp:1.27 --- llvm/lib/VMCore/SlotCalculator.cpp:1.26 Wed Mar 19 14:57:22 2003 +++ llvm/lib/VMCore/SlotCalculator.cpp Wed Jul 23 10:30:06 2003 @@ -262,7 +262,7 @@ } // If it's a type, make sure that all subtypes of the type are included... - if (const Type *TheTy = dyn_cast(D)) { + if (const Type *TheTy = dyn_cast(D)) { // Insert the current type before any subtypes. This is important because // recursive types elements are inserted in a bottom up order. Changing Index: llvm/lib/VMCore/SymbolTable.cpp diff -u llvm/lib/VMCore/SymbolTable.cpp:1.29 llvm/lib/VMCore/SymbolTable.cpp:1.30 --- llvm/lib/VMCore/SymbolTable.cpp:1.29 Thu May 22 16:47:17 2003 +++ llvm/lib/VMCore/SymbolTable.cpp Wed Jul 23 10:30:06 2003 @@ -19,7 +19,7 @@ if (TyPlane != end()) { VarMap &TyP = TyPlane->second; for (VarMap::iterator I = TyP.begin(), E = TyP.end(); I != E; ++I) { - const Type *Ty = cast(I->second); + const Type *Ty = cast(I->second); if (Ty->isAbstract()) // If abstract, drop the reference... cast(Ty)->removeAbstractTypeUser(this); } @@ -122,7 +122,7 @@ // If we are removing an abstract type, remove the symbol table from it's use // list... if (Ty == Type::TypeTy) { - const Type *T = cast(Result); + const Type *T = cast(Result); if (T->isAbstract()) { #if DEBUG_ABSTYPE std::cerr << "Removing abs type from symtab" << T->getDescription()<<"\n"; @@ -179,7 +179,7 @@ // If we are adding an abstract type, add the symbol table to it's use list. if (VTy == Type::TypeTy) { - const Type *T = cast(V); + const Type *T = cast(V); if (T->isAbstract()) { cast(T)->addAbstractTypeUser(this); #if DEBUG_ABSTYPE @@ -311,7 +311,7 @@ #if DEBUG_ABSTYPE std::cerr << "Added type " << NewType->getDescription() << "\n"; #endif - cast(NewType)->addAbstractTypeUser(this); + cast(NewType)->addAbstractTypeUser(this); } } } Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.48 llvm/lib/VMCore/Type.cpp:1.49 --- llvm/lib/VMCore/Type.cpp:1.48 Wed Jun 18 14:22:28 2003 +++ llvm/lib/VMCore/Type.cpp Wed Jul 23 10:30:06 2003 @@ -293,7 +293,7 @@ switch (Ty->getPrimitiveID()) { case Type::FunctionTyID: { - const FunctionType *MTy = cast(Ty); + const FunctionType *MTy = cast(Ty); Result = getTypeProps(MTy->getReturnType(), TypeStack, isAbstract, isRecursive)+" ("; for (FunctionType::ParamTypes::const_iterator @@ -311,7 +311,7 @@ break; } case Type::StructTyID: { - const StructType *STy = cast(Ty); + const StructType *STy = cast(Ty); Result = "{ "; for (StructType::ElementTypes::const_iterator I = STy->getElementTypes().begin(), @@ -324,13 +324,13 @@ break; } case Type::PointerTyID: { - const PointerType *PTy = cast(Ty); + const PointerType *PTy = cast(Ty); Result = getTypeProps(PTy->getElementType(), TypeStack, isAbstract, isRecursive) + " *"; break; } case Type::ArrayTyID: { - const ArrayType *ATy = cast(Ty); + const ArrayType *ATy = cast(Ty); unsigned NumElements = ATy->getNumElements(); Result = "["; Result += utostr(NumElements) + " x "; @@ -400,10 +400,10 @@ // algorithm is the fact that arraytypes have sizes that differentiates types, // and that method types can be varargs or not. Consider this now. if (const ArrayType *ATy = dyn_cast(Ty)) { - if (ATy->getNumElements() != cast(Ty2)->getNumElements()) + if (ATy->getNumElements() != cast(Ty2)->getNumElements()) return false; } else if (const FunctionType *MTy = dyn_cast(Ty)) { - if (MTy->isVarArg() != cast(Ty2)->isVarArg()) + if (MTy->isVarArg() != cast(Ty2)->isVarArg()) return false; } From lattner at cs.uiuc.edu Wed Jul 23 10:31:19 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:31:19 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/EmitAssembly.cpp Message-ID: <200307231530.KAA12167@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: EmitAssembly.cpp updated: 1.83 -> 1.84 --- Log message: Remove redundant const qualifiers from cast<> expressions --- Diffs of the changes: Index: llvm/lib/Target/Sparc/EmitAssembly.cpp diff -u llvm/lib/Target/Sparc/EmitAssembly.cpp:1.83 llvm/lib/Target/Sparc/EmitAssembly.cpp:1.84 --- llvm/lib/Target/Sparc/EmitAssembly.cpp:1.83 Wed Jul 23 10:22:19 2003 +++ llvm/lib/Target/Sparc/EmitAssembly.cpp Wed Jul 23 10:30:04 2003 @@ -413,7 +413,7 @@ const Value *Val = mop.getVRegValue(); assert(Val && "\tNULL Value in SparcFunctionAsmPrinter"); - if (const BasicBlock *BB = dyn_cast(Val)) + if (const BasicBlock *BB = dyn_cast(Val)) toAsm << getID(BB); else if (const Function *M = dyn_cast(Val)) toAsm << getID(M); From lattner at cs.uiuc.edu Wed Jul 23 10:31:27 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:31:27 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetData.cpp Message-ID: <200307231530.KAA12160@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetData.cpp updated: 1.35 -> 1.36 --- Log message: Remove redundant const qualifiers from cast<> expressions --- Diffs of the changes: Index: llvm/lib/Target/TargetData.cpp diff -u llvm/lib/Target/TargetData.cpp:1.35 llvm/lib/Target/TargetData.cpp:1.36 --- llvm/lib/Target/TargetData.cpp:1.35 Tue Jun 3 21:35:35 2003 +++ llvm/lib/Target/TargetData.cpp Wed Jul 23 10:30:02 2003 @@ -69,10 +69,10 @@ void *D) { const TargetData &TD = *(const TargetData*)D; assert(AID == TD.AID && "Target data annotation ID mismatch!"); - const Type *Ty = cast((const Value *)T); + const Type *Ty = cast((const Value *)T); assert(isa(Ty) && "Can only create StructLayout annotation on structs!"); - return new StructLayout((const StructType *)Ty, TD); + return new StructLayout(cast(Ty), TD); } //===----------------------------------------------------------------------===// From lattner at cs.uiuc.edu Wed Jul 23 10:31:35 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:31:35 2003 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReadConst.cpp Message-ID: <200307231530.KAA12153@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ReadConst.cpp updated: 1.48 -> 1.49 --- Log message: Remove redundant const qualifiers from cast<> expressions --- Diffs of the changes: Index: llvm/lib/Bytecode/Reader/ReadConst.cpp diff -u llvm/lib/Bytecode/Reader/ReadConst.cpp:1.48 llvm/lib/Bytecode/Reader/ReadConst.cpp:1.49 --- llvm/lib/Bytecode/Reader/ReadConst.cpp:1.48 Mon Jul 14 12:14:03 2003 +++ llvm/lib/Bytecode/Reader/ReadConst.cpp Wed Jul 23 10:30:01 2003 @@ -277,7 +277,7 @@ abort(); case Type::ArrayTyID: { - const ArrayType *AT = cast(Ty); + const ArrayType *AT = cast(Ty); unsigned NumElements = AT->getNumElements(); std::vector Elements; @@ -310,7 +310,7 @@ } case Type::PointerTyID: { - const PointerType *PT = cast(Ty); + const PointerType *PT = cast(Ty); unsigned SubClass; if (HasImplicitZeroInitializer) SubClass = 1; From lattner at cs.uiuc.edu Wed Jul 23 10:31:43 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:31:43 2003 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y Message-ID: <200307231530.KAA12145@apoc.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.116 -> 1.117 --- Log message: Remove redundant const qualifiers from cast<> expressions --- Diffs of the changes: Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.116 llvm/lib/AsmParser/llvmAsmParser.y:1.117 --- llvm/lib/AsmParser/llvmAsmParser.y:1.116 Mon Jul 14 12:14:42 2003 +++ llvm/lib/AsmParser/llvmAsmParser.y Wed Jul 23 10:30:00 2003 @@ -242,7 +242,7 @@ } D.destroy(); // Free old strdup'd memory... - return cast(N); + return cast(N); } default: ThrowException("Internal parser error: Invalid symbol type reference!"); @@ -506,7 +506,7 @@ if (Existing) { // Inserting a name that is already defined??? // There is only one case where this is allowed: when we are refining an // opaque type. In this case, Existing will be an opaque type. - if (const Type *Ty = dyn_cast(Existing)) { + if (const Type *Ty = dyn_cast(Existing)) { if (const OpaqueType *OpTy = dyn_cast(Ty)) { // We ARE replacing an opaque type! ((OpaqueType*)OpTy)->refineAbstractTypeTo(cast(V)); @@ -519,7 +519,7 @@ if (const Type *Ty = dyn_cast(Existing)) { if (Ty == cast(V)) return true; // Yes, it's equal. // std::cerr << "Type: " << Ty->getDescription() << " != " - // << cast(V)->getDescription() << "!\n"; + // << cast(V)->getDescription() << "!\n"; } else if (const Constant *C = dyn_cast(Existing)) { if (C == V) return true; // Constants are equal to themselves } else if (GlobalVariable *EGV = dyn_cast(Existing)) { @@ -875,7 +875,7 @@ // ResolvedVal, ValueRef and ConstValueRef productions. // ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr - const ArrayType *ATy = dyn_cast($1->get()); + const ArrayType *ATy = dyn_cast($1->get()); if (ATy == 0) ThrowException("Cannot make array constant with type: '" + (*$1)->getDescription() + "'!"); @@ -900,7 +900,7 @@ delete $1; delete $3; } | Types '[' ']' { - const ArrayType *ATy = dyn_cast($1->get()); + const ArrayType *ATy = dyn_cast($1->get()); if (ATy == 0) ThrowException("Cannot make array constant with type: '" + (*$1)->getDescription() + "'!"); @@ -913,7 +913,7 @@ delete $1; } | Types 'c' STRINGCONSTANT { - const ArrayType *ATy = dyn_cast($1->get()); + const ArrayType *ATy = dyn_cast($1->get()); if (ATy == 0) ThrowException("Cannot make array constant with type: '" + (*$1)->getDescription() + "'!"); @@ -941,7 +941,7 @@ delete $1; } | Types '{' ConstVector '}' { - const StructType *STy = dyn_cast($1->get()); + const StructType *STy = dyn_cast($1->get()); if (STy == 0) ThrowException("Cannot make struct constant with type: '" + (*$1)->getDescription() + "'!"); @@ -961,7 +961,7 @@ delete $1; delete $3; } | Types '{' '}' { - const StructType *STy = dyn_cast($1->get()); + const StructType *STy = dyn_cast($1->get()); if (STy == 0) ThrowException("Cannot make struct constant with type: '" + (*$1)->getDescription() + "'!"); @@ -973,7 +973,7 @@ delete $1; } | Types NULL_TOK { - const PointerType *PTy = dyn_cast($1->get()); + const PointerType *PTy = dyn_cast($1->get()); if (PTy == 0) ThrowException("Cannot make null pointer constant with type: '" + (*$1)->getDescription() + "'!"); @@ -982,7 +982,7 @@ delete $1; } | Types SymbolicValueRef { - const PointerType *Ty = dyn_cast($1->get()); + const PointerType *Ty = dyn_cast($1->get()); if (Ty == 0) ThrowException("Global const reference must be a pointer type!"); From lattner at cs.uiuc.edu Wed Jul 23 10:31:51 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:31:51 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/InstForest.h Message-ID: <200307231530.KAA12138@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: InstForest.h updated: 1.18 -> 1.19 --- Log message: Remove redundant const qualifiers from cast<> expressions --- Diffs of the changes: Index: llvm/include/llvm/Analysis/InstForest.h diff -u llvm/include/llvm/Analysis/InstForest.h:1.18 llvm/include/llvm/Analysis/InstForest.h:1.19 --- llvm/include/llvm/Analysis/InstForest.h:1.18 Sat Jun 21 22:05:45 2003 +++ llvm/include/llvm/Analysis/InstForest.h Wed Jul 23 10:29:59 2003 @@ -76,13 +76,13 @@ return cast(getValue()); } inline const Constant *getConstant() const { - return cast(getValue()); + return cast(getValue()); } inline BasicBlock *getBasicBlock() { return cast(getValue()); } inline const BasicBlock *getBasicBlock() const { - return cast(getValue()); + return cast(getValue()); } inline Instruction *getInstruction() { assert(isInstruction() && "getInstruction() on non instruction node!"); From lattner at cs.uiuc.edu Wed Jul 23 10:31:59 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 10:31:59 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/DerivedTypes.h Message-ID: <200307231530.KAA12131@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: DerivedTypes.h updated: 1.31 -> 1.32 --- Log message: Remove redundant const qualifiers from cast<> expressions --- Diffs of the changes: Index: llvm/include/llvm/DerivedTypes.h diff -u llvm/include/llvm/DerivedTypes.h:1.31 llvm/include/llvm/DerivedTypes.h:1.32 --- llvm/include/llvm/DerivedTypes.h:1.31 Sat Jun 21 22:07:32 2003 +++ llvm/include/llvm/DerivedTypes.h Wed Jul 23 10:29:53 2003 @@ -139,7 +139,7 @@ return T->getPrimitiveID() == FunctionTyID; } static inline bool classof(const Value *V) { - return isa(V) && classof(cast(V)); + return isa(V) && classof(cast(V)); } }; @@ -172,7 +172,7 @@ T->getPrimitiveID() == PointerTyID; } static inline bool classof(const Value *V) { - return isa(V) && classof(cast(V)); + return isa(V) && classof(cast(V)); } }; @@ -228,7 +228,7 @@ return T->getPrimitiveID() == StructTyID; } static inline bool classof(const Value *V) { - return isa(V) && classof(cast(V)); + return isa(V) && classof(cast(V)); } }; @@ -279,7 +279,7 @@ T->getPrimitiveID() == PointerTyID; } static inline bool classof(const Value *V) { - return isa(V) && classof(cast(V)); + return isa(V) && classof(cast(V)); } }; @@ -314,7 +314,7 @@ return T->getPrimitiveID() == ArrayTyID; } static inline bool classof(const Value *V) { - return isa(V) && classof(cast(V)); + return isa(V) && classof(cast(V)); } }; @@ -347,7 +347,7 @@ return T->getPrimitiveID() == PointerTyID; } static inline bool classof(const Value *V) { - return isa(V) && classof(cast(V)); + return isa(V) && classof(cast(V)); } }; From criswell at choi.cs.uiuc.edu Wed Jul 23 11:53:01 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Wed Jul 23 11:53:01 2003 Subject: [llvm-commits] CVS: llvm/autoconf/aclocal.m4 Message-ID: <200307231653.h6NGr0u06733@choi.cs.uiuc.edu> Changes in directory llvm/autoconf: aclocal.m4 updated: 1.1 -> 1.2 --- Log message: Renamed libtool to mklib for your tab completion pleasure. --- Diffs of the changes: Index: llvm/autoconf/aclocal.m4 diff -u llvm/autoconf/aclocal.m4:1.1 llvm/autoconf/aclocal.m4:1.2 --- llvm/autoconf/aclocal.m4:1.1 Tue Jul 22 14:13:20 2003 +++ llvm/autoconf/aclocal.m4 Wed Jul 23 11:52:50 2003 @@ -82,7 +82,7 @@ LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' +LIBTOOL='$(SHELL) $(top_builddir)/mklib' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion @@ -149,7 +149,7 @@ rm="rm -f" # Global variables: -default_ofile=libtool +default_ofile=mklib can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, From criswell at choi.cs.uiuc.edu Wed Jul 23 11:53:10 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Wed Jul 23 11:53:10 2003 Subject: [llvm-commits] CVS: llvm/Makefile.common configure Message-ID: <200307231652.h6NGqwB06725@choi.cs.uiuc.edu> Changes in directory llvm: Makefile.common updated: 1.101 -> 1.102 configure updated: 1.9 -> 1.10 --- Log message: Renamed libtool to mklib for your tab completion pleasure. --- Diffs of the changes: Index: llvm/Makefile.common diff -u llvm/Makefile.common:1.101 llvm/Makefile.common:1.102 --- llvm/Makefile.common:1.101 Wed Jul 16 15:26:06 2003 +++ llvm/Makefile.common Wed Jul 23 11:52:46 2003 @@ -266,9 +266,9 @@ # Libtool is found in the current directory. # ifdef VERBOSE -LIBTOOL=$(LLVM_SRC_ROOT)/libtool +LIBTOOL=$(LLVM_SRC_ROOT)/mklib else -LIBTOOL=$(LLVM_SRC_ROOT)/libtool --silent +LIBTOOL=$(LLVM_SRC_ROOT)/mklib --silent endif # Index: llvm/configure diff -u llvm/configure:1.9 llvm/configure:1.10 --- llvm/configure:1.9 Tue Jul 22 16:00:24 2003 +++ llvm/configure Wed Jul 23 11:52:46 2003 @@ -5140,7 +5140,7 @@ rm="rm -f" # Global variables: -default_ofile=libtool +default_ofile=mklib can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, @@ -17880,7 +17880,7 @@ LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' +LIBTOOL='$(SHELL) $(top_builddir)/mklib' # Prevent multiple expansion From lattner at cs.uiuc.edu Wed Jul 23 12:02:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 12:02:02 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/set.ll Message-ID: <200307231701.MAA27468@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: set.ll updated: 1.10 -> 1.11 --- Log message: New tests --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/set.ll diff -u llvm/test/Regression/Transforms/InstCombine/set.ll:1.10 llvm/test/Regression/Transforms/InstCombine/set.ll:1.11 --- llvm/test/Regression/Transforms/InstCombine/set.ll:1.10 Sat Jun 28 18:31:56 2003 +++ llvm/test/Regression/Transforms/InstCombine/set.ll Wed Jul 23 12:01:18 2003 @@ -86,3 +86,16 @@ %D = or bool %C1, %C2 ret bool %D } + +bool %test16(uint %A) { + %B = and uint %A, 5 + %C = seteq uint %B, 8 ; Is never true + ret bool %C +} + +bool %test17(ubyte %A) { + %B = or ubyte %A, 1 + %C = seteq ubyte %B, 2 ; Always false + ret bool %C +} + From lattner at cs.uiuc.edu Wed Jul 23 12:03:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 12:03:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200307231702.MAA28789@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.98 -> 1.99 --- Log message: IC: (X & 5) == 13 --> false IC: (X | 8) == 4 --> false --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.98 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.99 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.98 Wed Jul 23 10:22:24 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jul 23 12:02:11 2003 @@ -697,15 +697,35 @@ // integers at the end of their ranges... // if (ConstantInt *CI = dyn_cast(Op1)) { - if (CI->isNullValue()) { - if (I.getOpcode() == Instruction::SetNE) - return new CastInst(Op0, Type::BoolTy, I.getName()); - else if (I.getOpcode() == Instruction::SetEQ) { + // Simplify seteq and setne instructions... + if (I.getOpcode() == Instruction::SetEQ || + I.getOpcode() == Instruction::SetNE) { + bool isSetNE = I.getOpcode() == Instruction::SetNE; + + if (CI->isNullValue()) { // Simplify [seteq|setne] X, 0 + CastInst *Val = new CastInst(Op0, Type::BoolTy, I.getName()+".not"); + if (isSetNE) return Val; + // seteq X, 0 -> not (cast X to bool) - Instruction *Val = new CastInst(Op0, Type::BoolTy, I.getName()+".not"); InsertNewInstBefore(Val, I); return BinaryOperator::createNot(Val, I.getName()); } + + // If the first operand is (and|or) with a constant, and the second + // operand is a constant, simplify a bit. + if (BinaryOperator *BO = dyn_cast(Op0)) + if (ConstantInt *BOC = dyn_cast(BO->getOperand(1))) + if (BO->getOpcode() == Instruction::Or) { + // If bits are being or'd in that are not present in the constant we + // are comparing against, then the comparison could never succeed! + if (!(*BOC & *~*CI)->isNullValue()) + return ReplaceInstUsesWith(I, ConstantBool::get(isSetNE)); + } else if (BO->getOpcode() == Instruction::And) { + // If bits are being compared against that are and'd out, then the + // comparison can never succeed! + if (!(*CI & *~*BOC)->isNullValue()) + return ReplaceInstUsesWith(I, ConstantBool::get(isSetNE)); + } } // Check to see if we are comparing against the minimum or maximum value... From lattner at cs.uiuc.edu Wed Jul 23 12:22:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 12:22:03 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/ConstantHandling.h Message-ID: <200307231721.MAA10434@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: ConstantHandling.h updated: 1.27 -> 1.28 --- Log message: Add support for ~ operator on constants --- Diffs of the changes: Index: llvm/include/llvm/ConstantHandling.h diff -u llvm/include/llvm/ConstantHandling.h:1.27 llvm/include/llvm/ConstantHandling.h:1.28 --- llvm/include/llvm/ConstantHandling.h:1.27 Sat Jun 21 22:07:32 2003 +++ llvm/include/llvm/ConstantHandling.h Wed Jul 23 12:21:17 2003 @@ -125,6 +125,12 @@ ConstRules &operator=(const ConstRules &); // Do not implement }; +// Unary operators... +inline Constant *operator~(const Constant &V) { + assert(V.getType()->isIntegral() && "Cannot invert non-intergral constant!"); + return ConstRules::get(V, V)->op_xor(&V, + ConstantInt::getAllOnesValue(V.getType())); +} // Standard binary operators... inline Constant *operator+(const Constant &V1, const Constant &V2) { From lattner at cs.uiuc.edu Wed Jul 23 12:27:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 12:27:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200307231726.MAA16609@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.99 -> 1.100 --- Log message: InstCombine: (X ^ 4) == 8 --> X == 12 --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.99 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.100 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.99 Wed Jul 23 12:02:11 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jul 23 12:26:36 2003 @@ -711,7 +711,7 @@ return BinaryOperator::createNot(Val, I.getName()); } - // If the first operand is (and|or) with a constant, and the second + // If the first operand is (and|or|xor) with a constant, and the second // operand is a constant, simplify a bit. if (BinaryOperator *BO = dyn_cast(Op0)) if (ConstantInt *BOC = dyn_cast(BO->getOperand(1))) @@ -725,6 +725,11 @@ // comparison can never succeed! if (!(*CI & *~*BOC)->isNullValue()) return ReplaceInstUsesWith(I, ConstantBool::get(isSetNE)); + } else if (BO->getOpcode() == Instruction::Xor) { + // For the xor case, we can always just xor the two constants + // together, potentially eliminating the explicit xor. + return BinaryOperator::create(I.getOpcode(), BO->getOperand(0), + *CI ^ *BOC); } } From lattner at cs.uiuc.edu Wed Jul 23 12:27:10 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 12:27:10 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/or.ll Message-ID: <200307231726.MAA15599@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: or.ll updated: 1.15 -> 1.16 --- Log message: New testcase --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/or.ll diff -u llvm/test/Regression/Transforms/InstCombine/or.ll:1.15 llvm/test/Regression/Transforms/InstCombine/or.ll:1.16 --- llvm/test/Regression/Transforms/InstCombine/or.ll:1.15 Sat Jun 28 18:31:56 2003 +++ llvm/test/Regression/Transforms/InstCombine/or.ll Wed Jul 23 12:25:55 2003 @@ -112,3 +112,8 @@ ret ubyte 3 } +bool %test19(ubyte %A) { + %B = xor ubyte %A, 123 ; xor can be eliminated + %C = seteq ubyte %B, 34 + ret bool %C +} From lattner at cs.uiuc.edu Wed Jul 23 12:57:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 12:57:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/and.ll or.ll Message-ID: <200307231756.MAA19281@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: and.ll updated: 1.10 -> 1.11 or.ll updated: 1.16 -> 1.17 --- Log message: New testcase --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/and.ll diff -u llvm/test/Regression/Transforms/InstCombine/and.ll:1.10 llvm/test/Regression/Transforms/InstCombine/and.ll:1.11 --- llvm/test/Regression/Transforms/InstCombine/and.ll:1.10 Tue Jul 22 16:44:06 2003 +++ llvm/test/Regression/Transforms/InstCombine/and.ll Wed Jul 23 12:56:34 2003 @@ -58,3 +58,10 @@ %C = cast uint %B to bool ret bool %C } + +uint %test10(uint %A) { + %B = and uint %A, 12 + %C = xor uint %B, 15 + %D = and uint %C, 1 + ret uint %D +} Index: llvm/test/Regression/Transforms/InstCombine/or.ll diff -u llvm/test/Regression/Transforms/InstCombine/or.ll:1.16 llvm/test/Regression/Transforms/InstCombine/or.ll:1.17 --- llvm/test/Regression/Transforms/InstCombine/or.ll:1.16 Wed Jul 23 12:25:55 2003 +++ llvm/test/Regression/Transforms/InstCombine/or.ll Wed Jul 23 12:56:34 2003 @@ -117,3 +117,15 @@ %C = seteq ubyte %B, 34 ret bool %C } + + +bool %test20(int %A) { + %B = xor int %A, -1 + %C = and int %B, 4 + %D = setne int %C, 0 + %E = and int %B, 123 ; Make the usecount of B = 2 + %F = cast int %E to bool + %G = and bool %D, %F + ret bool %G +} + From lattner at cs.uiuc.edu Wed Jul 23 12:58:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 12:58:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200307231757.MAA19292@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.100 -> 1.101 --- Log message: IC: (X ^ C1) & C2 --> (X & C2) ^ (C1&C2) Minor code cleanup --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.100 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.101 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.100 Wed Jul 23 12:26:36 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jul 23 12:57:01 2003 @@ -493,19 +493,31 @@ return ReplaceInstUsesWith(I, Op1); // and X, -1 == X - if (ConstantIntegral *RHS = dyn_cast(Op1)) + if (ConstantIntegral *RHS = dyn_cast(Op1)) { if (RHS->isAllOnesValue()) return ReplaceInstUsesWith(I, Op0); + // (X ^ C1) & C2 --> (X & C2) ^ (C1&C2) + if (Instruction *Op0I = dyn_cast(Op0)) + if (Op0I->getOpcode() == Instruction::Xor && isOnlyUse(Op0)) + if (ConstantInt *Op0CI = dyn_cast(Op0I->getOperand(1))) { + std::string Op0Name = Op0I->getName(); Op0I->setName(""); + Instruction *And = BinaryOperator::create(Instruction::And, + Op0I->getOperand(0), RHS, + Op0Name); + InsertNewInstBefore(And, I); + return BinaryOperator::create(Instruction::Xor, And, *RHS & *Op0CI); + } + } + Value *Op0NotVal = dyn_castNotVal(Op0); Value *Op1NotVal = dyn_castNotVal(Op1); // (~A & ~B) == (~(A | B)) - Demorgan's Law if (Op0NotVal && Op1NotVal && isOnlyUse(Op0) && isOnlyUse(Op1)) { Instruction *Or = BinaryOperator::create(Instruction::Or, Op0NotVal, - Op1NotVal,I.getName()+".demorgan", - &I); - WorkList.push_back(Or); + Op1NotVal,I.getName()+".demorgan"); + InsertNewInstBefore(Or, I); return BinaryOperator::createNot(Or); } From lattner at cs.uiuc.edu Wed Jul 23 13:29:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 13:29:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/and.ll or.ll Message-ID: <200307231828.NAA20843@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: and.ll updated: 1.11 -> 1.12 or.ll updated: 1.17 -> 1.18 --- Log message: New testcases --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/and.ll diff -u llvm/test/Regression/Transforms/InstCombine/and.ll:1.11 llvm/test/Regression/Transforms/InstCombine/and.ll:1.12 --- llvm/test/Regression/Transforms/InstCombine/and.ll:1.11 Wed Jul 23 12:56:34 2003 +++ llvm/test/Regression/Transforms/InstCombine/and.ll Wed Jul 23 13:28:42 2003 @@ -62,6 +62,6 @@ uint %test10(uint %A) { %B = and uint %A, 12 %C = xor uint %B, 15 - %D = and uint %C, 1 + %D = and uint %C, 1 ; (X ^ C1) & C2 --> (X & C2) ^ (C1&C2) ret uint %D } Index: llvm/test/Regression/Transforms/InstCombine/or.ll diff -u llvm/test/Regression/Transforms/InstCombine/or.ll:1.17 llvm/test/Regression/Transforms/InstCombine/or.ll:1.18 --- llvm/test/Regression/Transforms/InstCombine/or.ll:1.17 Wed Jul 23 12:56:34 2003 +++ llvm/test/Regression/Transforms/InstCombine/or.ll Wed Jul 23 13:28:42 2003 @@ -129,3 +129,17 @@ ret bool %G } +ubyte %test21(ubyte %A) { + %B = or ubyte %A, 1 + %C = and ubyte %B, 254 + %D = or ubyte %C, 254 ; (X & C1) | C2 --> (X | C2) & (C1|C2) + ret ubyte %D +} + +ubyte %test22(ubyte %A) { + %B = or ubyte %A, 254 + %C = xor ubyte %B, 13 + %D = or ubyte %C, 1 ; (X ^ C1) | C2 --> (X | C2) ^ (C1&~C2) + %E = xor ubyte %D, 12 + ret ubyte %E +} From lattner at cs.uiuc.edu Wed Jul 23 13:30:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 13:30:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200307231829.NAA20852@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.101 -> 1.102 --- Log message: IC: (X & C1) | C2 --> (X | C2) & (C1|C2) IC: (X ^ C1) | C2 --> (X | C2) ^ (C1&~C2) We are now guaranteed that all 'or's will be inside of 'and's, and all 'and's will be inside of 'xor's, if the second operands are constants. --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.101 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.102 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.101 Wed Jul 23 12:57:01 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jul 23 13:29:44 2003 @@ -538,9 +538,34 @@ return ReplaceInstUsesWith(I, Op0); // or X, -1 == -1 - if (ConstantIntegral *RHS = dyn_cast(Op1)) + if (ConstantIntegral *RHS = dyn_cast(Op1)) { if (RHS->isAllOnesValue()) return ReplaceInstUsesWith(I, Op1); + + if (Instruction *Op0I = dyn_cast(Op0)) { + // (X & C1) | C2 --> (X | C2) & (C1|C2) + if (Op0I->getOpcode() == Instruction::And && isOnlyUse(Op0)) + if (ConstantInt *Op0CI = dyn_cast(Op0I->getOperand(1))) { + std::string Op0Name = Op0I->getName(); Op0I->setName(""); + Instruction *Or = BinaryOperator::create(Instruction::Or, + Op0I->getOperand(0), RHS, + Op0Name); + InsertNewInstBefore(Or, I); + return BinaryOperator::create(Instruction::And, Or, *RHS | *Op0CI); + } + + // (X ^ C1) | C2 --> (X | C2) ^ (C1&~C2) + if (Op0I->getOpcode() == Instruction::Xor && isOnlyUse(Op0)) + if (ConstantInt *Op0CI = dyn_cast(Op0I->getOperand(1))) { + std::string Op0Name = Op0I->getName(); Op0I->setName(""); + Instruction *Or = BinaryOperator::create(Instruction::Or, + Op0I->getOperand(0), RHS, + Op0Name); + InsertNewInstBefore(Or, I); + return BinaryOperator::create(Instruction::Xor, Or, *Op0CI & *~*RHS); + } + } + } Value *Op0NotVal = dyn_castNotVal(Op0); Value *Op1NotVal = dyn_castNotVal(Op1); From gaeke at cs.uiuc.edu Wed Jul 23 13:38:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Wed Jul 23 13:38:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/Printer.cpp Message-ID: <200307231837.NAA06589@neo.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: Printer.cpp updated: 1.45 -> 1.46 --- Log message: Add, rewrite, and/or reformat many comments. Stop passing ostreams around: we already have one perfectly good ostream and we can all share it. Stop stashing a pointer to TargetData in the Pass object, because that will lead to a crash if there are no functions in the module (ouch!) Instead, use addRequired() and getAnalysis(), like we always should have done. Move the check for ConstantExpr up before the check for isPrimitiveType, because we need to be able to catch e.g. ubyte (cast bool false to ubyte), whose type is primitive but which is nevertheless a ConstantExpr, by calling our specialized handler instead of the AsmWriter. This would result in assembler errors when we would try to output something like ".byte (cast bool false to ubyte)". GC some unused variable declarations. --- Diffs of the changes: Index: llvm/lib/Target/X86/Printer.cpp diff -u llvm/lib/Target/X86/Printer.cpp:1.45 llvm/lib/Target/X86/Printer.cpp:1.46 --- llvm/lib/Target/X86/Printer.cpp:1.45 Wed Jul 23 10:22:22 2003 +++ llvm/lib/Target/X86/Printer.cpp Wed Jul 23 13:37:06 2003 @@ -1,7 +1,9 @@ -//===-- X86/Printer.cpp - Convert X86 code to human readable rep. ---------===// +//===-- X86/Printer.cpp - Convert X86 LLVM code to Intel assembly ---------===// // -// This file contains a printer that converts from our internal representation -// of LLVM code to a nice human readable form that is suitable for debugging. +// This file contains a printer that converts from our internal +// representation of machine-dependent LLVM code to Intel-format +// assembly language. This printer is the output mechanism used +// by `llc' and `lli -printmachineinstrs' on X86. // //===----------------------------------------------------------------------===// @@ -24,23 +26,44 @@ #include "llvm/Module.h" namespace { + /// This is properly part of the name mangler; it keeps track of + /// which global values have had their names mangled. It is cleared + /// at the end of every module by doFinalization(). + /// std::set MangledGlobals; + struct Printer : public MachineFunctionPass { + /// Output stream on which we're printing assembly code. This is + /// assigned by the constructor and never changes. + /// std::ostream &O; + Printer(std::ostream &o) : O(o) { } + + /// We name each basic block in a Function with a unique number, so + /// that we can consistently refer to them later. This is cleared + /// at the beginning of each call to runOnMachineFunction(). + /// typedef std::map ValueMapTy; ValueMapTy NumberForBB; - Printer(std::ostream &o) : O(o) {} - const TargetData *TD; + + /// Cache of mangled name for current function. This is + /// recalculated at the beginning of each call to + /// runOnMachineFunction(). + /// std::string CurrentFnName; + virtual const char *getPassName() const { return "X86 Assembly Printer"; } + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(); + } - void printMachineInstruction(const MachineInstr *MI, std::ostream &O, + void printMachineInstruction(const MachineInstr *MI, const TargetMachine &TM) const; - void printOp(std::ostream &O, const MachineOperand &MO, + void printOp(const MachineOperand &MO, const MRegisterInfo &RI, bool elideOffsetKeyword = false) const; - void printMemReference(std::ostream &O, const MachineInstr *MI, + void printMemReference(const MachineInstr *MI, unsigned Op, const MRegisterInfo &RI) const; void printConstantPool(MachineConstantPool *MCP); @@ -55,16 +78,18 @@ }; } // end of anonymous namespace -/// createX86CodePrinterPass - Print out the specified machine code function to -/// the specified stream. This function should work regardless of whether or -/// not the function is in SSA form or not. +/// createX86CodePrinterPass - Returns a pass that prints the X86 +/// assembly code for a MachineFunction to the specified stream. This +/// should work regardless of whether the function is in SSA form. /// Pass *createX86CodePrinterPass(std::ostream &O) { return new Printer(O); } -// We don't want identifier names with ., space, or - in them, -// so we replace them with underscores. +/// makeNameProper - We don't want identifier names with ., space, or +/// - in them, so we mangle these characters into the strings "d_", +/// "s_", and "D_", respectively. +/// static std::string makeNameProper(std::string x) { std::string tmp; for (std::string::iterator sI = x.begin(), sEnd = x.end(); sI != sEnd; sI++) @@ -100,9 +125,9 @@ return "ltmp_" + itostr(Count) + "_" + utostr(V->getType()->getUniqueID()); } -// valToExprString - Helper function for ConstantExprToString(). -// Appends result to argument string S. -// +/// valToExprString - Helper function for ConstantExprToString(). +/// Appends result to argument string S. +/// std::string Printer::valToExprString(const Value* V) { std::string S; bool failed = false; @@ -136,25 +161,27 @@ return S; } -// ConstantExprToString() - Convert a ConstantExpr to an asm expression -// and return this as a string. +/// ConstantExprToString - Convert a ConstantExpr to an asm expression +/// and return this as a string. +/// std::string Printer::ConstantExprToString(const ConstantExpr* CE) { std::string S; + TargetData &TD = getAnalysis(); switch(CE->getOpcode()) { case Instruction::GetElementPtr: { // generate a symbolic expression for the byte address const Value* ptrVal = CE->getOperand(0); std::vector idxVec(CE->op_begin()+1, CE->op_end()); S += "(" + valToExprString(ptrVal) + ") + (" - + utostr(TD->getIndexedOffset(ptrVal->getType(),idxVec)) + ")"; + + utostr(TD.getIndexedOffset(ptrVal->getType(),idxVec)) + ")"; break; } case Instruction::Cast: // Support only non-converting casts for now, i.e., a no-op. // This assertion is not a complete check. - assert(TD->getTypeSize(CE->getType()) == - TD->getTypeSize(CE->getOperand(0)->getType())); + assert(TD.getTypeSize(CE->getType()) == + TD.getTypeSize(CE->getOperand(0)->getType())); S += "(" + valToExprString(CE->getOperand(0)) + ")"; break; @@ -171,7 +198,8 @@ return S; } -// Print a single constant value. +/// printSingleConstantValue - Print a single constant value. +/// void Printer::printSingleConstantValue(const Constant* CV) { @@ -218,7 +246,13 @@ } O << "\t"; - if (type->isPrimitiveType()) + if (const ConstantExpr* CE = dyn_cast(CV)) + { + // Constant expression built from operators, constants, and + // symbolic addrs + O << ConstantExprToString(CE) << "\n"; + } + else if (type->isPrimitiveType()) { if (type->isFloatingPoint()) { // FP Constants are printed as integer constants to avoid losing @@ -251,21 +285,15 @@ // Null pointer value O << "0\n"; } - else if (const ConstantExpr* CE = dyn_cast(CV)) - { - // Constant expression built from operators, constants, and - // symbolic addrs - O << ConstantExprToString(CE) << "\n"; - } else { assert(0 && "Unknown elementary type for constant"); } } -// Can we treat the specified array as a string? Only if it is an array of -// ubytes or non-negative sbytes. -// +/// isStringCompatible - Can we treat the specified array as a string? +/// Only if it is an array of ubytes or non-negative sbytes. +/// static bool isStringCompatible(const ConstantArray *CVA) { const Type *ETy = cast(CVA->getType())->getElementType(); if (ETy == Type::UByteTy) return true; @@ -278,14 +306,15 @@ return true; } -// toOctal - Convert the low order bits of X into an octal letter +/// toOctal - Convert the low order bits of X into an octal digit. +/// static inline char toOctal(int X) { return (X&7)+'0'; } -// getAsCString - Return the specified array as a C compatible string, only if -// the predicate isStringCompatible is true. -// +/// getAsCString - Return the specified array as a C compatible +/// string, only if the predicate isStringCompatible is true. +/// static std::string getAsCString(const ConstantArray *CVA) { assert(isStringCompatible(CVA) && "Array is not string compatible!"); @@ -330,6 +359,7 @@ int numPadBytesAfter /* = 0 */) { const ConstantArray *CVA = dyn_cast(CV); + TargetData &TD = getAnalysis(); if (CVA && isStringCompatible(CVA)) { // print the string alone and return @@ -344,7 +374,7 @@ else if (const ConstantStruct *CVS = dyn_cast(CV)) { // Print the fields in successive locations. Pad to align if needed! const StructLayout *cvsLayout = - TD->getStructLayout(CVS->getType()); + TD.getStructLayout(CVS->getType()); const std::vector& constValues = CVS->getValues(); unsigned sizeSoFar = 0; for (unsigned i=0, N = constValues.size(); i < N; i++) @@ -352,7 +382,7 @@ const Constant* field = cast(constValues[i].get()); // Check if padding is needed and insert one or more 0s. - unsigned fieldSize = TD->getTypeSize(field->getType()); + unsigned fieldSize = TD.getTypeSize(field->getType()); int padSize = ((i == N-1? cvsLayout->StructSize : cvsLayout->MemberOffsets[i+1]) - cvsLayout->MemberOffsets[i]) - fieldSize; @@ -381,15 +411,20 @@ } } -// printConstantPool - Print out any constants which have been spilled to -// memory... +/// printConstantPool - Print to the current output stream assembly +/// representations of the constants in the constant pool MCP. This is +/// used to print out constants which have been "spilled to memory" by +/// the code generator. +/// void Printer::printConstantPool(MachineConstantPool *MCP){ const std::vector &CP = MCP->getConstants(); + TargetData &TD = getAnalysis(); + if (CP.empty()) return; for (unsigned i = 0, e = CP.size(); i != e; ++i) { O << "\t.section .rodata\n"; - O << "\t.align " << (unsigned)TD->getTypeAlignment(CP[i]->getType()) + O << "\t.align " << (unsigned)TD.getTypeAlignment(CP[i]->getType()) << "\n"; O << ".CPI" << CurrentFnName << "_" << i << ":\t\t\t\t\t#" << *CP[i] << "\n"; @@ -397,13 +432,14 @@ } } -/// runOnMachineFunction - This uses the X86InstructionInfo::print method -/// to print assembly for each instruction. +/// runOnMachineFunction - This uses the printMachineInstruction() +/// method to print assembly for each instruction. +/// bool Printer::runOnMachineFunction(MachineFunction &MF) { + // BBNumber is used here so that a given Printer will never give two + // BBs the same name. (If you have a better way, please let me know!) static unsigned BBNumber = 0; const TargetMachine &TM = MF.getTarget(); - const TargetInstrInfo &TII = TM.getInstrInfo(); - TD = &TM.getTargetData(); // What's my mangled name? CurrentFnName = getValueName(MF.getFunction()); @@ -436,7 +472,7 @@ II != E; ++II) { // Print the assembly for the instruction. O << "\t"; - printMachineInstruction(*II, O, TM); + printMachineInstruction(*II, TM); } } @@ -458,7 +494,7 @@ MI->getOperand(Op+2).isRegister() &&MI->getOperand(Op+3).isImmediate(); } -void Printer::printOp(std::ostream &O, const MachineOperand &MO, +void Printer::printOp(const MachineOperand &MO, const MRegisterInfo &RI, bool elideOffsetKeyword /* = false */) const { switch (MO.getType()) { @@ -511,7 +547,7 @@ } } -void Printer::printMemReference(std::ostream &O, const MachineInstr *MI, +void Printer::printMemReference(const MachineInstr *MI, unsigned Op, const MRegisterInfo &RI) const { assert(isMem(MI, Op) && "Invalid memory reference!"); @@ -539,7 +575,7 @@ O << "["; bool NeedPlus = false; if (BaseReg.getReg()) { - printOp(O, BaseReg, RI); + printOp(BaseReg, RI); NeedPlus = true; } @@ -547,7 +583,7 @@ if (NeedPlus) O << " + "; if (ScaleVal != 1) O << ScaleVal << "*"; - printOp(O, IndexReg, RI); + printOp(IndexReg, RI); NeedPlus = true; } @@ -564,9 +600,11 @@ O << "]"; } -/// printMachineInstruction -- Print out an x86 instruction in intel syntax +/// printMachineInstruction -- Print out a single X86 LLVM instruction +/// MI in Intel syntax to the current output stream, using the given +/// TargetMachine. /// -void Printer::printMachineInstruction(const MachineInstr *MI, std::ostream &O, +void Printer::printMachineInstruction(const MachineInstr *MI, const TargetMachine &TM) const { unsigned Opcode = MI->getOpcode(); const TargetInstrInfo &TII = TM.getInstrInfo(); @@ -580,21 +618,21 @@ // seen by the assembler (e.g., IMPLICIT_USEs.) O << "# "; if (Opcode == X86::PHI) { - printOp(O, MI->getOperand(0), RI); + printOp(MI->getOperand(0), RI); O << " = phi "; for (unsigned i = 1, e = MI->getNumOperands(); i != e; i+=2) { if (i != 1) O << ", "; O << "["; - printOp(O, MI->getOperand(i), RI); + printOp(MI->getOperand(i), RI); O << ", "; - printOp(O, MI->getOperand(i+1), RI); + printOp(MI->getOperand(i+1), RI); O << "]"; } } else { unsigned i = 0; if (MI->getNumOperands() && (MI->getOperand(0).opIsDefOnly() || MI->getOperand(0).opIsDefAndUse())) { - printOp(O, MI->getOperand(0), RI); + printOp(MI->getOperand(0), RI); O << " = "; ++i; } @@ -604,7 +642,7 @@ O << " "; if (MI->getOperand(i).opIsDefOnly() || MI->getOperand(i).opIsDefAndUse()) O << "*"; - printOp(O, MI->getOperand(i), RI); + printOp(MI->getOperand(i), RI); if (MI->getOperand(i).opIsDefOnly() || MI->getOperand(i).opIsDefAndUse()) O << "*"; } @@ -627,7 +665,7 @@ O << TII.getName(MI->getOpcode()) << " "; if (MI->getNumOperands() == 1) { - printOp(O, MI->getOperand(0), RI, true); // Don't print "OFFSET"... + printOp(MI->getOperand(0), RI, true); // Don't print "OFFSET"... } O << "\n"; return; @@ -654,14 +692,14 @@ unsigned Reg = MI->getOperand(0).getReg(); O << TII.getName(MI->getOpCode()) << " "; - printOp(O, MI->getOperand(0), RI); + printOp(MI->getOperand(0), RI); if (MI->getNumOperands() == 2 && (!MI->getOperand(1).isRegister() || MI->getOperand(1).getVRegValueOrNull() || MI->getOperand(1).isGlobalAddress() || MI->getOperand(1).isExternalSymbol())) { O << ", "; - printOp(O, MI->getOperand(1), RI); + printOp(MI->getOperand(1), RI); } if (Desc.TSFlags & X86II::PrintImplUses) { for (const unsigned *p = Desc.ImplicitUses; *p; ++p) { @@ -695,12 +733,12 @@ && "Bad format for MRMDestReg!"); O << TII.getName(MI->getOpCode()) << " "; - printOp(O, MI->getOperand(0), RI); + printOp(MI->getOperand(0), RI); O << ", "; - printOp(O, MI->getOperand(1+isTwoAddr), RI); + printOp(MI->getOperand(1+isTwoAddr), RI); if (MI->getNumOperands() == 4) { O << ", "; - printOp(O, MI->getOperand(3), RI); + printOp(MI->getOperand(3), RI); } O << "\n"; return; @@ -714,9 +752,9 @@ MI->getOperand(4).isRegister() && "Bad format for MRMDestMem!"); O << TII.getName(MI->getOpCode()) << " " << sizePtr(Desc) << " "; - printMemReference(O, MI, 0, RI); + printMemReference(MI, 0, RI); O << ", "; - printOp(O, MI->getOperand(4), RI); + printOp(MI->getOperand(4), RI); O << "\n"; return; } @@ -741,9 +779,9 @@ O << "**"; O << TII.getName(MI->getOpCode()) << " "; - printOp(O, MI->getOperand(0), RI); + printOp(MI->getOperand(0), RI); O << ", "; - printOp(O, MI->getOperand(MI->getNumOperands()-1), RI); + printOp(MI->getOperand(MI->getNumOperands()-1), RI); O << "\n"; return; } @@ -762,9 +800,9 @@ O << "**"; O << TII.getName(MI->getOpCode()) << " "; - printOp(O, MI->getOperand(0), RI); + printOp(MI->getOperand(0), RI); O << ", " << sizePtr(Desc) << " "; - printMemReference(O, MI, MI->getNumOperands()-4, RI); + printMemReference(MI, MI->getNumOperands()-4, RI); O << "\n"; return; } @@ -793,10 +831,10 @@ O << "**"; O << TII.getName(MI->getOpCode()) << " "; - printOp(O, MI->getOperand(0), RI); + printOp(MI->getOperand(0), RI); if (MI->getOperand(MI->getNumOperands()-1).isImmediate()) { O << ", "; - printOp(O, MI->getOperand(MI->getNumOperands()-1), RI); + printOp(MI->getOperand(MI->getNumOperands()-1), RI); } if (Desc.TSFlags & X86II::PrintImplUses) { for (const unsigned *p = Desc.ImplicitUses; *p; ++p) { @@ -888,20 +926,20 @@ // expecting to see. if (MI->getOpCode() == X86::FISTPr64) { O << "fistpll DWORD PTR "; - printMemReference(O, MI, 0, RI); + printMemReference(MI, 0, RI); if (MI->getNumOperands() == 5) { O << ", "; - printOp(O, MI->getOperand(4), RI); + printOp(MI->getOperand(4), RI); } O << "\t# "; } O << TII.getName(MI->getOpCode()) << " "; O << sizePtr(Desc) << " "; - printMemReference(O, MI, 0, RI); + printMemReference(MI, 0, RI); if (MI->getNumOperands() == 5) { O << ", "; - printOp(O, MI->getOperand(4), RI); + printOp(MI->getOperand(4), RI); } O << "\n"; return; @@ -948,7 +986,9 @@ return 0; } -bool Printer::doFinalization(Module &M) { +bool Printer::doFinalization(Module &M) +{ + TargetData &TD = getAnalysis(); // Print out module-level global variables here. for (Module::const_giterator I = M.gbegin(), E = M.gend(); I != E; ++I) { std::string name(getValueName(I)); @@ -958,8 +998,8 @@ O << "\t.globl " << name << "\n"; O << "\t.type " << name << ", at object\n"; O << "\t.size " << name << "," - << (unsigned)TD->getTypeSize(I->getType()) << "\n"; - O << "\t.align " << (unsigned)TD->getTypeAlignment(C->getType()) << "\n"; + << (unsigned)TD.getTypeSize(I->getType()) << "\n"; + O << "\t.align " << (unsigned)TD.getTypeAlignment(C->getType()) << "\n"; O << name << ":\t\t\t\t\t#"; // If this is a constant function pointer, we only print out the // name of the function in the comment (because printing the @@ -975,8 +1015,8 @@ } else { O << "\t.globl " << name << "\n"; O << "\t.comm " << name << ", " - << (unsigned)TD->getTypeSize(I->getType()) << ", " - << (unsigned)TD->getTypeAlignment(I->getType()) << "\n"; + << (unsigned)TD.getTypeSize(I->getType()) << ", " + << (unsigned)TD.getTypeAlignment(I->getType()) << "\n"; } } MangledGlobals.clear(); From lattner at cs.uiuc.edu Wed Jul 23 14:06:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 14:06:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/or.ll Message-ID: <200307231905.OAA22278@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: or.ll updated: 1.18 -> 1.19 --- Log message: New testcase --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/or.ll diff -u llvm/test/Regression/Transforms/InstCombine/or.ll:1.18 llvm/test/Regression/Transforms/InstCombine/or.ll:1.19 --- llvm/test/Regression/Transforms/InstCombine/or.ll:1.18 Wed Jul 23 13:28:42 2003 +++ llvm/test/Regression/Transforms/InstCombine/or.ll Wed Jul 23 14:05:29 2003 @@ -143,3 +143,10 @@ %E = xor ubyte %D, 12 ret ubyte %E } + +uint %test23(uint %A) { + %B = or uint %A, 4 ; Should be eliminated + %C = and uint %B, 8 + ret uint %C +} + From brukman at cs.uiuc.edu Wed Jul 23 14:25:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Wed Jul 23 14:25:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile.programs Message-ID: <200307231924.OAA16767@zion.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile.programs updated: 1.74 -> 1.75 --- Log message: If program is non-deterministic, just touch the .diff file, don't output anything to it. --- Diffs of the changes: Index: llvm/test/Programs/Makefile.programs diff -u llvm/test/Programs/Makefile.programs:1.74 llvm/test/Programs/Makefile.programs:1.75 --- llvm/test/Programs/Makefile.programs:1.74 Wed Jul 23 10:20:54 2003 +++ llvm/test/Programs/Makefile.programs Wed Jul 23 14:24:42 2003 @@ -387,7 +387,7 @@ # ifdef PROGRAM_IS_NONDETERMINISTIC # If the program is non-deterministic, just output something to $@ -DIFFPROG = echo > $@ +DIFFPROG = touch $@ \# endif $(PROGRAMS_TO_TEST:%=Output/%.diff-lli): \ From lattner at cs.uiuc.edu Wed Jul 23 14:25:11 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 14:25:11 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/or.ll Message-ID: <200307231924.OAA23529@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: or.ll updated: 1.19 -> 1.20 --- Log message: New testcase --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/or.ll diff -u llvm/test/Regression/Transforms/InstCombine/or.ll:1.19 llvm/test/Regression/Transforms/InstCombine/or.ll:1.20 --- llvm/test/Regression/Transforms/InstCombine/or.ll:1.19 Wed Jul 23 14:05:29 2003 +++ llvm/test/Regression/Transforms/InstCombine/or.ll Wed Jul 23 14:24:34 2003 @@ -150,3 +150,9 @@ ret uint %C } +uint %test24(uint %A) { + %B = or uint %A, 12 + %C = and uint %B, 8 ; Always equal to 8 + ret uint %C +} + From lattner at cs.uiuc.edu Wed Jul 23 14:27:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 14:27:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200307231926.OAA23549@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.102 -> 1.103 --- Log message: - InstCombine: (X | C1) & C2 --> X & C2 iff C1 & C1 == 0 - InstCombine: (X | C) & C --> C - InstCombine: (X | C1) & C2 --> (X | (C1&C2)) & C2 --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.102 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.103 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.102 Wed Jul 23 13:29:44 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jul 23 14:25:52 2003 @@ -497,16 +497,39 @@ if (RHS->isAllOnesValue()) return ReplaceInstUsesWith(I, Op0); - // (X ^ C1) & C2 --> (X & C2) ^ (C1&C2) - if (Instruction *Op0I = dyn_cast(Op0)) - if (Op0I->getOpcode() == Instruction::Xor && isOnlyUse(Op0)) - if (ConstantInt *Op0CI = dyn_cast(Op0I->getOperand(1))) { - std::string Op0Name = Op0I->getName(); Op0I->setName(""); - Instruction *And = BinaryOperator::create(Instruction::And, - Op0I->getOperand(0), RHS, - Op0Name); - InsertNewInstBefore(And, I); - return BinaryOperator::create(Instruction::Xor, And, *RHS & *Op0CI); + if (BinaryOperator *Op0I = dyn_cast(Op0)) + if (ConstantInt *Op0CI = dyn_cast(Op0I->getOperand(1))) + if (Op0I->getOpcode() == Instruction::Xor) { + if (isOnlyUse(Op0)) { + // (X ^ C1) & C2 --> (X & C2) ^ (C1&C2) + std::string Op0Name = Op0I->getName(); Op0I->setName(""); + Instruction *And = BinaryOperator::create(Instruction::And, + Op0I->getOperand(0), RHS, + Op0Name); + InsertNewInstBefore(And, I); + return BinaryOperator::create(Instruction::Xor, And, *RHS & *Op0CI); + } + } else if (Op0I->getOpcode() == Instruction::Or) { + // (X | C1) & C2 --> X & C2 iff C1 & C1 == 0 + if ((*RHS & *Op0CI)->isNullValue()) + return BinaryOperator::create(Instruction::And, Op0I->getOperand(0), + RHS); + + Constant *Together = *RHS & *Op0CI; + if (Together == RHS) // (X | C) & C --> C + return ReplaceInstUsesWith(I, RHS); + + if (isOnlyUse(Op0)) { + if (Together != Op0CI) { + // (X | C1) & C2 --> (X | (C1&C2)) & C2 + std::string Op0Name = Op0I->getName(); Op0I->setName(""); + Instruction *Or = BinaryOperator::create(Instruction::Or, + Op0I->getOperand(0), + Together, Op0Name); + InsertNewInstBefore(Or, I); + return BinaryOperator::create(Instruction::And, Or, RHS); + } + } } } From lattner at cs.uiuc.edu Wed Jul 23 14:30:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 14:30:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile.programs Message-ID: <200307231929.OAA23603@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile.programs updated: 1.75 -> 1.76 --- Log message: Update comment --- Diffs of the changes: Index: llvm/test/Programs/Makefile.programs diff -u llvm/test/Programs/Makefile.programs:1.75 llvm/test/Programs/Makefile.programs:1.76 --- llvm/test/Programs/Makefile.programs:1.75 Wed Jul 23 14:24:42 2003 +++ llvm/test/Programs/Makefile.programs Wed Jul 23 14:29:47 2003 @@ -386,7 +386,7 @@ # Rules to diff test output... # ifdef PROGRAM_IS_NONDETERMINISTIC -# If the program is non-deterministic, just output something to $@ +# If the program is non-deterministic, just touch $@ DIFFPROG = touch $@ \# endif From lattner at cs.uiuc.edu Wed Jul 23 14:37:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 14:37:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200307231936.OAA24255@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.103 -> 1.104 --- Log message: InstCombine: (X ^ C1) & C2 --> (X & C2) iff (C1&C2) == 0 --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.103 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.104 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.103 Wed Jul 23 14:25:52 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jul 23 14:36:21 2003 @@ -497,23 +497,25 @@ if (RHS->isAllOnesValue()) return ReplaceInstUsesWith(I, Op0); - if (BinaryOperator *Op0I = dyn_cast(Op0)) + if (BinaryOperator *Op0I = dyn_cast(Op0)) { + Value *X = Op0I->getOperand(0); if (ConstantInt *Op0CI = dyn_cast(Op0I->getOperand(1))) if (Op0I->getOpcode() == Instruction::Xor) { - if (isOnlyUse(Op0)) { + if ((*RHS & *Op0CI)->isNullValue()) { + // (X ^ C1) & C2 --> (X & C2) iff (C1&C2) == 0 + return BinaryOperator::create(Instruction::And, X, RHS); + } else if (isOnlyUse(Op0)) { // (X ^ C1) & C2 --> (X & C2) ^ (C1&C2) std::string Op0Name = Op0I->getName(); Op0I->setName(""); Instruction *And = BinaryOperator::create(Instruction::And, - Op0I->getOperand(0), RHS, - Op0Name); + X, RHS, Op0Name); InsertNewInstBefore(And, I); return BinaryOperator::create(Instruction::Xor, And, *RHS & *Op0CI); } } else if (Op0I->getOpcode() == Instruction::Or) { // (X | C1) & C2 --> X & C2 iff C1 & C1 == 0 if ((*RHS & *Op0CI)->isNullValue()) - return BinaryOperator::create(Instruction::And, Op0I->getOperand(0), - RHS); + return BinaryOperator::create(Instruction::And, X, RHS); Constant *Together = *RHS & *Op0CI; if (Together == RHS) // (X | C) & C --> C @@ -523,14 +525,14 @@ if (Together != Op0CI) { // (X | C1) & C2 --> (X | (C1&C2)) & C2 std::string Op0Name = Op0I->getName(); Op0I->setName(""); - Instruction *Or = BinaryOperator::create(Instruction::Or, - Op0I->getOperand(0), - Together, Op0Name); + Instruction *Or = BinaryOperator::create(Instruction::Or, X, + Together, Op0Name); InsertNewInstBefore(Or, I); return BinaryOperator::create(Instruction::And, Or, RHS); } } } + } } Value *Op0NotVal = dyn_castNotVal(Op0); From lattner at cs.uiuc.edu Wed Jul 23 14:37:10 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 14:37:10 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/and.ll Message-ID: <200307231936.OAA24244@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: and.ll updated: 1.12 -> 1.13 --- Log message: New testcase --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/and.ll diff -u llvm/test/Regression/Transforms/InstCombine/and.ll:1.12 llvm/test/Regression/Transforms/InstCombine/and.ll:1.13 --- llvm/test/Regression/Transforms/InstCombine/and.ll:1.12 Wed Jul 23 13:28:42 2003 +++ llvm/test/Regression/Transforms/InstCombine/and.ll Wed Jul 23 14:35:51 2003 @@ -65,3 +65,13 @@ %D = and uint %C, 1 ; (X ^ C1) & C2 --> (X & C2) ^ (C1&C2) ret uint %D } + +uint %test11(uint %A, uint* %P) { + %B = or uint %A, 3 + %C = xor uint %B, 12 + store uint %C, uint* %P ; additional use of C + %D = and uint %C, 3 ; %C = and uint %B, 3 --> 3 + ret uint %D +} + + From lattner at cs.uiuc.edu Wed Jul 23 15:22:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 15:22:01 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Module.cpp Message-ID: <200307232021.PAA30749@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Module.cpp updated: 1.36 -> 1.37 --- Log message: Make Module::getNamedFunction prefer non-external functions if there is more than one function of the same name --- Diffs of the changes: Index: llvm/lib/VMCore/Module.cpp diff -u llvm/lib/VMCore/Module.cpp:1.36 llvm/lib/VMCore/Module.cpp:1.37 --- llvm/lib/VMCore/Module.cpp:1.36 Thu May 15 14:37:21 2003 +++ llvm/lib/VMCore/Module.cpp Wed Jul 23 15:21:30 2003 @@ -172,10 +172,14 @@ /// Function *Module::getNamedFunction(const std::string &Name) { // Loop over all of the functions, looking for the function desired + Function *Found = 0; for (iterator I = begin(), E = end(); I != E; ++I) if (I->getName() == Name) - return I; - return 0; // function not found... + if (I->isExternal()) + Found = I; + else + return I; + return Found; // Non-external function not found... } From lattner at cs.uiuc.edu Wed Jul 23 15:22:11 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 15:22:11 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/JIT/JIT.cpp Message-ID: <200307232021.PAA30740@apoc.cs.uiuc.edu> Changes in directory llvm/tools/lli/JIT: JIT.cpp updated: 1.11 -> 1.12 --- Log message: Fix space --- Diffs of the changes: Index: llvm/tools/lli/JIT/JIT.cpp diff -u llvm/tools/lli/JIT/JIT.cpp:1.11 llvm/tools/lli/JIT/JIT.cpp:1.12 --- llvm/tools/lli/JIT/JIT.cpp:1.11 Wed Jul 2 12:53:19 2003 +++ llvm/tools/lli/JIT/JIT.cpp Wed Jul 23 15:21:06 2003 @@ -104,7 +104,7 @@ int VM::run(const std::string &FnName, const std::vector &Args) { Function *F = getModule().getNamedFunction(FnName); if (F == 0) { - std::cerr << "Could not find function '" << FnName <<"' in module!\n"; + std::cerr << "Could not find function '" << FnName << "' in module!\n"; return 1; } From gaeke at cs.uiuc.edu Wed Jul 23 15:26:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Wed Jul 23 15:26:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/Printer.cpp X86.h X86TargetMachine.cpp Message-ID: <200307232025.PAA17505@neo.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: Printer.cpp updated: 1.46 -> 1.47 X86.h updated: 1.13 -> 1.14 X86TargetMachine.cpp updated: 1.18 -> 1.19 --- Log message: Printer.cpp: Ditch addRequired/getAnalysis, because they leave Printer::doFinalization() out in the cold. Now we pass in a TargetMachine to Printer's constructor and get the TargetData from the TargetMachine. Don't pass TargetMachine or MRegisterInfo objects around in the Printer. Constify TargetData references. X86.h: Update comment and prototype of createX86CodePrinterPass(). X86TargetMachine.cpp: Update callers of createX86CodePrinterPass(). --- Diffs of the changes: Index: llvm/lib/Target/X86/Printer.cpp diff -u llvm/lib/Target/X86/Printer.cpp:1.46 llvm/lib/Target/X86/Printer.cpp:1.47 --- llvm/lib/Target/X86/Printer.cpp:1.46 Wed Jul 23 13:37:06 2003 +++ llvm/lib/Target/X86/Printer.cpp Wed Jul 23 15:25:08 2003 @@ -33,11 +33,16 @@ std::set MangledGlobals; struct Printer : public MachineFunctionPass { - /// Output stream on which we're printing assembly code. This is - /// assigned by the constructor and never changes. + /// Output stream on which we're printing assembly code. /// std::ostream &O; - Printer(std::ostream &o) : O(o) { } + + /// Target machine description which we query for reg. names, data + /// layout, etc. + /// + TargetMachine &TM; + + Printer(std::ostream &o, TargetMachine &tm) : O(o), TM(tm) { } /// We name each basic block in a Function with a unique number, so /// that we can consistently refer to them later. This is cleared @@ -55,17 +60,11 @@ virtual const char *getPassName() const { return "X86 Assembly Printer"; } - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); - } - void printMachineInstruction(const MachineInstr *MI, - const TargetMachine &TM) const; + void printMachineInstruction(const MachineInstr *MI) const; void printOp(const MachineOperand &MO, - const MRegisterInfo &RI, bool elideOffsetKeyword = false) const; - void printMemReference(const MachineInstr *MI, - unsigned Op, - const MRegisterInfo &RI) const; + bool elideOffsetKeyword = false) const; + void printMemReference(const MachineInstr *MI, unsigned Op) const; void printConstantPool(MachineConstantPool *MCP); bool runOnMachineFunction(MachineFunction &F); std::string ConstantExprToString(const ConstantExpr* CE); @@ -79,11 +78,12 @@ } // end of anonymous namespace /// createX86CodePrinterPass - Returns a pass that prints the X86 -/// assembly code for a MachineFunction to the specified stream. This -/// should work regardless of whether the function is in SSA form. +/// assembly code for a MachineFunction to the given output stream, +/// using the given target machine description. This should work +/// regardless of whether the function is in SSA form. /// -Pass *createX86CodePrinterPass(std::ostream &O) { - return new Printer(O); +Pass *createX86CodePrinterPass(std::ostream &o, TargetMachine &tm) { + return new Printer(o, tm); } /// makeNameProper - We don't want identifier names with ., space, or @@ -166,7 +166,7 @@ /// std::string Printer::ConstantExprToString(const ConstantExpr* CE) { std::string S; - TargetData &TD = getAnalysis(); + const TargetData &TD = TM.getTargetData(); switch(CE->getOpcode()) { case Instruction::GetElementPtr: { // generate a symbolic expression for the byte address @@ -359,7 +359,7 @@ int numPadBytesAfter /* = 0 */) { const ConstantArray *CVA = dyn_cast(CV); - TargetData &TD = getAnalysis(); + const TargetData &TD = TM.getTargetData(); if (CVA && isStringCompatible(CVA)) { // print the string alone and return @@ -418,7 +418,7 @@ /// void Printer::printConstantPool(MachineConstantPool *MCP){ const std::vector &CP = MCP->getConstants(); - TargetData &TD = getAnalysis(); + const TargetData &TD = TM.getTargetData(); if (CP.empty()) return; @@ -439,7 +439,6 @@ // BBNumber is used here so that a given Printer will never give two // BBs the same name. (If you have a better way, please let me know!) static unsigned BBNumber = 0; - const TargetMachine &TM = MF.getTarget(); // What's my mangled name? CurrentFnName = getValueName(MF.getFunction()); @@ -472,7 +471,7 @@ II != E; ++II) { // Print the assembly for the instruction. O << "\t"; - printMachineInstruction(*II, TM); + printMachineInstruction(*II); } } @@ -495,8 +494,8 @@ } void Printer::printOp(const MachineOperand &MO, - const MRegisterInfo &RI, bool elideOffsetKeyword /* = false */) const { + const MRegisterInfo &RI = *TM.getRegisterInfo(); switch (MO.getType()) { case MachineOperand::MO_VirtualRegister: if (Value *V = MO.getVRegValueOrNull()) { @@ -547,9 +546,8 @@ } } -void Printer::printMemReference(const MachineInstr *MI, - unsigned Op, - const MRegisterInfo &RI) const { +void Printer::printMemReference(const MachineInstr *MI, unsigned Op) const { + const MRegisterInfo &RI = *TM.getRegisterInfo(); assert(isMem(MI, Op) && "Invalid memory reference!"); if (MI->getOperand(Op).isFrameIndex()) { @@ -575,7 +573,7 @@ O << "["; bool NeedPlus = false; if (BaseReg.getReg()) { - printOp(BaseReg, RI); + printOp(BaseReg); NeedPlus = true; } @@ -583,7 +581,7 @@ if (NeedPlus) O << " + "; if (ScaleVal != 1) O << ScaleVal << "*"; - printOp(IndexReg, RI); + printOp(IndexReg); NeedPlus = true; } @@ -601,11 +599,9 @@ } /// printMachineInstruction -- Print out a single X86 LLVM instruction -/// MI in Intel syntax to the current output stream, using the given -/// TargetMachine. +/// MI in Intel syntax to the current output stream. /// -void Printer::printMachineInstruction(const MachineInstr *MI, - const TargetMachine &TM) const { +void Printer::printMachineInstruction(const MachineInstr *MI) const { unsigned Opcode = MI->getOpcode(); const TargetInstrInfo &TII = TM.getInstrInfo(); const TargetInstrDescriptor &Desc = TII.get(Opcode); @@ -618,21 +614,21 @@ // seen by the assembler (e.g., IMPLICIT_USEs.) O << "# "; if (Opcode == X86::PHI) { - printOp(MI->getOperand(0), RI); + printOp(MI->getOperand(0)); O << " = phi "; for (unsigned i = 1, e = MI->getNumOperands(); i != e; i+=2) { if (i != 1) O << ", "; O << "["; - printOp(MI->getOperand(i), RI); + printOp(MI->getOperand(i)); O << ", "; - printOp(MI->getOperand(i+1), RI); + printOp(MI->getOperand(i+1)); O << "]"; } } else { unsigned i = 0; if (MI->getNumOperands() && (MI->getOperand(0).opIsDefOnly() || MI->getOperand(0).opIsDefAndUse())) { - printOp(MI->getOperand(0), RI); + printOp(MI->getOperand(0)); O << " = "; ++i; } @@ -642,7 +638,7 @@ O << " "; if (MI->getOperand(i).opIsDefOnly() || MI->getOperand(i).opIsDefAndUse()) O << "*"; - printOp(MI->getOperand(i), RI); + printOp(MI->getOperand(i)); if (MI->getOperand(i).opIsDefOnly() || MI->getOperand(i).opIsDefAndUse()) O << "*"; } @@ -665,7 +661,7 @@ O << TII.getName(MI->getOpcode()) << " "; if (MI->getNumOperands() == 1) { - printOp(MI->getOperand(0), RI, true); // Don't print "OFFSET"... + printOp(MI->getOperand(0), true); // Don't print "OFFSET"... } O << "\n"; return; @@ -692,14 +688,14 @@ unsigned Reg = MI->getOperand(0).getReg(); O << TII.getName(MI->getOpCode()) << " "; - printOp(MI->getOperand(0), RI); + printOp(MI->getOperand(0)); if (MI->getNumOperands() == 2 && (!MI->getOperand(1).isRegister() || MI->getOperand(1).getVRegValueOrNull() || MI->getOperand(1).isGlobalAddress() || MI->getOperand(1).isExternalSymbol())) { O << ", "; - printOp(MI->getOperand(1), RI); + printOp(MI->getOperand(1)); } if (Desc.TSFlags & X86II::PrintImplUses) { for (const unsigned *p = Desc.ImplicitUses; *p; ++p) { @@ -733,12 +729,12 @@ && "Bad format for MRMDestReg!"); O << TII.getName(MI->getOpCode()) << " "; - printOp(MI->getOperand(0), RI); + printOp(MI->getOperand(0)); O << ", "; - printOp(MI->getOperand(1+isTwoAddr), RI); + printOp(MI->getOperand(1+isTwoAddr)); if (MI->getNumOperands() == 4) { O << ", "; - printOp(MI->getOperand(3), RI); + printOp(MI->getOperand(3)); } O << "\n"; return; @@ -752,9 +748,9 @@ MI->getOperand(4).isRegister() && "Bad format for MRMDestMem!"); O << TII.getName(MI->getOpCode()) << " " << sizePtr(Desc) << " "; - printMemReference(MI, 0, RI); + printMemReference(MI, 0); O << ", "; - printOp(MI->getOperand(4), RI); + printOp(MI->getOperand(4)); O << "\n"; return; } @@ -779,9 +775,9 @@ O << "**"; O << TII.getName(MI->getOpCode()) << " "; - printOp(MI->getOperand(0), RI); + printOp(MI->getOperand(0)); O << ", "; - printOp(MI->getOperand(MI->getNumOperands()-1), RI); + printOp(MI->getOperand(MI->getNumOperands()-1)); O << "\n"; return; } @@ -800,9 +796,9 @@ O << "**"; O << TII.getName(MI->getOpCode()) << " "; - printOp(MI->getOperand(0), RI); + printOp(MI->getOperand(0)); O << ", " << sizePtr(Desc) << " "; - printMemReference(MI, MI->getNumOperands()-4, RI); + printMemReference(MI, MI->getNumOperands()-4); O << "\n"; return; } @@ -831,10 +827,10 @@ O << "**"; O << TII.getName(MI->getOpCode()) << " "; - printOp(MI->getOperand(0), RI); + printOp(MI->getOperand(0)); if (MI->getOperand(MI->getNumOperands()-1).isImmediate()) { O << ", "; - printOp(MI->getOperand(MI->getNumOperands()-1), RI); + printOp(MI->getOperand(MI->getNumOperands()-1)); } if (Desc.TSFlags & X86II::PrintImplUses) { for (const unsigned *p = Desc.ImplicitUses; *p; ++p) { @@ -926,20 +922,20 @@ // expecting to see. if (MI->getOpCode() == X86::FISTPr64) { O << "fistpll DWORD PTR "; - printMemReference(MI, 0, RI); + printMemReference(MI, 0); if (MI->getNumOperands() == 5) { O << ", "; - printOp(MI->getOperand(4), RI); + printOp(MI->getOperand(4)); } O << "\t# "; } O << TII.getName(MI->getOpCode()) << " "; O << sizePtr(Desc) << " "; - printMemReference(MI, 0, RI); + printMemReference(MI, 0); if (MI->getNumOperands() == 5) { O << ", "; - printOp(MI->getOperand(4), RI); + printOp(MI->getOperand(4)); } O << "\n"; return; @@ -988,7 +984,7 @@ bool Printer::doFinalization(Module &M) { - TargetData &TD = getAnalysis(); + const TargetData &TD = TM.getTargetData(); // Print out module-level global variables here. for (Module::const_giterator I = M.gbegin(), E = M.gend(); I != E; ++I) { std::string name(getValueName(I)); Index: llvm/lib/Target/X86/X86.h diff -u llvm/lib/Target/X86/X86.h:1.13 llvm/lib/Target/X86/X86.h:1.14 --- llvm/lib/Target/X86/X86.h:1.13 Tue Jun 3 10:31:23 2003 +++ llvm/lib/Target/X86/X86.h Wed Jul 23 15:25:08 2003 @@ -29,11 +29,12 @@ /// Pass *createX86FloatingPointStackifierPass(); -/// createX86CodePrinterPass - Print out the specified machine code function to -/// the specified stream. This function should work regardless of whether or -/// not the function is in SSA form or not. +/// createX86CodePrinterPass - Returns a pass that prints the X86 +/// assembly code for a MachineFunction to the given output stream, +/// using the given target machine description. This should work +/// regardless of whether the function is in SSA form. /// -Pass *createX86CodePrinterPass(std::ostream &O); +Pass *createX86CodePrinterPass(std::ostream &o, TargetMachine &tm); /// X86EmitCodeToMemory - This function converts a register allocated function /// into raw machine code in a dynamically allocated chunk of memory. A pointer Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.18 llvm/lib/Target/X86/X86TargetMachine.cpp:1.19 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.18 Wed Jun 18 16:43:21 2003 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Wed Jul 23 15:25:08 2003 @@ -50,7 +50,7 @@ PM.add(createX86FloatingPointStackifierPass()); PM.add(createPrologEpilogCodeInserter()); PM.add(createX86PeepholeOptimizerPass()); - PM.add(createX86CodePrinterPass(Out)); + PM.add(createX86CodePrinterPass(Out, *this)); return false; // success! } @@ -92,7 +92,7 @@ PM.add(createX86PeepholeOptimizerPass()); if (PrintCode) // Print the register-allocated code - PM.add(createX86CodePrinterPass(std::cerr)); + PM.add(createX86CodePrinterPass(std::cerr, *this)); return false; // success! } From lattner at cs.uiuc.edu Wed Jul 23 15:46:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 15:46:02 2003 Subject: [llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp Message-ID: <200307232045.PAA32564@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CWriter: Writer.cpp updated: 1.108 -> 1.109 --- Log message: Fix program: SingleSource/UnitTests/2003-07-09-SignedArgs with the CBE --- Diffs of the changes: Index: llvm/lib/CWriter/Writer.cpp diff -u llvm/lib/CWriter/Writer.cpp:1.108 llvm/lib/CWriter/Writer.cpp:1.109 --- llvm/lib/CWriter/Writer.cpp:1.108 Wed Jul 23 10:22:15 2003 +++ llvm/lib/CWriter/Writer.cpp Wed Jul 23 15:45:31 2003 @@ -91,7 +91,8 @@ // emit it inline where it would go. if (I.getType() == Type::VoidTy || I.use_size() != 1 || isa(I) || isa(I) || isa(I) || - isa(I)) // Don't inline a load across a store! + isa(I) || isa(I)) + // Don't inline a load across a store or other bad things! return false; // Only inline instruction it it's use is in the same BB as the inst. From lattner at cs.uiuc.edu Wed Jul 23 15:49:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 15:49:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Analysis/DSGraph/HardBUCase.ll Message-ID: <200307232048.PAA00618@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Analysis/DSGraph: HardBUCase.ll added (r1.1) --- Log message: Check in old testcase sitting in my tree --- Diffs of the changes: Index: llvm/test/Regression/Analysis/DSGraph/HardBUCase.ll diff -c /dev/null llvm/test/Regression/Analysis/DSGraph/HardBUCase.ll:1.1 *** /dev/null Wed Jul 23 15:48:13 2003 --- llvm/test/Regression/Analysis/DSGraph/HardBUCase.ll Wed Jul 23 15:48:03 2003 *************** *** 0 **** --- 1,19 ---- + + %MidFnTy = type void (\2*) + + implementation + + int %main() { + call %MidFnTy* %Mid(%MidFnTy* %Mid) + ret int 0 + } + + internal void %Mid(%MidFnTy *%F) { + call void %Bottom(%MidFnTy* %F) + ret void + } + + internal void %Bottom(%MidFnTy* %F) { + call void %F(%MidFnTy* %Mid) + ret void + } From lattner at cs.uiuc.edu Wed Jul 23 16:07:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 16:07:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/or.ll Message-ID: <200307232106.QAA03722@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: or.ll updated: 1.20 -> 1.21 --- Log message: Remove obscure test --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/or.ll diff -u llvm/test/Regression/Transforms/InstCombine/or.ll:1.20 llvm/test/Regression/Transforms/InstCombine/or.ll:1.21 --- llvm/test/Regression/Transforms/InstCombine/or.ll:1.20 Wed Jul 23 14:24:34 2003 +++ llvm/test/Regression/Transforms/InstCombine/or.ll Wed Jul 23 16:06:34 2003 @@ -118,17 +118,6 @@ ret bool %C } - -bool %test20(int %A) { - %B = xor int %A, -1 - %C = and int %B, 4 - %D = setne int %C, 0 - %E = and int %B, 123 ; Make the usecount of B = 2 - %F = cast int %E to bool - %G = and bool %D, %F - ret bool %G -} - ubyte %test21(ubyte %A) { %B = or ubyte %A, 1 %C = and ubyte %B, 254 From lattner at cs.uiuc.edu Wed Jul 23 16:12:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 16:12:04 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/xor.ll or.ll Message-ID: <200307232111.QAA04014@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: xor.ll added (r1.1) or.ll updated: 1.21 -> 1.22 --- Log message: Split the or and xor tests into two separate files --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/xor.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/xor.ll:1.1 *** /dev/null Wed Jul 23 16:11:05 2003 --- llvm/test/Regression/Transforms/InstCombine/xor.ll Wed Jul 23 16:10:55 2003 *************** *** 0 **** --- 1,66 ---- + ; This test makes sure that these instructions are properly eliminated. + ; + + ; RUN: as < %s | opt -instcombine | dis | not grep 'xor ' + + implementation + + bool %test5(bool %A) { + %B = xor bool %A, false + ret bool %B + } + + int %test6(int %A) { + %B = xor int %A, 0 + ret int %B + } + + bool %test7(bool %A) { + %B = xor bool %A, %A + ret bool %B + } + + int %test8(int %A) { + %B = xor int %A, %A + ret int %B + } + + int %test11(int %A) { ; A ^ ~A == -1 + %NotA = xor int -1, %A + %B = xor int %A, %NotA + ret int %B + } + + uint %test13(uint %A) { ; (A|B)^B == A & (~B) + %t1 = or uint %A, 123 + %r = xor uint %t1, 123 + ret uint %r + } + + ubyte %test15(ubyte %A) { + %B = xor ubyte %A, 17 + %C = xor ubyte %B, 17 + ret ubyte %C + } + + int %test16(int %A, int %B) { ; (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0 + %A1 = and int %A, 7 + %B1 = and int %B, 128 + %OROK = xor int %A1, %B1 + ret int %OROK + } + + ubyte %test18(bool %c) { + %d = xor bool %c, true ; invert the condition + br bool %d, label %True, label %False + True: + ret ubyte 1 + False: + ret ubyte 3 + } + + bool %test19(ubyte %A) { + %B = xor ubyte %A, 123 ; xor can be eliminated + %C = seteq ubyte %B, 34 + ret bool %C + } Index: llvm/test/Regression/Transforms/InstCombine/or.ll diff -u llvm/test/Regression/Transforms/InstCombine/or.ll:1.21 llvm/test/Regression/Transforms/InstCombine/or.ll:1.22 --- llvm/test/Regression/Transforms/InstCombine/or.ll:1.21 Wed Jul 23 16:06:34 2003 +++ llvm/test/Regression/Transforms/InstCombine/or.ll Wed Jul 23 16:10:55 2003 @@ -1,7 +1,7 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: as < %s | opt -instcombine | dis | grep -v '%OROK = or' | not grep 'or ' +; RUN: as < %s | opt -instcombine | dis | grep -v xor | not grep 'or ' implementation @@ -30,26 +30,6 @@ ret bool %B } -bool %test5(bool %A) { - %B = xor bool %A, false - ret bool %B -} - -int %test6(int %A) { - %B = xor int %A, 0 - ret int %B -} - -bool %test7(bool %A) { - %B = xor bool %A, %A - ret bool %B -} - -int %test8(int %A) { - %B = xor int %A, %A - ret int %B -} - bool %test9(bool %A) { %B = or bool %A, %A ret bool %B @@ -60,62 +40,23 @@ ret int %B } -int %test11(int %A) { ; A ^ ~A == -1 - %NotA = xor int -1, %A - %B = xor int %A, %NotA - ret int %B -} - int %test12(int %A) { ; A | ~A == -1 %NotA = xor int -1, %A %B = or int %A, %NotA ret int %B } -uint %test13(uint %A) { ; (A|B)^B == A & (~B) - %t1 = or uint %A, 123 - %r = xor uint %t1, 123 - ret uint %r -} - ubyte %test14(ubyte %A) { %B = or ubyte %A, 254 %C = or ubyte %B, 1 ret ubyte %C } -ubyte %test15(ubyte %A) { - %B = xor ubyte %A, 17 - %C = xor ubyte %B, 17 - ret ubyte %C -} - -int %test16(int %A, int %B) { ; (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0 - %A1 = and int %A, 7 - %B1 = and int %B, 128 - %OROK = xor int %A1, %B1 - ret int %OROK -} ubyte %test17(ubyte %A, ubyte %B) { ; Test that (A|c1)|(B|c2) == (A|B)|(c1|c2) %C = or ubyte %A, 1 %D = or ubyte %B, 254 %E = or ubyte %C, %D ret ubyte %E -} - -ubyte %test18(bool %c) { - %d = xor bool %c, true ; invert the condition - br bool %d, label %True, label %False -True: - ret ubyte 1 -False: - ret ubyte 3 -} - -bool %test19(ubyte %A) { - %B = xor ubyte %A, 123 ; xor can be eliminated - %C = seteq ubyte %B, 34 - ret bool %C } ubyte %test21(ubyte %A) { From lattner at cs.uiuc.edu Wed Jul 23 16:13:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 16:13:03 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/or.ll xor.ll Message-ID: <200307232112.QAA04028@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: or.ll updated: 1.22 -> 1.23 xor.ll updated: 1.1 -> 1.2 --- Log message: Renumber tests sequentially --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/or.ll diff -u llvm/test/Regression/Transforms/InstCombine/or.ll:1.22 llvm/test/Regression/Transforms/InstCombine/or.ll:1.23 --- llvm/test/Regression/Transforms/InstCombine/or.ll:1.22 Wed Jul 23 16:10:55 2003 +++ llvm/test/Regression/Transforms/InstCombine/or.ll Wed Jul 23 16:11:56 2003 @@ -30,43 +30,43 @@ ret bool %B } -bool %test9(bool %A) { +bool %test5(bool %A) { %B = or bool %A, %A ret bool %B } -int %test10(int %A) { +int %test6(int %A) { %B = or int %A, %A ret int %B } -int %test12(int %A) { ; A | ~A == -1 +int %test7(int %A) { ; A | ~A == -1 %NotA = xor int -1, %A %B = or int %A, %NotA ret int %B } -ubyte %test14(ubyte %A) { +ubyte %test8(ubyte %A) { %B = or ubyte %A, 254 %C = or ubyte %B, 1 ret ubyte %C } -ubyte %test17(ubyte %A, ubyte %B) { ; Test that (A|c1)|(B|c2) == (A|B)|(c1|c2) +ubyte %test9(ubyte %A, ubyte %B) { ; Test that (A|c1)|(B|c2) == (A|B)|(c1|c2) %C = or ubyte %A, 1 %D = or ubyte %B, 254 %E = or ubyte %C, %D ret ubyte %E } -ubyte %test21(ubyte %A) { +ubyte %test10(ubyte %A) { %B = or ubyte %A, 1 %C = and ubyte %B, 254 %D = or ubyte %C, 254 ; (X & C1) | C2 --> (X | C2) & (C1|C2) ret ubyte %D } -ubyte %test22(ubyte %A) { +ubyte %test11(ubyte %A) { %B = or ubyte %A, 254 %C = xor ubyte %B, 13 %D = or ubyte %C, 1 ; (X ^ C1) | C2 --> (X | C2) ^ (C1&~C2) @@ -74,13 +74,13 @@ ret ubyte %E } -uint %test23(uint %A) { +uint %test12(uint %A) { %B = or uint %A, 4 ; Should be eliminated %C = and uint %B, 8 ret uint %C } -uint %test24(uint %A) { +uint %test13(uint %A) { %B = or uint %A, 12 %C = and uint %B, 8 ; Always equal to 8 ret uint %C Index: llvm/test/Regression/Transforms/InstCombine/xor.ll diff -u llvm/test/Regression/Transforms/InstCombine/xor.ll:1.1 llvm/test/Regression/Transforms/InstCombine/xor.ll:1.2 --- llvm/test/Regression/Transforms/InstCombine/xor.ll:1.1 Wed Jul 23 16:10:55 2003 +++ llvm/test/Regression/Transforms/InstCombine/xor.ll Wed Jul 23 16:11:56 2003 @@ -5,52 +5,54 @@ implementation -bool %test5(bool %A) { +bool %test0(bool %A) { %B = xor bool %A, false ret bool %B } -int %test6(int %A) { +int %test1(int %A) { %B = xor int %A, 0 ret int %B } -bool %test7(bool %A) { +bool %test2(bool %A) { %B = xor bool %A, %A ret bool %B } -int %test8(int %A) { +int %test3(int %A) { %B = xor int %A, %A ret int %B } -int %test11(int %A) { ; A ^ ~A == -1 +int %test4(int %A) { ; A ^ ~A == -1 %NotA = xor int -1, %A %B = xor int %A, %NotA ret int %B } -uint %test13(uint %A) { ; (A|B)^B == A & (~B) +uint %test5(uint %A) { ; (A|B)^B == A & (~B) %t1 = or uint %A, 123 %r = xor uint %t1, 123 ret uint %r } -ubyte %test15(ubyte %A) { +ubyte %test6(ubyte %A) { %B = xor ubyte %A, 17 %C = xor ubyte %B, 17 ret ubyte %C } -int %test16(int %A, int %B) { ; (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0 +; (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0 +int %test7(int %A, int %B) { + %A1 = and int %A, 7 %B1 = and int %B, 128 %OROK = xor int %A1, %B1 ret int %OROK } -ubyte %test18(bool %c) { +ubyte %test8(bool %c) { %d = xor bool %c, true ; invert the condition br bool %d, label %True, label %False True: @@ -59,7 +61,7 @@ ret ubyte 3 } -bool %test19(ubyte %A) { +bool %test9(ubyte %A) { %B = xor ubyte %A, 123 ; xor can be eliminated %C = seteq ubyte %B, 34 ret bool %C From lattner at cs.uiuc.edu Wed Jul 23 16:37:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 16:37:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/xor.ll Message-ID: <200307232136.QAA06532@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: xor.ll updated: 1.2 -> 1.3 --- Log message: New testcases --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/xor.ll diff -u llvm/test/Regression/Transforms/InstCombine/xor.ll:1.2 llvm/test/Regression/Transforms/InstCombine/xor.ll:1.3 --- llvm/test/Regression/Transforms/InstCombine/xor.ll:1.2 Wed Jul 23 16:11:56 2003 +++ llvm/test/Regression/Transforms/InstCombine/xor.ll Wed Jul 23 16:36:01 2003 @@ -48,8 +48,8 @@ %A1 = and int %A, 7 %B1 = and int %B, 128 - %OROK = xor int %A1, %B1 - ret int %OROK + %C1 = xor int %A1, %B1 + ret int %C1 } ubyte %test8(bool %c) { @@ -65,4 +65,16 @@ %B = xor ubyte %A, 123 ; xor can be eliminated %C = seteq ubyte %B, 34 ret bool %C +} + +ubyte %test10(ubyte %A) { + %B = and ubyte %A, 3 + %C = xor ubyte %B, 4 ; transform into an OR + ret ubyte %C +} + +ubyte %test11(ubyte %A) { + %B = or ubyte %A, 12 + %C = xor ubyte %B, 4 ; transform into an AND + ret ubyte %C } From lattner at cs.uiuc.edu Wed Jul 23 16:38:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 16:38:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200307232137.QAA06543@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.104 -> 1.105 --- Log message: Remove explicit check for: not (not X) = X, it is already handled because xor is commutative - InstCombine: (X & C1) ^ C2 --> (X & C1) | C2 iff (C1&C2) == 0 - InstCombine: (X | C1) ^ C2 --> (X | C1) & ~C2 iff (C1&C2) == C2 --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.104 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.105 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.104 Wed Jul 23 14:36:21 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jul 23 16:37:07 2003 @@ -625,22 +625,28 @@ if (Op0 == Op1) return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); - if (ConstantIntegral *Op1C = dyn_cast(Op1)) { + if (ConstantIntegral *RHS = dyn_cast(Op1)) { // xor X, 0 == X - if (Op1C->isNullValue()) + if (RHS->isNullValue()) return ReplaceInstUsesWith(I, Op0); - // Is this a "NOT" instruction? - if (Op1C->isAllOnesValue()) { - // xor (xor X, -1), -1 = not (not X) = X - if (Value *X = dyn_castNotVal(Op0)) - return ReplaceInstUsesWith(I, X); - + if (BinaryOperator *Op0I = dyn_cast(Op0)) { // xor (setcc A, B), true = not (setcc A, B) = setncc A, B - if (SetCondInst *SCI = dyn_cast(Op0)) - if (SCI->use_size() == 1) + if (SetCondInst *SCI = dyn_cast(Op0I)) + if (RHS == ConstantBool::True && SCI->use_size() == 1) return new SetCondInst(SCI->getInverseCondition(), SCI->getOperand(0), SCI->getOperand(1)); + + if (ConstantInt *Op0CI = dyn_cast(Op0I->getOperand(1))) + if (Op0I->getOpcode() == Instruction::And) { + // (X & C1) ^ C2 --> (X & C1) | C2 iff (C1&C2) == 0 + if ((*RHS & *Op0CI)->isNullValue()) + return BinaryOperator::create(Instruction::Or, Op0, RHS); + } else if (Op0I->getOpcode() == Instruction::Or) { + // (X | C1) ^ C2 --> (X | C1) & ~C2 iff (C1&C2) == C2 + if ((*RHS & *Op0CI) == RHS) + return BinaryOperator::create(Instruction::And, Op0, ~*RHS); + } } } From lattner at cs.uiuc.edu Wed Jul 23 16:43:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 16:43:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200307232142.QAA06565@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.105 -> 1.106 --- Log message: Add comments --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.105 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.106 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.105 Wed Jul 23 16:37:07 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jul 23 16:41:57 2003 @@ -12,6 +12,15 @@ // // This is a simple worklist driven algorithm. // +// This pass guarantees that the following cannonicalizations are performed on +// the program: +// 1. If a binary operator has a constant operand, it is moved to the RHS +// 2. Logical operators with constant operands are always grouped so that +// 'or's are performed first, then 'and's, then 'xor's. +// 3. SetCC instructions are converted from <,>,<=,>= to ==,!= if possible +// 4. All SetCC instructions on boolean values are replaced with logical ops +// N. This list is incomplete +// //===----------------------------------------------------------------------===// #include "llvm/Transforms/Scalar.h" From lattner at cs.uiuc.edu Wed Jul 23 17:03:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 17:03:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/FunctionResolve/2003-07-23-CPR-Reference.ll Message-ID: <200307232202.RAA07800@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/FunctionResolve: 2003-07-23-CPR-Reference.ll added (r1.1) --- Log message: New testcase --- Diffs of the changes: Index: llvm/test/Regression/Transforms/FunctionResolve/2003-07-23-CPR-Reference.ll diff -c /dev/null llvm/test/Regression/Transforms/FunctionResolve/2003-07-23-CPR-Reference.ll:1.1 *** /dev/null Wed Jul 23 17:02:49 2003 --- llvm/test/Regression/Transforms/FunctionResolve/2003-07-23-CPR-Reference.ll Wed Jul 23 17:02:39 2003 *************** *** 0 **** --- 1,10 ---- + ; RUN: as < %s | opt -funcresolve | dis | not grep foo + + ; The funcresolve pass was resolving the two foo's together in this test, + ; adding a ConstantPointerRef to one of them. Then because of this + ; reference, it wasn't able to delete the dead declaration. :( + + declare int %foo(...) + declare int %foo(int) + + From lattner at cs.uiuc.edu Wed Jul 23 17:04:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 17:04:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/FunctionResolution.cpp Message-ID: <200307232203.RAA07809@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: FunctionResolution.cpp updated: 1.32 -> 1.33 --- Log message: Fix bug: FunctionResolve/2003-07-23-CPR-Reference.ll This fixes a long time annoyance which caused prototypes for bzero, bcopy, bcmp, fputs, and fputs_unlocked to never get deleted. Grr. --- Diffs of the changes: Index: llvm/lib/Transforms/IPO/FunctionResolution.cpp diff -u llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.32 llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.33 --- llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.32 Thu Jun 19 11:59:19 2003 +++ llvm/lib/Transforms/IPO/FunctionResolution.cpp Wed Jul 23 17:03:18 2003 @@ -80,12 +80,14 @@ // functions and that the Old function has no varargs fns specified. In // otherwords it's just (...) // - Value *Replacement = Concrete; - if (Concrete->getType() != Old->getType()) - Replacement = ConstantExpr::getCast(ConstantPointerRef::get(Concrete), - Old->getType()); - NumResolved += Old->use_size(); - Old->replaceAllUsesWith(Replacement); + if (!Old->use_empty()) { // Avoid making the CPR unless we really need it + Value *Replacement = Concrete; + if (Concrete->getType() != Old->getType()) + Replacement = ConstantExpr::getCast(ConstantPointerRef::get(Concrete), + Old->getType()); + NumResolved += Old->use_size(); + Old->replaceAllUsesWith(Replacement); + } // Since there are no uses of Old anymore, remove it from the module. M.getFunctionList().erase(Old); From lattner at cs.uiuc.edu Wed Jul 23 18:22:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 18:22:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/cast-set.ll Message-ID: <200307232321.SAA14215@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: cast-set.ll updated: 1.7 -> 1.8 --- Log message: Add new tests, make existing tests more difficult --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/cast-set.ll diff -u llvm/test/Regression/Transforms/InstCombine/cast-set.ll:1.7 llvm/test/Regression/Transforms/InstCombine/cast-set.ll:1.8 --- llvm/test/Regression/Transforms/InstCombine/cast-set.ll:1.7 Sat Jun 28 18:31:56 2003 +++ llvm/test/Regression/Transforms/InstCombine/cast-set.ll Wed Jul 23 18:21:08 2003 @@ -7,7 +7,7 @@ bool %test1(int %X) { %A = cast int %X to uint - %c = setne uint %A, 0 ; Convert to setne int %X, 0 + %c = setne uint %A, 12 ; Convert to setne int %X, 12 ret bool %c } @@ -30,8 +30,15 @@ int %test4(int %A) { %B = cast int %A to uint - %C = shl uint %B, ubyte 1 + %C = shl uint %B, ubyte 2 %D = cast uint %C to int ret int %D } +short %test5(short %A) { + %B = cast short %A to uint + %C = and uint %B, 15 + %D = cast uint %C to short + ret short %D +} + From lattner at cs.uiuc.edu Wed Jul 23 18:30:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jul 23 18:30:01 2003 Subject: [llvm-commits] CVS: llvm/projects/sample/Makefile Message-ID: <200307232329.SAA23056@apoc.cs.uiuc.edu> Changes in directory llvm/projects/sample: Makefile updated: 1.2 -> 1.3 --- Log message: Disable sample project until it works --- Diffs of the changes: Index: llvm/projects/sample/Makefile diff -u llvm/projects/sample/Makefile:1.2 llvm/projects/sample/Makefile:1.3 --- llvm/projects/sample/Makefile:1.2 Mon Jun 30 17:12:41 2003 +++ llvm/projects/sample/Makefile Wed Jul 23 18:28:57 2003 @@ -10,7 +10,7 @@ # # Directories that needs to be built. # -DIRS = lib tools +#DIRS = lib tools # # Include the Master Makefile that knows how to build all. From gaeke at cs.uiuc.edu Thu Jul 24 12:31:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jul 24 12:31:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/Printer.cpp Message-ID: <200307241730.MAA04029@neo.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: Printer.cpp updated: 1.47 -> 1.48 --- Log message: Constify most methods. We could have constified doInitialization and doFinalization too except that would have made them shadow, not override, the parent class :-P. Allow *any* constant cast expression between pointers and longs, or vice-versa, or any widening (not just same-size) conversion that isLosslesslyConvertibleTo approves. This fixes oopack. --- Diffs of the changes: Index: llvm/lib/Target/X86/Printer.cpp diff -u llvm/lib/Target/X86/Printer.cpp:1.47 llvm/lib/Target/X86/Printer.cpp:1.48 --- llvm/lib/Target/X86/Printer.cpp:1.47 Wed Jul 23 15:25:08 2003 +++ llvm/lib/Target/X86/Printer.cpp Thu Jul 24 12:30:45 2003 @@ -65,15 +65,14 @@ void printOp(const MachineOperand &MO, bool elideOffsetKeyword = false) const; void printMemReference(const MachineInstr *MI, unsigned Op) const; - void printConstantPool(MachineConstantPool *MCP); + void printConstantPool(MachineConstantPool *MCP) const; bool runOnMachineFunction(MachineFunction &F); - std::string ConstantExprToString(const ConstantExpr* CE); - std::string valToExprString(const Value* V); + std::string ConstantExprToString(const ConstantExpr* CE) const; + std::string valToExprString(const Value* V) const; bool doInitialization(Module &M); bool doFinalization(Module &M); - void PrintZeroBytesToPad(int numBytes); - void printConstantValueOnly(const Constant* CV, int numPadBytesAfter = 0); - void printSingleConstantValue(const Constant* CV); + void printConstantValueOnly(const Constant* CV, int numPadBytesAfter = 0) const; + void printSingleConstantValue(const Constant* CV) const; }; } // end of anonymous namespace @@ -128,7 +127,7 @@ /// valToExprString - Helper function for ConstantExprToString(). /// Appends result to argument string S. /// -std::string Printer::valToExprString(const Value* V) { +std::string Printer::valToExprString(const Value* V) const { std::string S; bool failed = false; if (const Constant* CV = dyn_cast(V)) { // symbolic or known @@ -164,7 +163,7 @@ /// ConstantExprToString - Convert a ConstantExpr to an asm expression /// and return this as a string. /// -std::string Printer::ConstantExprToString(const ConstantExpr* CE) { +std::string Printer::ConstantExprToString(const ConstantExpr* CE) const { std::string S; const TargetData &TD = TM.getTargetData(); switch(CE->getOpcode()) { @@ -178,11 +177,21 @@ } case Instruction::Cast: - // Support only non-converting casts for now, i.e., a no-op. - // This assertion is not a complete check. - assert(TD.getTypeSize(CE->getType()) == - TD.getTypeSize(CE->getOperand(0)->getType())); - S += "(" + valToExprString(CE->getOperand(0)) + ")"; + // Support only non-converting or widening casts for now, that is, + // ones that do not involve a change in value. This assertion is + // not a complete check. + { + Constant *Op = CE->getOperand(0); + const Type *OpTy = Op->getType(), *Ty = CE->getType(); + assert(((isa(OpTy) + && (Ty == Type::LongTy || Ty == Type::ULongTy)) + || (isa(Ty) + && (OpTy == Type::LongTy || OpTy == Type::ULongTy))) + || (((TD.getTypeSize(Ty) >= TD.getTypeSize(OpTy)) + && (OpTy-> isLosslesslyConvertibleTo(Ty)))) + && "FIXME: Don't yet support this kind of constant cast expr"); + S += "(" + valToExprString(Op) + ")"; + } break; case Instruction::Add: @@ -201,7 +210,7 @@ /// printSingleConstantValue - Print a single constant value. /// void -Printer::printSingleConstantValue(const Constant* CV) +Printer::printSingleConstantValue(const Constant* CV) const { assert(CV->getType() != Type::VoidTy && CV->getType() != Type::TypeTy && @@ -356,7 +365,7 @@ // Uses printSingleConstantValue() to print each individual value. void Printer::printConstantValueOnly(const Constant* CV, - int numPadBytesAfter /* = 0 */) + int numPadBytesAfter /* = 0 */) const { const ConstantArray *CVA = dyn_cast(CV); const TargetData &TD = TM.getTargetData(); @@ -416,7 +425,7 @@ /// used to print out constants which have been "spilled to memory" by /// the code generator. /// -void Printer::printConstantPool(MachineConstantPool *MCP){ +void Printer::printConstantPool(MachineConstantPool *MCP) const { const std::vector &CP = MCP->getConstants(); const TargetData &TD = TM.getTargetData(); From lattner at cs.uiuc.edu Thu Jul 24 12:36:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jul 24 12:36:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/ExprTypeConvert.cpp Message-ID: <200307241735.MAA23312@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms: ExprTypeConvert.cpp updated: 1.74 -> 1.75 --- Log message: Minor cleanups --- Diffs of the changes: Index: llvm/lib/Transforms/ExprTypeConvert.cpp diff -u llvm/lib/Transforms/ExprTypeConvert.cpp:1.74 llvm/lib/Transforms/ExprTypeConvert.cpp:1.75 --- llvm/lib/Transforms/ExprTypeConvert.cpp:1.74 Mon Jun 23 12:36:49 2003 +++ llvm/lib/Transforms/ExprTypeConvert.cpp Thu Jul 24 12:31:56 2003 @@ -143,13 +143,13 @@ ValueTypeCache::iterator CTMI = CTMap.find(V); if (CTMI != CTMap.end()) return CTMI->second == Ty; - // If it's a constant... all constants can be converted to a different type. We - // just ask the constant propagator to see if it can convert the value... + // If it's a constant... all constants can be converted to a different + // type. We just ask the constant propagator to see if it can convert the + // value... // if (Constant *CPV = dyn_cast(V)) return ConstantFoldCastInstruction(CPV, Ty); - CTMap[V] = Ty; if (V->getType() == Ty) return true; // Expression already correct type! From lattner at cs.uiuc.edu Thu Jul 24 12:36:10 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jul 24 12:36:10 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200307241735.MAA23307@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.106 -> 1.107 --- Log message: Allow folding several instructions into casts, which can simplify a lot of codes. For example, short kernel (short t1) { t1 >>= 8; t1 <<= 8; return t1; } became: short %kernel(short %t1.1) { %tmp.3 = shr short %t1.1, ubyte 8 ; [#uses=1] %tmp.5 = cast short %tmp.3 to int ; [#uses=1] %tmp.7 = shl int %tmp.5, ubyte 8 ; [#uses=1] %tmp.8 = cast int %tmp.7 to short ; [#uses=1] ret short %tmp.8 } before, now it becomes: short %kernel(short %t1.1) { %tmp.3 = shr short %t1.1, ubyte 8 ; [#uses=1] %tmp.8 = shl short %tmp.3, ubyte 8 ; [#uses=1] ret short %tmp.8 } which will become: short %kernel(short %t1.1) { %tmp.3 = and short %t1.1, 0xFF00 ret short %tmp.3 } This implements cast-set.ll:test4 and test5 --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.106 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.107 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.106 Wed Jul 23 16:41:57 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Jul 24 12:35:25 2003 @@ -121,6 +121,13 @@ return &I; } + /// InsertOperandCastBefore - This inserts a cast of V to DestTy before the + /// InsertBefore instruction. This is specialized a bit to avoid inserting + /// casts that are known to not do anything... + /// + Value *InsertOperandCastBefore(Value *V, const Type *DestTy, + Instruction *InsertBefore); + // SimplifyCommutative - This performs a few simplifications for commutative // operators... bool SimplifyCommutative(BinaryOperator &I); @@ -307,6 +314,10 @@ return (CI->getRawValue() & ~(-1LL << NumBits)) == (1ULL << (NumBits-1)); } +static unsigned getTypeSizeInBits(const Type *Ty) { + return Ty == Type::BoolTy ? 1 : Ty->getPrimitiveSize()*8; +} + Instruction *InstCombiner::visitSub(BinaryOperator &I) { Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); @@ -935,12 +946,8 @@ // isEliminableCastOfCast - Return true if it is valid to eliminate the CI // instruction. // -static inline bool isEliminableCastOfCast(const CastInst &CI, - const CastInst *CSrc) { - assert(CI.getOperand(0) == CSrc); - const Type *SrcTy = CSrc->getOperand(0)->getType(); - const Type *MidTy = CSrc->getType(); - const Type *DstTy = CI.getType(); +static inline bool isEliminableCastOfCast(const Type *SrcTy, const Type *MidTy, + const Type *DstTy) { // It is legal to eliminate the instruction if casting A->B->A if the sizes // are identical and the bits don't get reinterpreted (for example @@ -1005,6 +1012,28 @@ return false; } +static bool ValueRequiresCast(const Value *V, const Type *Ty) { + if (V->getType() == Ty || isa(V)) return false; + if (const CastInst *CI = dyn_cast(V)) + if (isEliminableCastOfCast(CI->getOperand(0)->getType(), CI->getType(), Ty)) + return false; + return true; +} + +/// InsertOperandCastBefore - This inserts a cast of V to DestTy before the +/// InsertBefore instruction. This is specialized a bit to avoid inserting +/// casts that are known to not do anything... +/// +Value *InstCombiner::InsertOperandCastBefore(Value *V, const Type *DestTy, + Instruction *InsertBefore) { + if (V->getType() == DestTy) return V; + if (Constant *C = dyn_cast(V)) + return ConstantExpr::getCast(C, DestTy); + + CastInst *CI = new CastInst(V, DestTy, V->getName()); + InsertNewInstBefore(CI, *InsertBefore); + return CI; +} // CastInst simplification // @@ -1020,7 +1049,8 @@ // one! // if (CastInst *CSrc = dyn_cast(Src)) { - if (isEliminableCastOfCast(CI, CSrc)) { + if (isEliminableCastOfCast(CSrc->getOperand(0)->getType(), + CSrc->getType(), CI.getType())) { // This instruction now refers directly to the cast's src operand. This // has a good chance of making CSrc dead. CI.setOperand(0, CSrc->getOperand(0)); @@ -1119,6 +1149,53 @@ } } + // If the source value is an instruction with only this use, we can attempt to + // propagate the cast into the instruction. Also, only handle integral types + // for now. + if (Instruction *SrcI = dyn_cast(Src)) + if (SrcI->use_size() == 1 && Src->getType()->isIntegral() && + CI.getType()->isInteger()) { // Don't mess with casts to bool here + const Type *DestTy = CI.getType(); + unsigned SrcBitSize = getTypeSizeInBits(Src->getType()); + unsigned DestBitSize = getTypeSizeInBits(DestTy); + + Value *Op0 = SrcI->getNumOperands() > 0 ? SrcI->getOperand(0) : 0; + Value *Op1 = SrcI->getNumOperands() > 1 ? SrcI->getOperand(1) : 0; + + switch (SrcI->getOpcode()) { + case Instruction::Add: + case Instruction::Mul: + case Instruction::And: + case Instruction::Or: + case Instruction::Xor: + // If we are discarding information, or just changing the sign, rewrite. + if (DestBitSize <= SrcBitSize && DestBitSize != 1) { + // Don't insert two casts if they cannot be eliminated. We allow two + // casts to be inserted if the sizes are the same. This could only be + // converting signedness, which is a noop. + if (DestBitSize == SrcBitSize || !ValueRequiresCast(Op1, DestTy) || + !ValueRequiresCast(Op0, DestTy)) { + Value *Op0c = InsertOperandCastBefore(Op0, DestTy, SrcI); + Value *Op1c = InsertOperandCastBefore(Op1, DestTy, SrcI); + return BinaryOperator::create(cast(SrcI) + ->getOpcode(), Op0c, Op1c); + } + } + break; + case Instruction::Shl: + // Allow changing the sign of the source operand. Do not allow changing + // the size of the shift, UNLESS the shift amount is a constant. We + // mush not change variable sized shifts to a smaller size, because it + // is undefined to shift more bits out than exist in the value. + if (DestBitSize == SrcBitSize || + (DestBitSize < SrcBitSize && isa(Op1))) { + Value *Op0c = InsertOperandCastBefore(Op0, DestTy, SrcI); + return new ShiftInst(Instruction::Shl, Op0c, Op1); + } + break; + } + } + return 0; } From gaeke at cs.uiuc.edu Thu Jul 24 12:50:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jul 24 12:50:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/Printer.cpp Message-ID: <200307241749.MAA06832@neo.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: Printer.cpp updated: 1.48 -> 1.49 --- Log message: It doesn't appear that we need to #include these. --- Diffs of the changes: Index: llvm/lib/Target/X86/Printer.cpp diff -u llvm/lib/Target/X86/Printer.cpp:1.48 llvm/lib/Target/X86/Printer.cpp:1.49 --- llvm/lib/Target/X86/Printer.cpp:1.48 Thu Jul 24 12:30:45 2003 +++ llvm/lib/Target/X86/Printer.cpp Thu Jul 24 12:48:53 2003 @@ -15,13 +15,10 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineInstr.h" -#include "Support/Statistic.h" -#include "Support/hash_map" #include "llvm/Type.h" #include "llvm/Constants.h" #include "llvm/Assembly/Writer.h" #include "llvm/DerivedTypes.h" -#include "llvm/SlotCalculator.h" #include "Support/StringExtras.h" #include "llvm/Module.h" From lattner at cs.uiuc.edu Thu Jul 24 12:54:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jul 24 12:54:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200307241753.MAA24241@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.107 -> 1.108 --- Log message: Reorganization of code, no functional changes. Now it shoudl be a bit more efficient --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.107 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.108 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.107 Thu Jul 24 12:35:25 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Jul 24 12:52:58 2003 @@ -876,51 +876,10 @@ Op0 == Constant::getNullValue(Op0->getType())) return ReplaceInstUsesWith(I, Op0); - // If this is a shift of a shift, see if we can fold the two together... - if (ShiftInst *Op0SI = dyn_cast(Op0)) { - if (isa(Op1) && isa(Op0SI->getOperand(1))) { - ConstantUInt *ShiftAmt1C = cast(Op0SI->getOperand(1)); - unsigned ShiftAmt1 = ShiftAmt1C->getValue(); - unsigned ShiftAmt2 = cast(Op1)->getValue(); - - // Check for (A << c1) << c2 and (A >> c1) >> c2 - if (I.getOpcode() == Op0SI->getOpcode()) { - unsigned Amt = ShiftAmt1+ShiftAmt2; // Fold into one big shift... - return new ShiftInst(I.getOpcode(), Op0SI->getOperand(0), - ConstantUInt::get(Type::UByteTy, Amt)); - } - - if (I.getType()->isUnsigned()) { // Check for (A << c1) >> c2 or visaversa - // Calculate bitmask for what gets shifted off the edge... - Constant *C = ConstantIntegral::getAllOnesValue(I.getType()); - if (I.getOpcode() == Instruction::Shr) - C = ConstantExpr::getShift(Instruction::Shr, C, ShiftAmt1C); - else - C = ConstantExpr::getShift(Instruction::Shl, C, ShiftAmt1C); - - Instruction *Mask = - BinaryOperator::create(Instruction::And, Op0SI->getOperand(0), - C, Op0SI->getOperand(0)->getName()+".mask",&I); - WorkList.push_back(Mask); - - // Figure out what flavor of shift we should use... - if (ShiftAmt1 == ShiftAmt2) - return ReplaceInstUsesWith(I, Mask); // (A << c) >> c === A & c2 - else if (ShiftAmt1 < ShiftAmt2) { - return new ShiftInst(I.getOpcode(), Mask, - ConstantUInt::get(Type::UByteTy, ShiftAmt2-ShiftAmt1)); - } else { - return new ShiftInst(Op0SI->getOpcode(), Mask, - ConstantUInt::get(Type::UByteTy, ShiftAmt1-ShiftAmt2)); - } - } - } - } - - // shl uint X, 32 = 0 and shr ubyte Y, 9 = 0, ... just don't eliminate shr of - // a signed value. - // if (ConstantUInt *CUI = dyn_cast(Op1)) { + // shl uint X, 32 = 0 and shr ubyte Y, 9 = 0, ... just don't eliminate shr + // of a signed value. + // unsigned TypeBits = Op0->getType()->getPrimitiveSize()*8; if (CUI->getValue() >= TypeBits && (!Op0->getType()->isSigned() || I.getOpcode() == Instruction::Shl)) @@ -932,12 +891,54 @@ // Convert 'shl int %X, 1' to 'add int %X, %X' return BinaryOperator::create(Instruction::Add, Op0, Op0, I.getName()); + // If this is a shift of a shift, see if we can fold the two together... + if (ShiftInst *Op0SI = dyn_cast(Op0)) { + if (isa(Op1) && isa(Op0SI->getOperand(1))) { + ConstantUInt *ShiftAmt1C = cast(Op0SI->getOperand(1)); + unsigned ShiftAmt1 = ShiftAmt1C->getValue(); + unsigned ShiftAmt2 = CUI->getValue(); + + // Check for (A << c1) << c2 and (A >> c1) >> c2 + if (I.getOpcode() == Op0SI->getOpcode()) { + unsigned Amt = ShiftAmt1+ShiftAmt2; // Fold into one big shift... + return new ShiftInst(I.getOpcode(), Op0SI->getOperand(0), + ConstantUInt::get(Type::UByteTy, Amt)); + } + + // Check for (A << c1) >> c2 or visaversa + if (I.getType()->isUnsigned()) { + // Calculate bitmask for what gets shifted off the edge... + Constant *C = ConstantIntegral::getAllOnesValue(I.getType()); + if (I.getOpcode() == Instruction::Shr) + C = ConstantExpr::getShift(Instruction::Shr, C, ShiftAmt1C); + else + C = ConstantExpr::getShift(Instruction::Shl, C, ShiftAmt1C); + + Instruction *Mask = + BinaryOperator::create(Instruction::And, Op0SI->getOperand(0), + C, Op0SI->getOperand(0)->getName()+".mask"); + InsertNewInstBefore(Mask, I); + + // Figure out what flavor of shift we should use... + if (ShiftAmt1 == ShiftAmt2) + return ReplaceInstUsesWith(I, Mask); // (A << c) >> c === A & c2 + else if (ShiftAmt1 < ShiftAmt2) { + return new ShiftInst(I.getOpcode(), Mask, + ConstantUInt::get(Type::UByteTy, ShiftAmt2-ShiftAmt1)); + } else { + return new ShiftInst(Op0SI->getOpcode(), Mask, + ConstantUInt::get(Type::UByteTy, ShiftAmt1-ShiftAmt2)); + } + } + } + } } // shr int -1, X = -1 (for any arithmetic shift rights of ~0) - if (ConstantSInt *CSI = dyn_cast(Op0)) - if (I.getOpcode() == Instruction::Shr && CSI->isAllOnesValue()) - return ReplaceInstUsesWith(I, CSI); + if (I.getOpcode() == Instruction::Shr) + if (ConstantSInt *CSI = dyn_cast(Op0)) + if (CSI->isAllOnesValue()) + return ReplaceInstUsesWith(I, CSI); return 0; } From brukman at cs.uiuc.edu Thu Jul 24 13:18:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu Jul 24 13:18:01 2003 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/CodeGeneratorBug.cpp BugDriver.cpp BugDriver.h ExecutionDriver.cpp Miscompilation.cpp bugpoint.cpp Message-ID: <200307241817.NAA16660@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: CodeGeneratorBug.cpp added (r1.1) BugDriver.cpp updated: 1.7 -> 1.8 BugDriver.h updated: 1.8 -> 1.9 ExecutionDriver.cpp updated: 1.6 -> 1.7 Miscompilation.cpp updated: 1.9 -> 1.10 bugpoint.cpp updated: 1.2 -> 1.3 --- Log message: Major addition to bugpoint: ability to debug code generators (LLC and LLI). The C backend is assumed correct and is used to generate shared objects to be loaded by the other two code generators. LLC debugging should be functional now, LLI needs a few more additions to work, the major one is renaming of external functions to call the JIT lazy function resolver. Bugpoint now has a command-line switch -mode with options 'compile' and 'codegen' to debug appropriate portions of tools. ExecutionDriver.cpp: Added implementations of AbstractInterpreter for LLC and GCC, broke out common code within other tools, and added ability to generate C code with CBE individually, without executing the program, and the GCC tool can generate executables shared objects or executables. If no reference output is specified to Bugpoint, it will be generated with CBE, because it is already assumed to be correct for the purposes of debugging using this method. As a result, many functions now accept as an optional parameter a shared object to be loaded in, if specified. --- Diffs of the changes: Index: llvm/tools/bugpoint/CodeGeneratorBug.cpp diff -c /dev/null llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.1 *** /dev/null Thu Jul 24 13:17:54 2003 --- llvm/tools/bugpoint/CodeGeneratorBug.cpp Thu Jul 24 13:17:43 2003 *************** *** 0 **** --- 1,176 ---- + //===- CodeGeneratorBug.cpp - Debug code generation bugs ------------------===// + // + // This file implements program code generation debugging support. + // + //===----------------------------------------------------------------------===// + + #include "BugDriver.h" + #include "SystemUtils.h" + #include "ListReducer.h" + #include "llvm/Pass.h" + #include "llvm/Module.h" + #include "llvm/Transforms/Utils/Cloning.h" + #include "llvm/Transforms/Utils/Linker.h" + #include "Support/CommandLine.h" + #include "Support/Statistic.h" + #include "Support/StringExtras.h" + #include + #include + + // Passed as a command-line argument to Bugpoint + extern cl::opt Output; + + class ReduceMisCodegenFunctions : public ListReducer { + BugDriver &BD; + public: + ReduceMisCodegenFunctions(BugDriver &bd) : BD(bd) {} + + virtual TestResult doTest(std::vector &Prefix, + std::vector &Suffix) { + if (!Prefix.empty() && TestFuncs(Prefix)) + return KeepPrefix; + if (!Suffix.empty() && TestFuncs(Suffix)) + return KeepSuffix; + return NoFailure; + } + + bool TestFuncs(const std::vector &CodegenTest); + + void DisambiguateGlobalSymbols(Module *M); + }; + + + bool ReduceMisCodegenFunctions::TestFuncs(const std::vector &Funcs) + { + // Clone the module for the two halves of the program we want. + Module *SafeModule = CloneModule(BD.Program); + + // Make sure functions & globals are all external so that linkage + // between the two modules will work. + for (Module::iterator I = SafeModule->begin(), E = SafeModule->end();I!=E;++I) + I->setLinkage(GlobalValue::ExternalLinkage); + for (Module::giterator I=SafeModule->gbegin(),E = SafeModule->gend();I!=E;++I) + I->setLinkage(GlobalValue::ExternalLinkage); + + DisambiguateGlobalSymbols(SafeModule); + Module *TestModule = CloneModule(SafeModule); + + // Make sure global initializers exist only in the safe module (CBE->.so) + for (Module::giterator I=TestModule->gbegin(),E = TestModule->gend();I!=E;++I) + I->setInitializer(0); // Delete the initializer to make it external + + // Remove the Test functions from the Safe module, and + // all of the global variables. + for (unsigned i = 0, e = Funcs.size(); i != e; ++i) { + Function *TNOF = SafeModule->getFunction(Funcs[i]->getName(), + Funcs[i]->getFunctionType()); + assert(TNOF && "Function doesn't exist in module!"); + DeleteFunctionBody(TNOF); // Function is now external in this module! + } + + // Write out the bytecode to be sent to CBE + std::string SafeModuleBC = "bugpoint.safe.bc"; + if (BD.writeProgramToFile(SafeModuleBC, SafeModule)) { + std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting."; + exit(1); + } + + // Make a shared library + std::string SharedObject; + BD.compileSharedObject(SafeModuleBC, SharedObject); + + // Remove all functions from the Test module EXCEPT for the ones specified in + // Funcs. We know which ones these are because they are non-external in + // ToOptimize, but external in ToNotOptimize. + // + for (Module::iterator I = TestModule->begin(), E = TestModule->end();I!=E;++I) + if (!I->isExternal()) { + Function *TNOF = SafeModule->getFunction(I->getName(), + I->getFunctionType()); + assert(TNOF && "Function doesn't exist in ToNotOptimize module??"); + if (!TNOF->isExternal()) + DeleteFunctionBody(I); + } + + std::string TestModuleBC = "bugpoint.test.bc"; + if (BD.writeProgramToFile(TestModuleBC, TestModule)) { + std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting."; + exit(1); + } + + // Run the code generator on the `Test' code, loading the shared library. + // The function returns whether or not the new output differs from reference. + return BD.diffProgram(TestModuleBC, SharedObject, false); + } + + namespace { + struct Disambiguator /*: public unary_function*/ { + std::set SymbolNames; + std::set Symbols; + uint64_t uniqueCounter; + bool externalOnly; + + Disambiguator() : uniqueCounter(0), externalOnly(true) {} + void setExternalOnly(bool value) { externalOnly = value; } + void operator() (GlobalValue &V) { + if (externalOnly && !V.isExternal()) return; + + if (SymbolNames.count(V.getName()) == 0) { + DEBUG(std::cerr << "Disambiguator: adding " << V.getName() + << ", no conflicts.\n"); + Symbols.insert(&V); + SymbolNames.insert(V.getName()); + } else { + // Mangle name before adding + std::string newName; + do { + newName = V.getName() + "_" + utostr(uniqueCounter); + if (SymbolNames.count(newName) == 0) break; + else ++uniqueCounter; + } while (1); + //while (SymbolNames.count(V->getName()+utostr(uniqueCounter++))==0); + DEBUG(std::cerr << "Disambiguator: conflict: " << V.getName() + << ", adding: " << newName << "\n"); + V.setName(newName); + SymbolNames.insert(newName); + Symbols.insert(&V); + } + } + }; + } + + void ReduceMisCodegenFunctions::DisambiguateGlobalSymbols(Module *M) { + // First, try not to cause collisions by minimizing chances of renaming an + // already-external symbol, so take in external globals and functions as-is. + Disambiguator D = std::for_each(M->gbegin(), M->gend(), Disambiguator()); + std::for_each(M->begin(), M->end(), D); + + // Now just rename functions and globals as necessary, keeping what's already + // in the set unique. + D.setExternalOnly(false); + std::for_each(M->gbegin(), M->gend(), D); + std::for_each(M->begin(), M->end(), D); + } + + + bool BugDriver::debugCodeGenerator() { + // See if we can pin down which functions are being miscompiled... + //First, build a list of all of the non-external functions in the program. + std::vector MisCodegenFunctions; + for (Module::iterator I = Program->begin(), E = Program->end(); I != E; ++I) + if (!I->isExternal()) + MisCodegenFunctions.push_back(I); + + // Do the reduction... + ReduceMisCodegenFunctions(*this).reduceList(MisCodegenFunctions); + + std::cout << "\n*** The following functions are being miscompiled: "; + PrintFunctionList(MisCodegenFunctions); + std::cout << "\n"; + + // Output a bunch of bytecode files for the user... + ReduceMisCodegenFunctions(*this).TestFuncs(MisCodegenFunctions); + + return false; + } + Index: llvm/tools/bugpoint/BugDriver.cpp diff -u llvm/tools/bugpoint/BugDriver.cpp:1.7 llvm/tools/bugpoint/BugDriver.cpp:1.8 --- llvm/tools/bugpoint/BugDriver.cpp:1.7 Fri May 23 00:34:32 2003 +++ llvm/tools/bugpoint/BugDriver.cpp Thu Jul 24 13:17:43 2003 @@ -7,13 +7,36 @@ //===----------------------------------------------------------------------===// #include "BugDriver.h" +#include "SystemUtils.h" #include "llvm/Module.h" #include "llvm/Bytecode/Reader.h" #include "llvm/Assembly/Parser.h" #include "llvm/Transforms/Utils/Linker.h" #include "llvm/Pass.h" +#include "Support/CommandLine.h" #include +// Anonymous namespace to define command line options for debugging. +// +namespace { + // Output - The user can specify a file containing the expected output of the + // program. If this filename is set, it is used as the reference diff source, + // otherwise the raw input run through an interpreter is used as the reference + // source. + // + cl::opt + OutputFile("output", cl::desc("Specify a reference program output " + "(for miscompilation detection)")); + + enum DebugType { DebugCompile, DebugCodegen }; + cl::opt + DebugMode("mode", cl::desc("Debug mode for bugpoint:"), cl::Prefix, + cl::values(clEnumValN(DebugCompile, "compile", " Compilation"), + clEnumValN(DebugCodegen, "codegen", " Code generation"), + 0), + cl::init(DebugCompile)); +} + /// getPassesString - Turn a list of passes into a string which indicates the /// command line options that must be passed to add the passes. /// @@ -41,6 +64,11 @@ assert(F->isExternal() && "This didn't make the function external!"); } +BugDriver::BugDriver(const char *toolname) + : ToolName(toolname), ReferenceOutputFile(OutputFile), + Program(0), Interpreter(0) {} + + /// ParseInputFile - Given a bytecode or assembly input filename, parse and /// return it, or return null if not possible. /// @@ -108,6 +136,44 @@ std::cout << "Running selected passes on program to test for crash: "; if (runPasses(PassesToRun)) return debugCrash(); - else - return debugMiscompilation(); + + std::cout << "Checking for a miscompilation...\n"; + + // Set up the execution environment, selecting a method to run LLVM bytecode. + if (initializeExecutionEnvironment()) return true; + + // Run the raw input to see where we are coming from. If a reference output + // was specified, make sure that the raw output matches it. If not, it's a + // problem in the front-end or the code generator. + // + bool CreatedOutput = false, Result; + if (ReferenceOutputFile.empty()) { + std::cout << "Generating reference output from raw program..."; + if (DebugCodegen) { + ReferenceOutputFile = executeProgramWithCBE("bugpoint.reference.out"); + } else { + ReferenceOutputFile = executeProgram("bugpoint.reference.out"); + } + CreatedOutput = true; + std::cout << "Reference output is: " << ReferenceOutputFile << "\n"; + } + + if (DebugMode == DebugCompile) { + std::cout << "\n*** Debugging miscompilation!\n"; + Result = debugMiscompilation(); + } else if (DebugMode == DebugCodegen) { + std::cout << "Debugging code generator problem!\n"; + Result = debugCodeGenerator(); + } + + if (CreatedOutput) removeFile(ReferenceOutputFile); + return Result; +} + +void BugDriver::PrintFunctionList(const std::vector &Funcs) +{ + for (unsigned i = 0, e = Funcs.size(); i != e; ++i) { + if (i) std::cout << ", "; + std::cout << Funcs[i]->getName(); + } } Index: llvm/tools/bugpoint/BugDriver.h diff -u llvm/tools/bugpoint/BugDriver.h:1.8 llvm/tools/bugpoint/BugDriver.h:1.9 --- llvm/tools/bugpoint/BugDriver.h:1.8 Thu Apr 24 18:51:38 2003 +++ llvm/tools/bugpoint/BugDriver.h Thu Jul 24 13:17:43 2003 @@ -9,8 +9,10 @@ #ifndef BUGDRIVER_H #define BUGDRIVER_H +#include "Support/CommandLine.h" #include #include + class PassInfo; class Module; class Function; @@ -25,6 +27,7 @@ class BugDriver { const std::string ToolName; // Name of bugpoint + cl::opt ReferenceOutputFile; // Name of `good' output file Module *Program; // The raw program, linked together std::vector PassesToRun; AbstractInterpreter *Interpreter; // How to run the program @@ -33,11 +36,12 @@ friend class DebugCrashes; friend class ReduceMiscompilingPasses; friend class ReduceMiscompilingFunctions; + friend class ReduceMisCodegenFunctions; friend class ReduceCrashingFunctions; friend class ReduceCrashingBlocks; + public: - BugDriver(const char *toolname) - : ToolName(toolname), Program(0), Interpreter(0) {} + BugDriver(const char *toolname); const std::string &getToolName() const { return ToolName; } @@ -73,6 +77,17 @@ bool debugPassMiscompilation(const PassInfo *ThePass, const std::string &ReferenceOutput); + + /// compileSharedObject - This method creates a SharedObject from a given + /// BytecodeFile for debugging a code generator. + int compileSharedObject(const std::string &BytecodeFile, + std::string &SharedObject); + + /// debugCodeGenerator - This method narrows down a module to a function or + /// set of functions, using the CBE as a ``safe'' code generator for other + /// functions that are not under consideration. + bool debugCodeGenerator(); + private: /// ParseInputFile - Given a bytecode or assembly input filename, parse and /// return it, or return null if not possible. @@ -112,6 +127,9 @@ return runPasses(PassesToRun, Filename, DeleteOutput); } + /// PrintFunctionList - prints out list of problematic functions + static void PrintFunctionList(const std::vector &Funcs); + /// deleteInstructionFromProgram - This method clones the current Program and /// deletes the specified instruction from the cloned module. It then runs a /// series of cleanup passes (ADCE and SimplifyCFG) to eliminate any code @@ -135,14 +153,22 @@ /// filename may be optionally specified. /// std::string executeProgram(std::string RequestedOutputFilename = "", - std::string Bytecode = ""); + std::string Bytecode = "", + std::string SharedObject = "", + AbstractInterpreter *AI = 0); + + /// executeProgramWithCBE - Used to create reference output with the C + /// backend, if reference output is not provided. + std::string executeProgramWithCBE(std::string RequestedOutputFilename = "", + std::string Bytecode = "", + std::string SharedObject = ""); /// diffProgram - This method executes the specified module and diffs the /// output against the file specified by ReferenceOutputFile. If the output /// is different, true is returned. /// - bool diffProgram(const std::string &ReferenceOutputFile, - const std::string &BytecodeFile = "", + bool diffProgram(const std::string &BytecodeFile = "", + const std::string &SharedObject = "", bool RemoveBytecode = false); }; Index: llvm/tools/bugpoint/ExecutionDriver.cpp diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.6 llvm/tools/bugpoint/ExecutionDriver.cpp:1.7 --- llvm/tools/bugpoint/ExecutionDriver.cpp:1.6 Fri May 2 22:20:36 2003 +++ llvm/tools/bugpoint/ExecutionDriver.cpp Thu Jul 24 13:17:43 2003 @@ -11,7 +11,7 @@ 1. Bugpoint should not leave any files behind if the program works properly 2. There should be an option to specify the program name, which specifies a unique string to put into output files. This allows operation in the - SingleSource directory f.e. Default to the first input filename. + SingleSource directory, e.g. default to the first input filename. */ #include "BugDriver.h" @@ -29,11 +29,11 @@ }; cl::opt InterpreterSel(cl::desc("Specify how LLVM code should be executed:"), - cl::values(clEnumValN(RunLLI, "run-lli", "Execute with LLI"), - clEnumValN(RunJIT, "run-jit", "Execute with JIT"), - clEnumValN(RunLLC, "run-llc", "Compile with LLC"), - clEnumValN(RunCBE, "run-cbe", "Compile with CBE"), - 0)); + cl::values(clEnumValN(RunLLI, "run-lli", "Execute with LLI"), + clEnumValN(RunJIT, "run-jit", "Execute with JIT"), + clEnumValN(RunLLC, "run-llc", "Compile with LLC"), + clEnumValN(RunCBE, "run-cbe", "Compile with CBE"), + 0)); cl::opt InputFile("input", cl::init("/dev/null"), @@ -52,8 +52,8 @@ /// specified filename. This returns the exit code of the program. /// virtual int ExecuteProgram(const std::string &Bytecode, - const std::string &OutputFile) = 0; - + const std::string &OutputFile, + const std::string &SharedLib = "") = 0; }; @@ -73,29 +73,240 @@ return new LLI(LLIPath); } - Message = "Cannot find 'lli' in bugpoint executable directory or PATH!\n"; + Message = "Cannot find `lli' in bugpoint executable directory or PATH!\n"; return 0; } virtual int ExecuteProgram(const std::string &Bytecode, - const std::string &OutputFile); + const std::string &OutputFile, + const std::string &SharedLib = ""); }; int LLI::ExecuteProgram(const std::string &Bytecode, - const std::string &OutputFile) { + const std::string &OutputFile, + const std::string &SharedLib) { + if (SharedLib != "") { + std::cerr << "LLI currently does not support loading shared libraries.\n" + << "Exiting.\n"; + exit(1); + } + const char *Args[] = { - "lli", + LLIPath.c_str(), "-abort-on-exception", "-quiet", "-force-interpreter=true", Bytecode.c_str(), 0 }; - + return RunProgramWithTimeout(LLIPath, Args, - InputFile, OutputFile, OutputFile); + InputFile, OutputFile, OutputFile); } //===----------------------------------------------------------------------===// +// GCC Implementation of AbstractIntepreter interface +// +// This is not a *real* AbstractInterpreter as it does not accept bytecode +// files, but only input acceptable to GCC, i.e. C, C++, and assembly files +// +class GCC : public AbstractInterpreter { + std::string GCCPath; // The path to the gcc executable +public: + GCC(const std::string &gccPath) : GCCPath(gccPath) { } + + // GCC create method - Try to find the `gcc' executable + static GCC *create(BugDriver *BD, std::string &Message) { + std::string GCCPath = FindExecutable("gcc", BD->getToolName()); + if (GCCPath.empty()) { + Message = "Cannot find `gcc' in bugpoint executable directory or PATH!\n"; + return 0; + } + + Message = "Found gcc: " + GCCPath + "\n"; + return new GCC(GCCPath); + } + + virtual int ExecuteProgram(const std::string &ProgramFile, + const std::string &OutputFile, + const std::string &SharedLib = ""); + + int MakeSharedObject(const std::string &InputFile, + std::string &OutputFile); + + void ProcessFailure(const char **Args); +}; + +int GCC::ExecuteProgram(const std::string &ProgramFile, + const std::string &OutputFile, + const std::string &SharedLib) { + std::string OutputBinary = "bugpoint.gcc.exe"; + const char **GCCArgs; + + const char *ArgsWithoutSO[] = { + GCCPath.c_str(), + ProgramFile.c_str(), // Specify the input filename... + "-o", OutputBinary.c_str(), // Output to the right filename... + "-lm", // Hard-code the math library... + "-O2", // Optimize the program a bit... + 0 + }; + const char *ArgsWithSO[] = { + GCCPath.c_str(), + ProgramFile.c_str(), // Specify the input filename... + SharedLib.c_str(), // Specify the shared library to link in... + "-o", OutputBinary.c_str(), // Output to the right filename... + "-lm", // Hard-code the math library... + "-O2", // Optimize the program a bit... + 0 + }; + + GCCArgs = (SharedLib == "") ? ArgsWithoutSO : ArgsWithSO; + std::cout << ""; + if (RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", + "/dev/null", "/dev/null")) { + ProcessFailure(GCCArgs); + exit(1); // Leave stuff around for the user to inspect or debug the CBE + } + + const char *ProgramArgs[] = { + OutputBinary.c_str(), + 0 + }; + + std::cout << ""; + + // Now that we have a binary, run it! + int ProgramResult = RunProgramWithTimeout(OutputBinary, ProgramArgs, + InputFile, OutputFile, OutputFile); + std::cout << "\n"; + removeFile(OutputBinary); + return ProgramResult; +} + +int GCC::MakeSharedObject(const std::string &InputFile, + std::string &OutputFile) { + OutputFile = "./bugpoint.so"; + // Compile the C/asm file into a shared object + const char* GCCArgs[] = { + GCCPath.c_str(), + InputFile.c_str(), // Specify the input filename... +#if defined(sparc) || defined(__sparc__) || defined(__sparcv9) + "-G", // Compile a shared library, `-G' for Sparc +#else + "-shared", // `-shared' for Linux/X86, maybe others +#endif + "-o", OutputFile.c_str(), // Output to the right filename... + "-O2", // Optimize the program a bit... + 0 + }; + + std::cout << ""; + if(RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", "/dev/null", + "/dev/null")) { + ProcessFailure(GCCArgs); + exit(1); + } + return 0; +} + +void GCC::ProcessFailure(const char** GCCArgs) { + std::cerr << "\n*** bugpoint error: invocation of the C compiler failed!\n"; + for (const char **Arg = GCCArgs; *Arg; ++Arg) + std::cerr << " " << *Arg; + std::cerr << "\n"; + + // Rerun the compiler, capturing any error messages to print them. + std::string ErrorFilename = getUniqueFilename("bugpoint.gcc.errors"); + RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", ErrorFilename.c_str(), + ErrorFilename.c_str()); + + // Print out the error messages generated by GCC if possible... + std::ifstream ErrorFile(ErrorFilename.c_str()); + if (ErrorFile) { + std::copy(std::istreambuf_iterator(ErrorFile), + std::istreambuf_iterator(), + std::ostreambuf_iterator(std::cerr)); + ErrorFile.close(); + std::cerr << "\n"; + } + + removeFile(ErrorFilename); +} + +//===----------------------------------------------------------------------===// +// LLC Implementation of AbstractIntepreter interface +// +class LLC : public AbstractInterpreter { + std::string LLCPath; // The path to the LLC executable + GCC *gcc; +public: + LLC(const std::string &llcPath, GCC *Gcc) + : LLCPath(llcPath), gcc(Gcc) { } + ~LLC() { delete gcc; } + + // LLC create method - Try to find the LLC executable + static LLC *create(BugDriver *BD, std::string &Message) { + std::string LLCPath = FindExecutable("llc", BD->getToolName()); + if (LLCPath.empty()) { + Message = "Cannot find `llc' in bugpoint executable directory or PATH!\n"; + return 0; + } + + Message = "Found llc: " + LLCPath + "\n"; + GCC *gcc = GCC::create(BD, Message); + return new LLC(LLCPath, gcc); + } + + virtual int ExecuteProgram(const std::string &Bytecode, + const std::string &OutputFile, + const std::string &SharedLib = ""); + + int OutputAsm(const std::string &Bytecode, + std::string &OutputAsmFile); + +}; + +int LLC::OutputAsm(const std::string &Bytecode, + std::string &OutputAsmFile) { + OutputAsmFile = "bugpoint.llc.s"; + const char *LLCArgs[] = { + LLCPath.c_str(), + "-o", OutputAsmFile.c_str(), // Output to the Asm file + "-f", // Overwrite as necessary... + Bytecode.c_str(), // This is the input bytecode + 0 + }; + + std::cout << ""; + if (RunProgramWithTimeout(LLCPath, LLCArgs, "/dev/null", "/dev/null", + "/dev/null")) { + // If LLC failed on the bytecode, print error... + std::cerr << "bugpoint error: `llc' failed!\n"; + removeFile(OutputAsmFile); + return 1; + } + + return 0; +} + +int LLC::ExecuteProgram(const std::string &Bytecode, + const std::string &OutputFile, + const std::string &SharedLib) { + + std::string OutputAsmFile; + if (OutputAsm(Bytecode, OutputAsmFile)) { + std::cerr << "Could not generate asm code with `llc', exiting.\n"; + exit(1); + } + + // Assuming LLC worked, compile the result with GCC and run it. + int Result = gcc->ExecuteProgram(OutputAsmFile, OutputFile, SharedLib); + removeFile(OutputAsmFile); + return Result; +} + + +//===----------------------------------------------------------------------===// // JIT Implementation of AbstractIntepreter interface // class JIT : public AbstractInterpreter { @@ -111,25 +322,35 @@ return new JIT(LLIPath); } - Message = "Cannot find 'lli' in bugpoint executable directory or PATH!\n"; + Message = "Cannot find `lli' in bugpoint executable directory or PATH!\n"; return 0; } virtual int ExecuteProgram(const std::string &Bytecode, - const std::string &OutputFile); + const std::string &OutputFile, + const std::string &SharedLib = ""); }; int JIT::ExecuteProgram(const std::string &Bytecode, - const std::string &OutputFile) { - const char *Args[] = { - "-lli", - "-quiet", - "-force-interpreter=false", - Bytecode.c_str(), - 0 - }; - - return RunProgramWithTimeout(LLIPath, Args, - InputFile, OutputFile, OutputFile); + const std::string &OutputFile, + const std::string &SharedLib) { + if (SharedLib == "") { + const char* Args[] = { + LLIPath.c_str(), "-quiet", "-force-interpreter=false", Bytecode.c_str(), + 0 + }; + return RunProgramWithTimeout(LLIPath, Args, + InputFile, OutputFile, OutputFile); + } else { + std::string SharedLibOpt = "-load=" + SharedLib; + const char* Args[] = { + LLIPath.c_str(), "-quiet", "-force-interpreter=false", + SharedLibOpt.c_str(), + Bytecode.c_str(), + 0 + }; + return RunProgramWithTimeout(LLIPath, Args, + InputFile, OutputFile, OutputFile); + } } //===----------------------------------------------------------------------===// @@ -137,37 +358,39 @@ // class CBE : public AbstractInterpreter { std::string DISPath; // The path to the LLVM 'dis' executable - std::string GCCPath; // The path to the gcc executable + GCC *gcc; public: - CBE(const std::string &disPath, const std::string &gccPath) - : DISPath(disPath), GCCPath(gccPath) { } + CBE(const std::string &disPath, GCC *Gcc) : DISPath(disPath), gcc(Gcc) { } + ~CBE() { delete gcc; } // CBE create method - Try to find the 'dis' executable static CBE *create(BugDriver *BD, std::string &Message) { std::string DISPath = FindExecutable("dis", BD->getToolName()); if (DISPath.empty()) { - Message = "Cannot find 'dis' in bugpoint executable directory or PATH!\n"; + Message = "Cannot find `dis' in bugpoint executable directory or PATH!\n"; return 0; } Message = "Found dis: " + DISPath + "\n"; - std::string GCCPath = FindExecutable("gcc", BD->getToolName()); - if (GCCPath.empty()) { - Message = "Cannot find 'gcc' in bugpoint executable directory or PATH!\n"; - return 0; - } - - Message += "Found gcc: " + GCCPath + "\n"; - return new CBE(DISPath, GCCPath); + GCC *gcc = GCC::create(BD, Message); + return new CBE(DISPath, gcc); } + virtual int ExecuteProgram(const std::string &Bytecode, - const std::string &OutputFile); + const std::string &OutputFile, + const std::string &SharedLib = ""); + + // Sometimes we just want to go half-way and only generate the C file, + // not necessarily compile it with GCC and run the program + virtual int OutputC(const std::string &Bytecode, + std::string &OutputCFile); + }; -int CBE::ExecuteProgram(const std::string &Bytecode, - const std::string &OutputFile) { - std::string OutputCFile = getUniqueFilename("bugpoint.cbe.c"); +int CBE::OutputC(const std::string &Bytecode, + std::string &OutputCFile) { + OutputCFile = "bugpoint.cbe.c"; const char *DisArgs[] = { DISPath.c_str(), "-o", OutputCFile.c_str(), // Output to the C file @@ -181,74 +404,30 @@ if (RunProgramWithTimeout(DISPath, DisArgs, "/dev/null", "/dev/null", "/dev/null")) { // If dis failed on the bytecode, print error... - std::cerr << "bugpoint error: dis -c failed!?\n"; - removeFile(OutputCFile); + std::cerr << "bugpoint error: `dis -c' failed!\n"; return 1; } - // Assuming the c backend worked, compile the result with GCC... - std::string OutputBinary = getUniqueFilename("bugpoint.cbe.exe"); - const char *GCCArgs[] = { - GCCPath.c_str(), - "-x", "c", // Force recognition as a C file - "-o", OutputBinary.c_str(), // Output to the right filename... - OutputCFile.c_str(), // Specify the input filename... - "-O2", // Optimize the program a bit... - 0 - }; - - // FIXME: Eventually the CC program and arguments for it should be settable on - // the bugpoint command line! - - std::cout << ""; + return 0; +} - // Run the C compiler on the output of the C backend... - if (RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", "/dev/null", - "/dev/null")) { - std::cerr << "\n*** bugpoint error: invocation of the C compiler " - "failed on CBE result!\n"; - for (const char **Arg = DisArgs; *Arg; ++Arg) - std::cerr << " " << *Arg; - std::cerr << "\n"; - for (const char **Arg = GCCArgs; *Arg; ++Arg) - std::cerr << " " << *Arg; - std::cerr << "\n"; - - // Rerun the compiler, capturing any error messages to print them. - std::string ErrorFilename = getUniqueFilename("bugpoint.cbe.errors"); - RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", ErrorFilename.c_str(), - ErrorFilename.c_str()); - - // Print out the error messages generated by GCC if possible... - std::ifstream ErrorFile(ErrorFilename.c_str()); - if (ErrorFile) { - std::copy(std::istreambuf_iterator(ErrorFile), - std::istreambuf_iterator(), - std::ostreambuf_iterator(std::cerr)); - ErrorFile.close(); - std::cerr << "\n"; - } - removeFile(ErrorFilename); - exit(1); // Leave stuff around for the user to inspect or debug the CBE +int CBE::ExecuteProgram(const std::string &Bytecode, + const std::string &OutputFile, + const std::string &SharedLib) { + std::string OutputCFile; + if (OutputC(Bytecode, OutputCFile)) { + std::cerr << "Could not generate C code with `dis', exiting.\n"; + exit(1); } - const char *ProgramArgs[] = { - OutputBinary.c_str(), - 0 - }; - - std::cout << ""; - - // Now that we have a binary, run it! - int Result = RunProgramWithTimeout(OutputBinary, ProgramArgs, - InputFile, OutputFile, OutputFile); - std::cout << " "; + int Result = gcc->ExecuteProgram(OutputCFile, OutputFile, SharedLib); removeFile(OutputCFile); - removeFile(OutputBinary); + return Result; } + //===----------------------------------------------------------------------===// // BugDriver method implementation // @@ -267,6 +446,7 @@ std::string Message; switch (InterpreterSel) { case RunLLI: Interpreter = LLI::create(this, Message); break; + case RunLLC: Interpreter = LLC::create(this, Message); break; case RunJIT: Interpreter = JIT::create(this, Message); break; case RunCBE: Interpreter = CBE::create(this, Message); break; default: @@ -286,8 +466,10 @@ /// filename may be optionally specified. /// std::string BugDriver::executeProgram(std::string OutputFile, - std::string BytecodeFile) { - assert(Interpreter && "Interpreter should have been created already!"); + std::string BytecodeFile, + std::string SharedObject, + AbstractInterpreter *AI) { + assert((Interpreter || AI) &&"Interpreter should have been created already!"); bool CreatedBytecode = false; if (BytecodeFile.empty()) { // Emit the program to a bytecode file... @@ -295,42 +477,85 @@ if (writeProgramToFile(BytecodeFile, Program)) { std::cerr << ToolName << ": Error emitting bytecode to file '" - << BytecodeFile << "'!\n"; + << BytecodeFile << "'!\n"; exit(1); } CreatedBytecode = true; } if (OutputFile.empty()) OutputFile = "bugpoint-execution-output"; - + // Check to see if this is a valid output filename... OutputFile = getUniqueFilename(OutputFile); // Actually execute the program! - int RetVal = Interpreter->ExecuteProgram(BytecodeFile, OutputFile); + int RetVal = (AI != 0) ? + AI->ExecuteProgram(BytecodeFile, OutputFile, SharedObject) : + Interpreter->ExecuteProgram(BytecodeFile, OutputFile, SharedObject); // Remove the temporary bytecode file. - if (CreatedBytecode) - removeFile(BytecodeFile); + if (CreatedBytecode) removeFile(BytecodeFile); // Return the filename we captured the output to. return OutputFile; } +std::string BugDriver::executeProgramWithCBE(std::string OutputFile, + std::string BytecodeFile, + std::string SharedObject) { + std::string Output; + CBE *cbe = CBE::create(this, Output); + Output = executeProgram(OutputFile, BytecodeFile, SharedObject, cbe); + delete cbe; + return Output; +} + +int BugDriver::compileSharedObject(const std::string &BytecodeFile, + std::string &SharedObject) { + assert(Interpreter && "Interpreter should have been created already!"); + std::string Message, OutputCFile; + + // Using CBE + CBE *cbe = CBE::create(this, Message); + cbe->OutputC(BytecodeFile, OutputCFile); + +#if 0 /* This is an alternative, as yet unimplemented */ + // Using LLC + LLC *llc = LLC::create(this, Message); + if (llc->OutputAsm(BytecodeFile, OutputFile)) { + std::cerr << "Could not generate asm code with `llc', exiting.\n"; + exit(1); + } +#endif + + GCC *gcc = GCC::create(this, Message); + gcc->MakeSharedObject(OutputCFile, SharedObject); + + // Remove the intermediate C file + removeFile(OutputCFile); + + // We are done with the CBE & GCC + delete cbe; + delete gcc; + + return 0; +} + + /// diffProgram - This method executes the specified module and diffs the output /// against the file specified by ReferenceOutputFile. If the output is /// different, true is returned. /// -bool BugDriver::diffProgram(const std::string &ReferenceOutputFile, - const std::string &BytecodeFile, +bool BugDriver::diffProgram(const std::string &BytecodeFile, + const std::string &SharedObject, bool RemoveBytecode) { // Execute the program, generating an output file... - std::string Output = executeProgram("", BytecodeFile); + std::string Output = executeProgram("", BytecodeFile, SharedObject); std::ifstream ReferenceFile(ReferenceOutputFile.c_str()); if (!ReferenceFile) { std::cerr << "Couldn't open reference output file '" - << ReferenceOutputFile << "'\n"; + << ReferenceOutputFile << "'\n"; exit(1); } Index: llvm/tools/bugpoint/Miscompilation.cpp diff -u llvm/tools/bugpoint/Miscompilation.cpp:1.9 llvm/tools/bugpoint/Miscompilation.cpp:1.10 --- llvm/tools/bugpoint/Miscompilation.cpp:1.9 Mon Jul 14 12:16:01 2003 +++ llvm/tools/bugpoint/Miscompilation.cpp Thu Jul 24 13:17:43 2003 @@ -11,21 +11,6 @@ #include "llvm/Module.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Transforms/Utils/Linker.h" -#include "Support/CommandLine.h" - -// Anonymous namespace to define command line options for miscompilation -// debugging. -// -namespace { - // Output - The user can specify a file containing the expected output of the - // program. If this filename is set, it is used as the reference diff source, - // otherwise the raw input run through an interpreter is used as the reference - // source. - // - cl::opt - Output("output", cl::desc("Specify a reference program output " - "(for miscompilation detection)")); -} class ReduceMiscompilingPasses : public ListReducer { BugDriver &BD; @@ -33,7 +18,7 @@ ReduceMiscompilingPasses(BugDriver &bd) : BD(bd) {} virtual TestResult doTest(std::vector &Prefix, - std::vector &Kept); + std::vector &Suffix); }; ReduceMiscompilingPasses::TestResult @@ -52,7 +37,7 @@ } // Check to see if the finished program matches the reference output... - if (BD.diffProgram(Output, BytecodeResult, true /*delete bytecode*/)) { + if (BD.diffProgram(BytecodeResult, "", true /*delete bytecode*/)) { std::cout << "nope.\n"; return KeepSuffix; // Miscompilation detected! } @@ -78,7 +63,7 @@ } // If the prefix maintains the predicate by itself, only keep the prefix! - if (BD.diffProgram(Output, BytecodeResult)) { + if (BD.diffProgram(BytecodeResult)) { std::cout << "nope.\n"; removeFile(BytecodeResult); return KeepPrefix; @@ -109,7 +94,7 @@ } // Run the result... - if (BD.diffProgram(Output, BytecodeResult, true/*delete bytecode*/)) { + if (BD.diffProgram(BytecodeResult, "", true/*delete bytecode*/)) { std::cout << "nope.\n"; delete OriginalInput; // We pruned down the original input... return KeepSuffix; @@ -122,14 +107,6 @@ return NoFailure; } -static void PrintFunctionList(const std::vector &Funcs) { - for (unsigned i = 0, e = Funcs.size(); i != e; ++i) { - if (i) std::cout << ", "; - std::cout << Funcs[i]->getName(); - } -} - - class ReduceMiscompilingFunctions : public ListReducer { BugDriver &BD; public: @@ -154,7 +131,7 @@ if (!EmitBytecode) { std::cout << "Checking to see if the program is misoptimized when these " << "functions are run\nthrough the passes: "; - PrintFunctionList(Funcs); + BD.PrintFunctionList(Funcs); std::cout << "\n"; } else { std::cout <<"Outputting reduced bytecode files which expose the problem:\n"; @@ -269,7 +246,7 @@ // Eighth step: Execute the program. If it does not match the expected // output, then 'Funcs' are being misoptimized! - bool Broken = BD.diffProgram(Output); + bool Broken = BD.diffProgram(); delete BD.Program; // Delete the hacked up program BD.Program = OldProgram; // Restore the original @@ -284,24 +261,10 @@ /// input. /// bool BugDriver::debugMiscompilation() { - std::cout << "*** Debugging miscompilation!\n"; - - // Set up the execution environment, selecting a method to run LLVM bytecode. - if (initializeExecutionEnvironment()) return true; - // Run the raw input to see where we are coming from. If a reference output - // was specified, make sure that the raw output matches it. If not, it's a - // problem in the front-end or whatever produced the input code. - // - bool CreatedOutput = false; - if (Output.empty()) { - std::cout << "Generating reference output from raw program..."; - Output = executeProgram("bugpoint.reference.out"); - CreatedOutput = true; - std::cout << " done! Reference output is: " << Output << "\n"; - } else if (diffProgram(Output)) { + if (diffProgram()) { std::cout << "\n*** Input program does not match reference diff!\n" - << " Must be problem with input source!\n"; + << " Must be problem with input source!\n"; return false; // Problem found } @@ -321,7 +284,6 @@ << getPassesString(PassesToRun) << "\n"; EmitProgressBytecode("passinput"); - // Okay, now that we have reduced the list of passes which are causing the // failure, see if we can pin down which functions are being // miscompiled... first build a list of all of the non-external functions in @@ -341,6 +303,5 @@ // Output a bunch of bytecode files for the user... ReduceMiscompilingFunctions(*this).TestFuncs(MiscompiledFunctions, true); - if (CreatedOutput) removeFile(Output); return false; } Index: llvm/tools/bugpoint/bugpoint.cpp diff -u llvm/tools/bugpoint/bugpoint.cpp:1.2 llvm/tools/bugpoint/bugpoint.cpp:1.3 --- llvm/tools/bugpoint/bugpoint.cpp:1.2 Fri May 2 22:18:41 2003 +++ llvm/tools/bugpoint/bugpoint.cpp Thu Jul 24 13:17:43 2003 @@ -18,7 +18,7 @@ // PassNameParser. // static cl::list -PassList(cl::desc("Passes available:"), cl::OneOrMore); +PassList(cl::desc("Passes available:"), cl::ZeroOrMore); //cl::list //InputArgv(cl::ConsumeAfter, cl::desc("...")); @@ -26,7 +26,6 @@ int main(int argc, char **argv) { cl::ParseCommandLineOptions(argc, argv); - BugDriver D(argv[0]); if (D.addSources(InputFilenames)) return 1; D.addPasses(PassList.begin(), PassList.end()); From lattner at cs.uiuc.edu Thu Jul 24 13:39:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jul 24 13:39:04 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/shift.ll Message-ID: <200307241838.NAA25805@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: shift.ll updated: 1.9 -> 1.10 --- Log message: New testcases for signed shifts --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/shift.ll diff -u llvm/test/Regression/Transforms/InstCombine/shift.ll:1.9 llvm/test/Regression/Transforms/InstCombine/shift.ll:1.10 --- llvm/test/Regression/Transforms/InstCombine/shift.ll:1.9 Sat Jun 28 18:31:56 2003 +++ llvm/test/Regression/Transforms/InstCombine/shift.ll Thu Jul 24 13:38:09 2003 @@ -63,9 +63,20 @@ ret ubyte %C } -ubyte %test11(ubyte %A) { ;; (A >> 3) << 4 == (A & 0x1F) << 1 +ubyte %test11(ubyte %A) { ;; (A >> 3) << 4 === (A & 0x1F) << 1 %B = shr ubyte %A, ubyte 3 %C = shl ubyte %B, ubyte 4 ret ubyte %C } +int %test12(int %A) { + %B = shr int %A, ubyte 8 ;; (A >> 8) << 8 === A & -256 + %C = shl int %B, ubyte 8 + ret int %C +} + +sbyte %test13(sbyte %A) { ;; (A >> 3) << 4 === (A & -8) * 2 + %B = shr sbyte %A, ubyte 3 + %C = shl sbyte %B, ubyte 4 + ret sbyte %C +} From lattner at cs.uiuc.edu Thu Jul 24 13:40:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jul 24 13:40:03 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200307241839.NAA25815@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.108 -> 1.109 --- Log message: Instcombine: (A >> c1) << c2 for signed integers --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.108 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.109 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.108 Thu Jul 24 12:52:58 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Jul 24 13:38:56 2003 @@ -885,16 +885,10 @@ (!Op0->getType()->isSigned() || I.getOpcode() == Instruction::Shl)) return ReplaceInstUsesWith(I, Constant::getNullValue(Op0->getType())); - // Check to see if we are shifting left by 1. If so, turn it into an add - // instruction. - if (I.getOpcode() == Instruction::Shl && CUI->equalsInt(1)) - // Convert 'shl int %X, 1' to 'add int %X, %X' - return BinaryOperator::create(Instruction::Add, Op0, Op0, I.getName()); - // If this is a shift of a shift, see if we can fold the two together... if (ShiftInst *Op0SI = dyn_cast(Op0)) { - if (isa(Op1) && isa(Op0SI->getOperand(1))) { - ConstantUInt *ShiftAmt1C = cast(Op0SI->getOperand(1)); + if (ConstantUInt *ShiftAmt1C = + dyn_cast(Op0SI->getOperand(1))) { unsigned ShiftAmt1 = ShiftAmt1C->getValue(); unsigned ShiftAmt2 = CUI->getValue(); @@ -905,8 +899,10 @@ ConstantUInt::get(Type::UByteTy, Amt)); } - // Check for (A << c1) >> c2 or visaversa - if (I.getType()->isUnsigned()) { + // Check for (A << c1) >> c2 or visaversa. If we are dealing with + // signed types, we can only support the (A >> c1) << c2 configuration, + // because it can not turn an arbitrary bit of A into a sign bit. + if (I.getType()->isUnsigned() || I.getOpcode() == Instruction::Shl) { // Calculate bitmask for what gets shifted off the edge... Constant *C = ConstantIntegral::getAllOnesValue(I.getType()); if (I.getOpcode() == Instruction::Shr) @@ -932,6 +928,12 @@ } } } + + // Check to see if we are shifting left by 1. If so, turn it into an add + // instruction. + if (I.getOpcode() == Instruction::Shl && CUI->equalsInt(1)) + // Convert 'shl int %X, 1' to 'add int %X, %X' + return BinaryOperator::create(Instruction::Add, Op0, Op0, I.getName()); } // shr int -1, X = -1 (for any arithmetic shift rights of ~0) From lattner at cs.uiuc.edu Thu Jul 24 14:32:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jul 24 14:32:02 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/or.ll Message-ID: <200307241931.OAA26040@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: or.ll updated: 1.23 -> 1.24 --- Log message: New testcase --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/or.ll diff -u llvm/test/Regression/Transforms/InstCombine/or.ll:1.23 llvm/test/Regression/Transforms/InstCombine/or.ll:1.24 --- llvm/test/Regression/Transforms/InstCombine/or.ll:1.23 Wed Jul 23 16:11:56 2003 +++ llvm/test/Regression/Transforms/InstCombine/or.ll Thu Jul 24 14:31:08 2003 @@ -86,3 +86,10 @@ ret uint %C } +bool %test14(uint %A, uint %B) { + %C1 = setlt uint %A, %B + %C2 = setgt uint %A, %B + %D = or bool %C1, %C2 ; (A < B) | (A > B) === A != B + ret bool %D +} + From lattner at cs.uiuc.edu Thu Jul 24 14:43:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jul 24 14:43:02 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/setcc-strength-reduce.ll Message-ID: <200307241942.OAA26261@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: setcc-strength-reduce.ll updated: 1.4 -> 1.5 --- Log message: Modernize testcase --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/setcc-strength-reduce.ll diff -u llvm/test/Regression/Transforms/InstCombine/setcc-strength-reduce.ll:1.4 llvm/test/Regression/Transforms/InstCombine/setcc-strength-reduce.ll:1.5 --- llvm/test/Regression/Transforms/InstCombine/setcc-strength-reduce.ll:1.4 Sat Jun 28 18:31:56 2003 +++ llvm/test/Regression/Transforms/InstCombine/setcc-strength-reduce.ll Thu Jul 24 14:42:28 2003 @@ -5,17 +5,17 @@ ; RUN: as < %s | opt -instcombine | dis | grep -v seteq | grep -v setne | not grep set -bool "test1"(uint %A) { +bool %test1(uint %A) { %B = setge uint %A, 1 ; setne %A, 0 ret bool %B } -bool "test2"(uint %A) { +bool %test2(uint %A) { %B = setgt uint %A, 0 ; setne %A, 0 ret bool %B } -bool "test3"(sbyte %A) { +bool %test3(sbyte %A) { %B = setge sbyte %A, -127 ; setne %A, -128 ret bool %B } From lattner at cs.uiuc.edu Thu Jul 24 14:46:05 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jul 24 14:46:05 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/add.ll and.ll or.ll Message-ID: <200307241945.OAA26416@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: add.ll updated: 1.10 -> 1.11 and.ll updated: 1.13 -> 1.14 or.ll updated: 1.24 -> 1.25 --- Log message: More testcases, which I'll implement later --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/add.ll diff -u llvm/test/Regression/Transforms/InstCombine/add.ll:1.10 llvm/test/Regression/Transforms/InstCombine/add.ll:1.11 --- llvm/test/Regression/Transforms/InstCombine/add.ll:1.10 Sat Jun 28 18:31:56 2003 +++ llvm/test/Regression/Transforms/InstCombine/add.ll Thu Jul 24 14:44:51 2003 @@ -55,3 +55,8 @@ ret int %C } +int %test9(int %A) { + %B = shl int %A, ubyte 4 + %C = add int %B, %B ; === shl int %A, 5 + ret int %C +} Index: llvm/test/Regression/Transforms/InstCombine/and.ll diff -u llvm/test/Regression/Transforms/InstCombine/and.ll:1.13 llvm/test/Regression/Transforms/InstCombine/and.ll:1.14 --- llvm/test/Regression/Transforms/InstCombine/and.ll:1.13 Wed Jul 23 14:35:51 2003 +++ llvm/test/Regression/Transforms/InstCombine/and.ll Thu Jul 24 14:44:51 2003 @@ -74,4 +74,17 @@ ret uint %D } +bool %test12(uint %A, uint %B) { + %C1 = setlt uint %A, %B + %C2 = setle uint %A, %B + %D = and bool %C1, %C2 ; (A < B) & (A <= B) === (A < B) + ret bool %D +} + +bool %test13(uint %A, uint %B) { + %C1 = setlt uint %A, %B + %C2 = setgt uint %A, %B + %D = and bool %C1, %C2 ; (A < B) & (A > B) === false + ret bool %D +} Index: llvm/test/Regression/Transforms/InstCombine/or.ll diff -u llvm/test/Regression/Transforms/InstCombine/or.ll:1.24 llvm/test/Regression/Transforms/InstCombine/or.ll:1.25 --- llvm/test/Regression/Transforms/InstCombine/or.ll:1.24 Thu Jul 24 14:31:08 2003 +++ llvm/test/Regression/Transforms/InstCombine/or.ll Thu Jul 24 14:44:51 2003 @@ -93,3 +93,10 @@ ret bool %D } +bool %test15(uint %A, uint %B) { + %C1 = setlt uint %A, %B + %C2 = seteq uint %A, %B + %D = or bool %C1, %C2 ; (A < B) | (A == B) === A <= B + ret bool %D +} + From gaeke at cs.uiuc.edu Thu Jul 24 15:22:00 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jul 24 15:22:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/Mangler.cpp Message-ID: <200307242021.PAA27609@neo.cs.uiuc.edu> Changes in directory llvm/lib/Support: Mangler.cpp added (r1.1) --- Log message: Factor out name-mangling from X86/Printer, which is derived from CWriter, into this new support class. --- Diffs of the changes: Index: llvm/lib/Support/Mangler.cpp diff -c /dev/null llvm/lib/Support/Mangler.cpp:1.1 *** /dev/null Thu Jul 24 15:21:35 2003 --- llvm/lib/Support/Mangler.cpp Thu Jul 24 15:20:25 2003 *************** *** 0 **** --- 1,83 ---- + //===-- Mangler.cpp - Self-contained c/asm llvm name mangler --------------===// + // + // Unified name mangler for CWriter and assembly backends. + // + //===----------------------------------------------------------------------===// + + #include + #include + #include + #include "llvm/Value.h" + #include "llvm/Module.h" + #include "llvm/Type.h" + #include "Support/StringExtras.h" + #include "llvm/Support/Mangler.h" + + /// makeNameProper - We don't want identifier names with ., space, or + /// - in them, so we mangle these characters into the strings "d_", + /// "s_", and "D_", respectively. + /// + std::string Mangler::makeNameProper(std::string x) { + std::string tmp; + for (std::string::iterator sI = x.begin(), sEnd = x.end(); sI != sEnd; sI++) + switch (*sI) { + case '.': tmp += "d_"; break; + case ' ': tmp += "s_"; break; + case '-': tmp += "D_"; break; + default: tmp += *sI; + } + return tmp; + } + + std::string Mangler::getValueName(const Value *V) { + // Check to see whether we've already named V. + ValueMap::iterator VI = Memo.find(V); + if (VI != Memo.end()) { + return VI->second; // Return the old name for V. + } + + std::string name; + if (V->hasName()) { // Print out the label if it exists... + // Name mangling occurs as follows: + // - If V is not a global, mangling always occurs. + // - Otherwise, mangling occurs when any of the following are true: + // 1) V has internal linkage + // 2) V's name would collide if it is not mangled. + // + const GlobalValue* gv = dyn_cast(V); + if(gv && !gv->hasInternalLinkage() && !MangledGlobals.count(gv)) { + name = makeNameProper(gv->getName()); + } else { + // Non-global, or global with internal linkage / colliding name + // -> mangle. + name = "l" + utostr(V->getType()->getUniqueID()) + "_" + + makeNameProper(V->getName()); + } + } else { + name = "ltmp_" + itostr(Count++) + "_" + + utostr(V->getType()->getUniqueID()); + } + Memo[V] = name; + return name; + } + + Mangler::Mangler(Module &_M) : M(_M) + { + // Calculate which global values have names that will collide when we throw + // away type information. + std::set FoundNames; + for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) + if (I->hasName()) // If the global has a name... + if (FoundNames.count(I->getName())) // And the name is already used + MangledGlobals.insert(I); // Mangle the name + else + FoundNames.insert(I->getName()); // Otherwise, keep track of name + + for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I) + if (I->hasName()) // If the global has a name... + if (FoundNames.count(I->getName())) // And the name is already used + MangledGlobals.insert(I); // Mangle the name + else + FoundNames.insert(I->getName()); // Otherwise, keep track of name + } + From gaeke at cs.uiuc.edu Thu Jul 24 15:22:11 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jul 24 15:22:11 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/Printer.cpp Message-ID: <200307242021.PAA27604@neo.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: Printer.cpp updated: 1.49 -> 1.50 --- Log message: Use unified CWriter-X86/Printer name mangler. Do not bother using SlotCalculator in CWriter. (Unfortunately, all this means a lot of X86/Printer's methods have to be de-constified again. Oh well.) --- Diffs of the changes: Index: llvm/lib/Target/X86/Printer.cpp diff -u llvm/lib/Target/X86/Printer.cpp:1.49 llvm/lib/Target/X86/Printer.cpp:1.50 --- llvm/lib/Target/X86/Printer.cpp:1.49 Thu Jul 24 12:48:53 2003 +++ llvm/lib/Target/X86/Printer.cpp Thu Jul 24 15:20:44 2003 @@ -21,14 +21,9 @@ #include "llvm/DerivedTypes.h" #include "Support/StringExtras.h" #include "llvm/Module.h" +#include "llvm/Support/Mangler.h" namespace { - /// This is properly part of the name mangler; it keeps track of - /// which global values have had their names mangled. It is cleared - /// at the end of every module by doFinalization(). - /// - std::set MangledGlobals; - struct Printer : public MachineFunctionPass { /// Output stream on which we're printing assembly code. /// @@ -39,6 +34,10 @@ /// TargetMachine &TM; + /// Name-mangler for global names. + /// + Mangler *Mang; + Printer(std::ostream &o, TargetMachine &tm) : O(o), TM(tm) { } /// We name each basic block in a Function with a unique number, so @@ -58,18 +57,18 @@ return "X86 Assembly Printer"; } - void printMachineInstruction(const MachineInstr *MI) const; + void printMachineInstruction(const MachineInstr *MI); void printOp(const MachineOperand &MO, - bool elideOffsetKeyword = false) const; - void printMemReference(const MachineInstr *MI, unsigned Op) const; - void printConstantPool(MachineConstantPool *MCP) const; + bool elideOffsetKeyword = false); + void printMemReference(const MachineInstr *MI, unsigned Op); + void printConstantPool(MachineConstantPool *MCP); bool runOnMachineFunction(MachineFunction &F); - std::string ConstantExprToString(const ConstantExpr* CE) const; - std::string valToExprString(const Value* V) const; + std::string ConstantExprToString(const ConstantExpr* CE); + std::string valToExprString(const Value* V); bool doInitialization(Module &M); bool doFinalization(Module &M); - void printConstantValueOnly(const Constant* CV, int numPadBytesAfter = 0) const; - void printSingleConstantValue(const Constant* CV) const; + void printConstantValueOnly(const Constant* CV, int numPadBytesAfter = 0); + void printSingleConstantValue(const Constant* CV); }; } // end of anonymous namespace @@ -82,49 +81,10 @@ return new Printer(o, tm); } -/// makeNameProper - We don't want identifier names with ., space, or -/// - in them, so we mangle these characters into the strings "d_", -/// "s_", and "D_", respectively. -/// -static std::string makeNameProper(std::string x) { - std::string tmp; - for (std::string::iterator sI = x.begin(), sEnd = x.end(); sI != sEnd; sI++) - switch (*sI) { - case '.': tmp += "d_"; break; - case ' ': tmp += "s_"; break; - case '-': tmp += "D_"; break; - default: tmp += *sI; - } - return tmp; -} - -static std::string getValueName(const Value *V) { - if (V->hasName()) { // Print out the label if it exists... - // Name mangling occurs as follows: - // - If V is not a global, mangling always occurs. - // - Otherwise, mangling occurs when any of the following are true: - // 1) V has internal linkage - // 2) V's name would collide if it is not mangled. - // - if(const GlobalValue* gv = dyn_cast(V)) { - if(!gv->hasInternalLinkage() && !MangledGlobals.count(gv)) { - // No internal linkage, name will not collide -> no mangling. - return makeNameProper(gv->getName()); - } - } - // Non-global, or global with internal linkage / colliding name -> mangle. - return "l" + utostr(V->getType()->getUniqueID()) + "_" + - makeNameProper(V->getName()); - } - static int Count = 0; - Count++; - return "ltmp_" + itostr(Count) + "_" + utostr(V->getType()->getUniqueID()); -} - /// valToExprString - Helper function for ConstantExprToString(). /// Appends result to argument string S. /// -std::string Printer::valToExprString(const Value* V) const { +std::string Printer::valToExprString(const Value* V) { std::string S; bool failed = false; if (const Constant* CV = dyn_cast(V)) { // symbolic or known @@ -145,7 +105,7 @@ else failed = true; } else if (const GlobalValue* GV = dyn_cast(V)) { - S += getValueName(GV); + S += Mang->getValueName(GV); } else failed = true; @@ -160,7 +120,7 @@ /// ConstantExprToString - Convert a ConstantExpr to an asm expression /// and return this as a string. /// -std::string Printer::ConstantExprToString(const ConstantExpr* CE) const { +std::string Printer::ConstantExprToString(const ConstantExpr* CE) { std::string S; const TargetData &TD = TM.getTargetData(); switch(CE->getOpcode()) { @@ -207,7 +167,7 @@ /// printSingleConstantValue - Print a single constant value. /// void -Printer::printSingleConstantValue(const Constant* CV) const +Printer::printSingleConstantValue(const Constant* CV) { assert(CV->getType() != Type::VoidTy && CV->getType() != Type::TypeTy && @@ -284,7 +244,7 @@ { // This is a constant address for a global variable or method. // Use the name of the variable or method as the address value. - O << getValueName(CPR->getValue()) << "\n"; + O << Mang->getValueName(CPR->getValue()) << "\n"; } else if (isa(CV)) { @@ -362,7 +322,7 @@ // Uses printSingleConstantValue() to print each individual value. void Printer::printConstantValueOnly(const Constant* CV, - int numPadBytesAfter /* = 0 */) const + int numPadBytesAfter /* = 0 */) { const ConstantArray *CVA = dyn_cast(CV); const TargetData &TD = TM.getTargetData(); @@ -422,7 +382,7 @@ /// used to print out constants which have been "spilled to memory" by /// the code generator. /// -void Printer::printConstantPool(MachineConstantPool *MCP) const { +void Printer::printConstantPool(MachineConstantPool *MCP) { const std::vector &CP = MCP->getConstants(); const TargetData &TD = TM.getTargetData(); @@ -447,7 +407,7 @@ static unsigned BBNumber = 0; // What's my mangled name? - CurrentFnName = getValueName(MF.getFunction()); + CurrentFnName = Mang->getValueName(MF.getFunction()); // Print out constants referenced by the function printConstantPool(MF.getConstantPool()); @@ -500,7 +460,7 @@ } void Printer::printOp(const MachineOperand &MO, - bool elideOffsetKeyword /* = false */) const { + bool elideOffsetKeyword /* = false */) { const MRegisterInfo &RI = *TM.getRegisterInfo(); switch (MO.getType()) { case MachineOperand::MO_VirtualRegister: @@ -529,7 +489,7 @@ } return; case MachineOperand::MO_GlobalAddress: - if (!elideOffsetKeyword) O << "OFFSET "; O << getValueName(MO.getGlobal()); + if (!elideOffsetKeyword) O << "OFFSET "; O << Mang->getValueName(MO.getGlobal()); return; case MachineOperand::MO_ExternalSymbol: O << MO.getSymbolName(); @@ -552,7 +512,7 @@ } } -void Printer::printMemReference(const MachineInstr *MI, unsigned Op) const { +void Printer::printMemReference(const MachineInstr *MI, unsigned Op) { const MRegisterInfo &RI = *TM.getRegisterInfo(); assert(isMem(MI, Op) && "Invalid memory reference!"); @@ -607,7 +567,7 @@ /// printMachineInstruction -- Print out a single X86 LLVM instruction /// MI in Intel syntax to the current output stream. /// -void Printer::printMachineInstruction(const MachineInstr *MI) const { +void Printer::printMachineInstruction(const MachineInstr *MI) { unsigned Opcode = MI->getOpcode(); const TargetInstrInfo &TII = TM.getInstrInfo(); const TargetInstrDescriptor &Desc = TII.get(Opcode); @@ -957,27 +917,7 @@ // Tell gas we are outputting Intel syntax (not AT&T syntax) assembly, // with no % decorations on register names. O << "\t.intel_syntax noprefix\n"; - - // Ripped from CWriter: - // Calculate which global values have names that will collide when we throw - // away type information. - { // Scope to delete the FoundNames set when we are done with it... - std::set FoundNames; - for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (I->hasName()) // If the global has a name... - if (FoundNames.count(I->getName())) // And the name is already used - MangledGlobals.insert(I); // Mangle the name - else - FoundNames.insert(I->getName()); // Otherwise, keep track of name - - for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I) - if (I->hasName()) // If the global has a name... - if (FoundNames.count(I->getName())) // And the name is already used - MangledGlobals.insert(I); // Mangle the name - else - FoundNames.insert(I->getName()); // Otherwise, keep track of name - } - + Mang = new Mangler(M); return false; // success } @@ -993,7 +933,7 @@ const TargetData &TD = TM.getTargetData(); // Print out module-level global variables here. for (Module::const_giterator I = M.gbegin(), E = M.gend(); I != E; ++I) { - std::string name(getValueName(I)); + std::string name(Mang->getValueName(I)); if (I->hasInitializer()) { Constant *C = I->getInitializer(); O << "\t.data\n"; @@ -1021,6 +961,6 @@ << (unsigned)TD.getTypeAlignment(I->getType()) << "\n"; } } - MangledGlobals.clear(); + delete Mang; return false; // success } From gaeke at cs.uiuc.edu Thu Jul 24 15:22:21 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jul 24 15:22:21 2003 Subject: [llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp Message-ID: <200307242021.PAA27599@neo.cs.uiuc.edu> Changes in directory llvm/lib/CWriter: Writer.cpp updated: 1.109 -> 1.110 --- Log message: Use unified CWriter-X86/Printer name mangler. Do not bother using SlotCalculator in CWriter. (Unfortunately, all this means a lot of X86/Printer's methods have to be de-constified again. Oh well.) --- Diffs of the changes: Index: llvm/lib/CWriter/Writer.cpp diff -u llvm/lib/CWriter/Writer.cpp:1.109 llvm/lib/CWriter/Writer.cpp:1.110 --- llvm/lib/CWriter/Writer.cpp:1.109 Wed Jul 23 15:45:31 2003 +++ llvm/lib/CWriter/Writer.cpp Thu Jul 24 15:20:10 2003 @@ -23,11 +23,12 @@ #include #include #include +#include "llvm/Support/Mangler.h" namespace { class CWriter : public Pass, public InstVisitor { std::ostream &Out; - SlotCalculator *Table; + Mangler *Mang; const Module *TheModule; std::map TypeNames; std::set MangledGlobals; @@ -44,17 +45,17 @@ virtual bool run(Module &M) { // Initialize - Table = new SlotCalculator(&M, false); TheModule = &M; // Ensure that all structure types have names... bool Changed = nameAllUsedStructureTypes(M); + Mang = new Mangler(M); // Run... printModule(&M); // Free memory... - delete Table; + delete Mang; TypeNames.clear(); MangledGlobals.clear(); return false; @@ -67,8 +68,6 @@ void writeOperand(Value *Operand); void writeOperandInternal(Value *Operand); - std::string getValueName(const Value *V); - private : bool nameAllUsedStructureTypes(Module &M); void printModule(Module *M); @@ -143,7 +142,7 @@ } void outputLValue(Instruction *I) { - Out << " " << getValueName(I) << " = "; + Out << " " << Mang->getValueName(I) << " = "; } void printBranchToBlock(BasicBlock *CurBlock, BasicBlock *SuccBlock, unsigned Indent); @@ -152,48 +151,6 @@ }; } -// We dont want identifier names with ., space, - in them. -// So we replace them with _ -static std::string makeNameProper(std::string x) { - std::string tmp; - for (std::string::iterator sI = x.begin(), sEnd = x.end(); sI != sEnd; sI++) - switch (*sI) { - case '.': tmp += "d_"; break; - case ' ': tmp += "s_"; break; - case '-': tmp += "D_"; break; - default: tmp += *sI; - } - - return tmp; -} - -std::string CWriter::getValueName(const Value *V) { - if (V->hasName()) { // Print out the label if it exists... - - // Name mangling occurs as follows: - // - If V is not a global, mangling always occurs. - // - Otherwise, mangling occurs when any of the following are true: - // 1) V has internal linkage - // 2) V's name would collide if it is not mangled. - // - - if(const GlobalValue* gv = dyn_cast(V)) { - if(!gv->hasInternalLinkage() && !MangledGlobals.count(gv)) { - // No internal linkage, name will not collide -> no mangling. - return makeNameProper(gv->getName()); - } - } - - // Non-global, or global with internal linkage / colliding name -> mangle. - return "l" + utostr(V->getType()->getUniqueID()) + "_" + - makeNameProper(V->getName()); - } - - int Slot = Table->getValSlot(V); - assert(Slot >= 0 && "Invalid value!"); - return "ltmp_" + itostr(Slot) + "_" + utostr(V->getType()->getUniqueID()); -} - // A pointer type should not use parens around *'s alone, e.g., (**) inline bool ptrTypeNameNeedsParens(const std::string &NameSoFar) { return (NameSoFar.find_last_not_of('*') != std::string::npos); @@ -523,14 +480,10 @@ return; } - if (Operand->hasName()) { - Out << getValueName(Operand); - } else if (Constant *CPV = dyn_cast(Operand)) { + if (Constant *CPV = dyn_cast(Operand)) { printConstant(CPV); } else { - int Slot = Table->getValSlot(Operand); - assert(Slot >= 0 && "Malformed LLVM!"); - Out << "ltmp_" << Slot << "_" << Operand->getType()->getUniqueID(); + Out << Mang->getValueName(Operand); } } @@ -650,7 +603,7 @@ for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I) { if (I->hasExternalLinkage()) { Out << "extern "; - printType(Out, I->getType()->getElementType(), getValueName(I)); + printType(Out, I->getType()->getElementType(), Mang->getValueName(I)); Out << ";\n"; } } @@ -684,7 +637,7 @@ for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I) if (!I->isExternal()) { Out << "extern "; - printType(Out, I->getType()->getElementType(), getValueName(I)); + printType(Out, I->getType()->getElementType(), Mang->getValueName(I)); Out << ";\n"; } @@ -697,7 +650,7 @@ if (!I->isExternal()) { if (I->hasInternalLinkage()) Out << "static "; - printType(Out, I->getType()->getElementType(), getValueName(I)); + printType(Out, I->getType()->getElementType(), Mang->getValueName(I)); if (I->hasLinkOnceLinkage()) Out << " __attribute__((common))"; if (!I->getInitializer()->isNullValue()) { @@ -742,7 +695,7 @@ Out << "/* Structure forward decls */\n"; for (; I != End; ++I) if (const Type *STy = dyn_cast(I->second)) { - std::string Name = "struct l_" + makeNameProper(I->first); + std::string Name = "struct l_" + Mangler::makeNameProper(I->first); Out << Name << ";\n"; TypeNames.insert(std::make_pair(STy, Name)); } @@ -753,7 +706,7 @@ Out << "/* Typedefs */\n"; for (I = ST.type_begin(Type::TypeTy); I != End; ++I) { const Type *Ty = cast(I->second); - std::string Name = "l_" + makeNameProper(I->first); + std::string Name = "l_" + Mangler::makeNameProper(I->first); Out << "typedef "; printType(Out, Ty, Name); Out << ";\n"; @@ -808,7 +761,7 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) { // If the program provides its own malloc prototype we don't need // to include the general one. - if (getValueName(F) == "malloc") + if (Mang->getValueName(F) == "malloc") needsMalloc = false; if (F->hasInternalLinkage()) Out << "static "; @@ -820,19 +773,19 @@ std::stringstream FunctionInnards; // Print out the name... - FunctionInnards << getValueName(F) << "("; + FunctionInnards << Mang->getValueName(F) << "("; if (!F->isExternal()) { if (!F->aempty()) { std::string ArgName; if (F->abegin()->hasName() || !Prototype) - ArgName = getValueName(F->abegin()); + ArgName = Mang->getValueName(F->abegin()); printType(FunctionInnards, F->afront().getType(), ArgName); for (Function::const_aiterator I = ++F->abegin(), E = F->aend(); I != E; ++I) { FunctionInnards << ", "; if (I->hasName() || !Prototype) - ArgName = getValueName(I); + ArgName = Mang->getValueName(I); else ArgName = ""; printType(FunctionInnards, I->getType(), ArgName); @@ -863,8 +816,6 @@ void CWriter::printFunction(Function *F) { if (F->isExternal()) return; - Table->incorporateFunction(F); - printFunctionSignature(F, false); Out << " {\n"; @@ -872,16 +823,16 @@ for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) if (const AllocaInst *AI = isDirectAlloca(*I)) { Out << " "; - printType(Out, AI->getAllocatedType(), getValueName(AI)); + printType(Out, AI->getAllocatedType(), Mang->getValueName(AI)); Out << "; /* Address exposed local */\n"; } else if ((*I)->getType() != Type::VoidTy && !isInlinableInst(**I)) { Out << " "; - printType(Out, (*I)->getType(), getValueName(*I)); + printType(Out, (*I)->getType(), Mang->getValueName(*I)); Out << ";\n"; if (isa(*I)) { // Print out PHI node temporaries as well... Out << " "; - printType(Out, (*I)->getType(), getValueName(*I)+"__PHI_TEMPORARY"); + printType(Out, (*I)->getType(), Mang->getValueName(*I)+"__PHI_TEMPORARY"); Out << ";\n"; } } @@ -936,7 +887,7 @@ break; } - if (NeedsLabel) Out << getValueName(BB) << ":\n"; + if (NeedsLabel) Out << Mang->getValueName(BB) << ":\n"; // Output all of the instructions in the basic block... for (BasicBlock::iterator II = BB->begin(), E = --BB->end(); II != E; ++II){ @@ -955,7 +906,6 @@ } Out << "}\n\n"; - Table->purgeFunction(); FPConstantMap.clear(); } @@ -1031,7 +981,7 @@ PHINode *PN = dyn_cast(I); ++I) { // now we have to do the printing Out << std::string(Indent, ' '); - Out << " " << getValueName(I) << "__PHI_TEMPORARY = "; + Out << " " << Mang->getValueName(I) << "__PHI_TEMPORARY = "; writeOperand(PN->getIncomingValue(PN->getBasicBlockIndex(CurBB))); Out << "; /* for PHI node */\n"; } From gaeke at cs.uiuc.edu Thu Jul 24 15:22:31 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jul 24 15:22:31 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Mangler.h Message-ID: <200307242021.PAA27568@neo.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Mangler.h added (r1.1) --- Log message: Factor out name-mangling from X86/Printer, which is derived from CWriter, into this new support class. --- Diffs of the changes: Index: llvm/include/llvm/Support/Mangler.h diff -c /dev/null llvm/include/llvm/Support/Mangler.h:1.1 *** /dev/null Thu Jul 24 15:21:09 2003 --- llvm/include/llvm/Support/Mangler.h Thu Jul 24 15:20:58 2003 *************** *** 0 **** --- 1,45 ---- + //===-- Mangler.h - Self-contained c/asm llvm name mangler ----------------===// + // + // Unified name mangler for CWriter and assembly backends. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_SUPPORT_MANGLER_H + #define LLVM_SUPPORT_MANGLER_H + + class Value; + #include + + class Mangler { + public: + /// getValueName - Returns the mangled name of V, an LLVM Value, + /// in the current module. + /// + std::string getValueName(const Value *V); + + Mangler(Module &_M); + + /// makeNameProper - We don't want identifier names with ., space, or + /// - in them, so we mangle these characters into the strings "d_", + /// "s_", and "D_", respectively. This is a very simple mangling that + /// doesn't guarantee unique names for values. getValueName already + /// does this for you, so there's no point calling it on the result + /// from getValueName. + /// + static std::string makeNameProper(std::string x); + + private: + /// This keeps track of which global values have had their names + /// mangled in the current module. + /// + std::set MangledGlobals; + + Module &M; + + typedef std::map ValueMap; + ValueMap Memo; + + long long Count; + }; + + #endif // LLVM_SUPPORT_MANGLER_H From gaeke at cs.uiuc.edu Thu Jul 24 16:39:02 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jul 24 16:39:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/Mangler.cpp Message-ID: <200307242138.QAA20425@neo.cs.uiuc.edu> Changes in directory llvm/lib/Support: Mangler.cpp updated: 1.1 -> 1.2 --- Log message: Cleanups: Mangler.cpp: Constify parameter to makeNameProper, and use const_iterator. Make Count an unsigned int, and use utostr(). Don't name parameters things that start with underscore. Mangler.h: All of the above, and also: Add Emacs mode-line. Include . --- Diffs of the changes: Index: llvm/lib/Support/Mangler.cpp diff -u llvm/lib/Support/Mangler.cpp:1.1 llvm/lib/Support/Mangler.cpp:1.2 --- llvm/lib/Support/Mangler.cpp:1.1 Thu Jul 24 15:20:25 2003 +++ llvm/lib/Support/Mangler.cpp Thu Jul 24 16:37:57 2003 @@ -17,9 +17,10 @@ /// - in them, so we mangle these characters into the strings "d_", /// "s_", and "D_", respectively. /// -std::string Mangler::makeNameProper(std::string x) { +std::string Mangler::makeNameProper(const std::string &x) { std::string tmp; - for (std::string::iterator sI = x.begin(), sEnd = x.end(); sI != sEnd; sI++) + for (std::string::const_iterator sI = x.begin(), sEnd = x.end(); + sI != sEnd; sI++) switch (*sI) { case '.': tmp += "d_"; break; case ' ': tmp += "s_"; break; @@ -54,14 +55,14 @@ makeNameProper(V->getName()); } } else { - name = "ltmp_" + itostr(Count++) + "_" + name = "ltmp_" + utostr(Count++) + "_" + utostr(V->getType()->getUniqueID()); } Memo[V] = name; return name; } -Mangler::Mangler(Module &_M) : M(_M) +Mangler::Mangler(Module &M_) : M(M_) { // Calculate which global values have names that will collide when we throw // away type information. From gaeke at cs.uiuc.edu Thu Jul 24 16:39:13 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jul 24 16:39:13 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Mangler.h Message-ID: <200307242138.QAA20418@neo.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Mangler.h updated: 1.1 -> 1.2 --- Log message: Cleanups: Mangler.cpp: Constify parameter to makeNameProper, and use const_iterator. Make Count an unsigned int, and use utostr(). Don't name parameters things that start with underscore. Mangler.h: All of the above, and also: Add Emacs mode-line. Include . --- Diffs of the changes: Index: llvm/include/llvm/Support/Mangler.h diff -u llvm/include/llvm/Support/Mangler.h:1.1 llvm/include/llvm/Support/Mangler.h:1.2 --- llvm/include/llvm/Support/Mangler.h:1.1 Thu Jul 24 15:20:58 2003 +++ llvm/include/llvm/Support/Mangler.h Thu Jul 24 16:37:54 2003 @@ -1,4 +1,4 @@ -//===-- Mangler.h - Self-contained c/asm llvm name mangler ----------------===// +//===-- Mangler.h - Self-contained c/asm llvm name mangler -*- C++ -*- ----===// // // Unified name mangler for CWriter and assembly backends. // @@ -9,6 +9,7 @@ class Value; #include +#include class Mangler { public: @@ -17,7 +18,7 @@ /// std::string getValueName(const Value *V); - Mangler(Module &_M); + Mangler(Module &M_); /// makeNameProper - We don't want identifier names with ., space, or /// - in them, so we mangle these characters into the strings "d_", @@ -26,7 +27,7 @@ /// does this for you, so there's no point calling it on the result /// from getValueName. /// - static std::string makeNameProper(std::string x); + static std::string makeNameProper(const std::string &x); private: /// This keeps track of which global values have had their names @@ -39,7 +40,7 @@ typedef std::map ValueMap; ValueMap Memo; - long long Count; + unsigned int Count; }; #endif // LLVM_SUPPORT_MANGLER_H From brukman at cs.uiuc.edu Thu Jul 24 17:00:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu Jul 24 17:00:01 2003 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.cpp BugDriver.h CodeGeneratorBug.cpp ExecutionDriver.cpp Message-ID: <200307242159.QAA20983@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: BugDriver.cpp updated: 1.8 -> 1.9 BugDriver.h updated: 1.9 -> 1.10 CodeGeneratorBug.cpp updated: 1.1 -> 1.2 ExecutionDriver.cpp updated: 1.7 -> 1.8 --- Log message: Made a bunch of cleanups, as per Chris' recommendations: * Removed unused global and member variables * Fixed comments (CodeGeneratorBug.cpp) * Check for possibly failing GCC::create() and CBE::create() * Remove generated files after diffing the output (e.g., shared object) * Instead of using std::for_each, use explicit loops as std::for_each may duplicate the functor, and ours carries state * Changed member var from cl::opt to just std::string * Fixed doxygen comments * Fixed string comparisons to use [ str.empty() ] instead of [ str == "" ] * Cache instances of CBE and GCC in BugDriver across compilations and executions while testing tools. --- Diffs of the changes: Index: llvm/tools/bugpoint/BugDriver.cpp diff -u llvm/tools/bugpoint/BugDriver.cpp:1.8 llvm/tools/bugpoint/BugDriver.cpp:1.9 --- llvm/tools/bugpoint/BugDriver.cpp:1.8 Thu Jul 24 13:17:43 2003 +++ llvm/tools/bugpoint/BugDriver.cpp Thu Jul 24 16:59:10 2003 @@ -66,7 +66,7 @@ BugDriver::BugDriver(const char *toolname) : ToolName(toolname), ReferenceOutputFile(OutputFile), - Program(0), Interpreter(0) {} + Program(0), Interpreter(0), cbe(0), gcc(0) {} /// ParseInputFile - Given a bytecode or assembly input filename, parse and Index: llvm/tools/bugpoint/BugDriver.h diff -u llvm/tools/bugpoint/BugDriver.h:1.9 llvm/tools/bugpoint/BugDriver.h:1.10 --- llvm/tools/bugpoint/BugDriver.h:1.9 Thu Jul 24 13:17:43 2003 +++ llvm/tools/bugpoint/BugDriver.h Thu Jul 24 16:59:10 2003 @@ -9,7 +9,6 @@ #ifndef BUGDRIVER_H #define BUGDRIVER_H -#include "Support/CommandLine.h" #include #include @@ -25,12 +24,17 @@ class ReduceCrashingFunctions; class ReduceCrashingBlocks; +class CBE; +class GCC; + class BugDriver { const std::string ToolName; // Name of bugpoint - cl::opt ReferenceOutputFile; // Name of `good' output file + std::string ReferenceOutputFile; // Name of `good' output file Module *Program; // The raw program, linked together std::vector PassesToRun; AbstractInterpreter *Interpreter; // How to run the program + CBE *cbe; + GCC *gcc; // FIXME: sort out public/private distinctions... friend class DebugCrashes; @@ -128,6 +132,7 @@ } /// PrintFunctionList - prints out list of problematic functions + /// static void PrintFunctionList(const std::vector &Funcs); /// deleteInstructionFromProgram - This method clones the current Program and Index: llvm/tools/bugpoint/CodeGeneratorBug.cpp diff -u llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.1 llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.2 --- llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.1 Thu Jul 24 13:17:43 2003 +++ llvm/tools/bugpoint/CodeGeneratorBug.cpp Thu Jul 24 16:59:10 2003 @@ -17,9 +17,6 @@ #include #include -// Passed as a command-line argument to Bugpoint -extern cl::opt Output; - class ReduceMisCodegenFunctions : public ListReducer { BugDriver &BD; public: @@ -59,8 +56,7 @@ for (Module::giterator I=TestModule->gbegin(),E = TestModule->gend();I!=E;++I) I->setInitializer(0); // Delete the initializer to make it external - // Remove the Test functions from the Safe module, and - // all of the global variables. + // Remove the Test functions from the Safe module for (unsigned i = 0, e = Funcs.size(); i != e; ++i) { Function *TNOF = SafeModule->getFunction(Funcs[i]->getName(), Funcs[i]->getFunctionType()); @@ -100,25 +96,25 @@ // Run the code generator on the `Test' code, loading the shared library. // The function returns whether or not the new output differs from reference. - return BD.diffProgram(TestModuleBC, SharedObject, false); + int Result = BD.diffProgram(TestModuleBC, SharedObject, false); + removeFile(SharedObject); + return Result; } namespace { - struct Disambiguator /*: public unary_function*/ { + struct Disambiguator { std::set SymbolNames; - std::set Symbols; uint64_t uniqueCounter; bool externalOnly; - + public: Disambiguator() : uniqueCounter(0), externalOnly(true) {} void setExternalOnly(bool value) { externalOnly = value; } - void operator() (GlobalValue &V) { + void add(GlobalValue &V) { if (externalOnly && !V.isExternal()) return; if (SymbolNames.count(V.getName()) == 0) { DEBUG(std::cerr << "Disambiguator: adding " << V.getName() << ", no conflicts.\n"); - Symbols.insert(&V); SymbolNames.insert(V.getName()); } else { // Mangle name before adding @@ -133,7 +129,6 @@ << ", adding: " << newName << "\n"); V.setName(newName); SymbolNames.insert(newName); - Symbols.insert(&V); } } }; @@ -142,14 +137,15 @@ void ReduceMisCodegenFunctions::DisambiguateGlobalSymbols(Module *M) { // First, try not to cause collisions by minimizing chances of renaming an // already-external symbol, so take in external globals and functions as-is. - Disambiguator D = std::for_each(M->gbegin(), M->gend(), Disambiguator()); - std::for_each(M->begin(), M->end(), D); + Disambiguator D; + for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I) D.add(*I); + for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) D.add(*I); // Now just rename functions and globals as necessary, keeping what's already // in the set unique. D.setExternalOnly(false); - std::for_each(M->gbegin(), M->gend(), D); - std::for_each(M->begin(), M->end(), D); + for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I) D.add(*I); + for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) D.add(*I); } @@ -169,7 +165,7 @@ std::cout << "\n"; // Output a bunch of bytecode files for the user... - ReduceMisCodegenFunctions(*this).TestFuncs(MisCodegenFunctions); + // ReduceMisCodegenFunctions(*this).TestFuncs(MisCodegenFunctions); return false; } Index: llvm/tools/bugpoint/ExecutionDriver.cpp diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.7 llvm/tools/bugpoint/ExecutionDriver.cpp:1.8 --- llvm/tools/bugpoint/ExecutionDriver.cpp:1.7 Thu Jul 24 13:17:43 2003 +++ llvm/tools/bugpoint/ExecutionDriver.cpp Thu Jul 24 16:59:10 2003 @@ -38,6 +38,8 @@ cl::opt InputFile("input", cl::init("/dev/null"), cl::desc("Filename to pipe in as stdin (default: /dev/null)")); + + enum FileType { AsmFile, CFile }; } /// AbstractInterpreter Class - Subclasses of this class are used to execute @@ -84,7 +86,7 @@ int LLI::ExecuteProgram(const std::string &Bytecode, const std::string &OutputFile, const std::string &SharedLib) { - if (SharedLib != "") { + if (!SharedLib.empty()) { std::cerr << "LLI currently does not support loading shared libraries.\n" << "Exiting.\n"; exit(1); @@ -109,10 +111,11 @@ // This is not a *real* AbstractInterpreter as it does not accept bytecode // files, but only input acceptable to GCC, i.e. C, C++, and assembly files // -class GCC : public AbstractInterpreter { +class GCC { std::string GCCPath; // The path to the gcc executable public: GCC(const std::string &gccPath) : GCCPath(gccPath) { } + virtual ~GCC() {} // GCC create method - Try to find the `gcc' executable static GCC *create(BugDriver *BD, std::string &Message) { @@ -127,16 +130,19 @@ } virtual int ExecuteProgram(const std::string &ProgramFile, + FileType fileType, const std::string &OutputFile, const std::string &SharedLib = ""); int MakeSharedObject(const std::string &InputFile, + FileType fileType, std::string &OutputFile); void ProcessFailure(const char **Args); }; int GCC::ExecuteProgram(const std::string &ProgramFile, + FileType fileType, const std::string &OutputFile, const std::string &SharedLib) { std::string OutputBinary = "bugpoint.gcc.exe"; @@ -144,6 +150,7 @@ const char *ArgsWithoutSO[] = { GCCPath.c_str(), + "-x", (fileType == AsmFile) ? "assembler" : "c", ProgramFile.c_str(), // Specify the input filename... "-o", OutputBinary.c_str(), // Output to the right filename... "-lm", // Hard-code the math library... @@ -152,6 +159,7 @@ }; const char *ArgsWithSO[] = { GCCPath.c_str(), + "-x", (fileType == AsmFile) ? "assembler" : "c", ProgramFile.c_str(), // Specify the input filename... SharedLib.c_str(), // Specify the shared library to link in... "-o", OutputBinary.c_str(), // Output to the right filename... @@ -160,12 +168,12 @@ 0 }; - GCCArgs = (SharedLib == "") ? ArgsWithoutSO : ArgsWithSO; + GCCArgs = (SharedLib.empty()) ? ArgsWithoutSO : ArgsWithSO; std::cout << ""; - if (RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", - "/dev/null", "/dev/null")) { + if (RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", "/dev/null", + "/dev/null")) { ProcessFailure(GCCArgs); - exit(1); // Leave stuff around for the user to inspect or debug the CBE + exit(1); } const char *ProgramArgs[] = { @@ -184,11 +192,13 @@ } int GCC::MakeSharedObject(const std::string &InputFile, + FileType fileType, std::string &OutputFile) { OutputFile = "./bugpoint.so"; // Compile the C/asm file into a shared object const char* GCCArgs[] = { GCCPath.c_str(), + "-x", (fileType == AsmFile) ? "assembler" : "c", InputFile.c_str(), // Specify the input filename... #if defined(sparc) || defined(__sparc__) || defined(__sparcv9) "-G", // Compile a shared library, `-G' for Sparc @@ -254,6 +264,10 @@ Message = "Found llc: " + LLCPath + "\n"; GCC *gcc = GCC::create(BD, Message); + if (!gcc) { + std::cerr << Message << "\n"; + exit(1); + } return new LLC(LLCPath, gcc); } @@ -300,7 +314,7 @@ } // Assuming LLC worked, compile the result with GCC and run it. - int Result = gcc->ExecuteProgram(OutputAsmFile, OutputFile, SharedLib); + int Result = gcc->ExecuteProgram(OutputAsmFile,AsmFile,OutputFile,SharedLib); removeFile(OutputAsmFile); return Result; } @@ -333,18 +347,20 @@ int JIT::ExecuteProgram(const std::string &Bytecode, const std::string &OutputFile, const std::string &SharedLib) { - if (SharedLib == "") { + if (SharedLib.empty()) { const char* Args[] = { - LLIPath.c_str(), "-quiet", "-force-interpreter=false", Bytecode.c_str(), + LLIPath.c_str(), + "-quiet", + "-force-interpreter=false", + Bytecode.c_str(), 0 }; return RunProgramWithTimeout(LLIPath, Args, InputFile, OutputFile, OutputFile); } else { - std::string SharedLibOpt = "-load=" + SharedLib; const char* Args[] = { LLIPath.c_str(), "-quiet", "-force-interpreter=false", - SharedLibOpt.c_str(), + "-load", SharedLib.c_str(), Bytecode.c_str(), 0 }; @@ -374,6 +390,10 @@ Message = "Found dis: " + DISPath + "\n"; GCC *gcc = GCC::create(BD, Message); + if (!gcc) { + std::cerr << Message << "\n"; + exit(1); + } return new CBE(DISPath, gcc); } @@ -421,7 +441,7 @@ exit(1); } - int Result = gcc->ExecuteProgram(OutputCFile, OutputFile, SharedLib); + int Result = gcc->ExecuteProgram(OutputCFile, CFile, OutputFile, SharedLib); removeFile(OutputCFile); return Result; @@ -456,6 +476,12 @@ std::cout << Message; + // Initialize auxiliary tools for debugging + cbe = CBE::create(this, Message); + if (!cbe) { std::cout << Message << "\nExiting.\n"; exit(1); } + gcc = GCC::create(this, Message); + if (!gcc) { std::cout << Message << "\nExiting.\n"; exit(1); } + // If there was an error creating the selected interpreter, quit with error. return Interpreter == 0; } @@ -503,11 +529,7 @@ std::string BugDriver::executeProgramWithCBE(std::string OutputFile, std::string BytecodeFile, std::string SharedObject) { - std::string Output; - CBE *cbe = CBE::create(this, Output); - Output = executeProgram(OutputFile, BytecodeFile, SharedObject, cbe); - delete cbe; - return Output; + return executeProgram(OutputFile, BytecodeFile, SharedObject, cbe); } int BugDriver::compileSharedObject(const std::string &BytecodeFile, @@ -516,7 +538,6 @@ std::string Message, OutputCFile; // Using CBE - CBE *cbe = CBE::create(this, Message); cbe->OutputC(BytecodeFile, OutputCFile); #if 0 /* This is an alternative, as yet unimplemented */ @@ -528,15 +549,10 @@ } #endif - GCC *gcc = GCC::create(this, Message); - gcc->MakeSharedObject(OutputCFile, SharedObject); + gcc->MakeSharedObject(OutputCFile, CFile, SharedObject); // Remove the intermediate C file removeFile(OutputCFile); - - // We are done with the CBE & GCC - delete cbe; - delete gcc; return 0; } From vadve at cs.uiuc.edu Fri Jul 25 09:07:03 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Fri Jul 25 09:07:03 2003 Subject: [llvm-commits] CVS: llvm/include/Support/hash_map hash_set Message-ID: <200307251406.JAA01089@psmith.cs.uiuc.edu> Changes in directory llvm/include/Support: hash_map updated: 1.8 -> 1.9 hash_set updated: 1.8 -> 1.9 --- Log message: Include vector into these two files to ensure that specializations like stl_bvector.h are correctly included into *anything* that includes hash_map or hash_set. ext/hash_map includes stl_vector.h directly and leaves out the specializations, causing truly nasty bugs due to inconsistent versions of vector<> being used for vector in different files. --- Diffs of the changes: Index: llvm/include/Support/hash_map diff -u llvm/include/Support/hash_map:1.8 llvm/include/Support/hash_map:1.9 --- llvm/include/Support/hash_map:1.8 Mon Jun 30 16:58:24 2003 +++ llvm/include/Support/hash_map Fri Jul 25 09:06:13 2003 @@ -42,6 +42,10 @@ using HASH_NAMESPACE::hash_multimap; using HASH_NAMESPACE::hash; +/* Include vector because ext/hash_map includes stl_vector.h and leaves + out specializations like stl_bvector.h, causing link conflicts. */ +#include + #include #endif Index: llvm/include/Support/hash_set diff -u llvm/include/Support/hash_set:1.8 llvm/include/Support/hash_set:1.9 --- llvm/include/Support/hash_set:1.8 Mon Jun 30 16:58:24 2003 +++ llvm/include/Support/hash_set Fri Jul 25 09:06:13 2003 @@ -41,6 +41,10 @@ using HASH_NAMESPACE::hash_set; using HASH_NAMESPACE::hash; +/* Include vector because ext/hash_set includes stl_vector.h and leaves + out specializations like stl_bvector.h, causing link conflicts. */ +#include + #include #endif From lattner at cs.uiuc.edu Fri Jul 25 10:09:08 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 10:09:08 2003 Subject: [llvm-commits] CVS: llvm/include/Support/hash_map hash_set Message-ID: <200307251508.KAA32746@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: hash_map updated: 1.9 -> 1.10 hash_set updated: 1.9 -> 1.10 --- Log message: Convert to C++ style comments --- Diffs of the changes: Index: llvm/include/Support/hash_map diff -u llvm/include/Support/hash_map:1.9 llvm/include/Support/hash_map:1.10 --- llvm/include/Support/hash_map:1.9 Fri Jul 25 09:06:13 2003 +++ llvm/include/Support/hash_map Fri Jul 25 10:08:08 2003 @@ -42,8 +42,8 @@ using HASH_NAMESPACE::hash_multimap; using HASH_NAMESPACE::hash; -/* Include vector because ext/hash_map includes stl_vector.h and leaves - out specializations like stl_bvector.h, causing link conflicts. */ +// Include vector because ext/hash_map includes stl_vector.h and leaves +// out specializations like stl_bvector.h, causing link conflicts. #include #include Index: llvm/include/Support/hash_set diff -u llvm/include/Support/hash_set:1.9 llvm/include/Support/hash_set:1.10 --- llvm/include/Support/hash_set:1.9 Fri Jul 25 09:06:13 2003 +++ llvm/include/Support/hash_set Fri Jul 25 10:08:08 2003 @@ -41,8 +41,8 @@ using HASH_NAMESPACE::hash_set; using HASH_NAMESPACE::hash; -/* Include vector because ext/hash_set includes stl_vector.h and leaves - out specializations like stl_bvector.h, causing link conflicts. */ +// Include vector because ext/hash_set includes stl_vector.h and leaves +// out specializations like stl_bvector.h, causing link conflicts. #include #include From lattner at cs.uiuc.edu Fri Jul 25 11:48:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 11:48:02 2003 Subject: [llvm-commits] CVS: llvm/include/Support/Annotation.h Message-ID: <200307251647.LAA16889@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: Annotation.h updated: 1.9 -> 1.10 --- Log message: Add assert.h include --- Diffs of the changes: Index: llvm/include/Support/Annotation.h diff -u llvm/include/Support/Annotation.h:1.9 llvm/include/Support/Annotation.h:1.10 --- llvm/include/Support/Annotation.h:1.9 Mon Jun 30 16:58:23 2003 +++ llvm/include/Support/Annotation.h Fri Jul 25 11:47:07 2003 @@ -16,6 +16,7 @@ #define SUPPORT_ANNOTATION_H #include +#include class AnnotationID; class Annotation; From lattner at cs.uiuc.edu Fri Jul 25 12:24:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:24:01 2003 Subject: [llvm-commits] CVS: llvm/include/Support/ilist Message-ID: <200307251723.MAA24618@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: ilist updated: 1.8 -> 1.9 --- Log message: Fix accessibility problems GCC 3.3 --- Diffs of the changes: Index: llvm/include/Support/ilist diff -u llvm/include/Support/ilist:1.8 llvm/include/Support/ilist:1.9 --- llvm/include/Support/ilist:1.8 Mon Jun 30 16:58:24 2003 +++ llvm/include/Support/ilist Fri Jul 25 12:23:13 2003 @@ -74,11 +74,13 @@ typedef ilist_traits Traits; typedef bidirectional_iterator super; +public: + typedef size_t size_type; typedef typename super::pointer pointer; typedef typename super::reference reference; +private: pointer NodePtr; public: - typedef size_t size_type; ilist_iterator(pointer NP) : NodePtr(NP) {} ilist_iterator(reference NR) : NodePtr(&NR) {} From lattner at cs.uiuc.edu Fri Jul 25 12:24:12 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:24:12 2003 Subject: [llvm-commits] CVS: llvm/include/Support/CommandLine.h Timer.h Message-ID: <200307251723.MAA24537@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: CommandLine.h updated: 1.19 -> 1.20 Timer.h updated: 1.8 -> 1.9 --- Log message: Add includes of assert --- Diffs of the changes: Index: llvm/include/Support/CommandLine.h diff -u llvm/include/Support/CommandLine.h:1.19 llvm/include/Support/CommandLine.h:1.20 --- llvm/include/Support/CommandLine.h:1.19 Mon Jul 14 12:16:52 2003 +++ llvm/include/Support/CommandLine.h Fri Jul 25 12:23:27 2003 @@ -17,6 +17,7 @@ #include #include #include +#include #include "boost/type_traits/object_traits.hpp" /// cl Namespace - This namespace contains all of the command line option Index: llvm/include/Support/Timer.h diff -u llvm/include/Support/Timer.h:1.8 llvm/include/Support/Timer.h:1.9 --- llvm/include/Support/Timer.h:1.8 Mon Jun 30 16:58:23 2003 +++ llvm/include/Support/Timer.h Fri Jul 25 12:23:27 2003 @@ -28,6 +28,7 @@ #include #include #include +#include class TimerGroup; From lattner at cs.uiuc.edu Fri Jul 25 12:34:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:34:00 2003 Subject: [llvm-commits] CVS: llvm/include/boost/config/compiler/gcc.hpp Message-ID: <200307251733.MAA24800@apoc.cs.uiuc.edu> Changes in directory llvm/include/boost/config/compiler: gcc.hpp updated: 1.2 -> 1.3 --- Log message: This header works with GCC 3.3 --- Diffs of the changes: Index: llvm/include/boost/config/compiler/gcc.hpp diff -u llvm/include/boost/config/compiler/gcc.hpp:1.2 llvm/include/boost/config/compiler/gcc.hpp:1.3 --- llvm/include/boost/config/compiler/gcc.hpp:1.2 Tue Sep 17 18:38:38 2002 +++ llvm/include/boost/config/compiler/gcc.hpp Fri Jul 25 12:33:45 2003 @@ -49,8 +49,8 @@ # error "Compiler not configured - please reconfigure" #endif // -// last known and checked version is 3.2: -#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 2)) +// last known and checked version is 3.3: +#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 3)) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # else From lattner at cs.uiuc.edu Fri Jul 25 12:34:11 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:34:11 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp MemoryManager.cpp TraceCache.cpp Message-ID: <200307251733.MAA24789@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/TraceCache: InstrUtils.cpp updated: 1.11 -> 1.12 MemoryManager.cpp updated: 1.8 -> 1.9 TraceCache.cpp updated: 1.15 -> 1.16 --- Log message: Use C++ header, not the C header --- Diffs of the changes: Index: llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp diff -u llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp:1.11 llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp:1.12 --- llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp:1.11 Thu Jul 10 13:57:33 2003 +++ llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp Fri Jul 25 12:33:21 2003 @@ -9,7 +9,7 @@ #ifdef __sparc #include "llvm/Reoptimizer/InstrUtils.h" -#include +#include #include uint64_t getBranchTarget(unsigned br, uint64_t pc){ Index: llvm/lib/Reoptimizer/TraceCache/MemoryManager.cpp diff -u llvm/lib/Reoptimizer/TraceCache/MemoryManager.cpp:1.8 llvm/lib/Reoptimizer/TraceCache/MemoryManager.cpp:1.9 --- llvm/lib/Reoptimizer/TraceCache/MemoryManager.cpp:1.8 Fri Jul 18 11:11:12 2003 +++ llvm/lib/Reoptimizer/TraceCache/MemoryManager.cpp Fri Jul 25 12:33:21 2003 @@ -24,7 +24,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Reoptimizer/MemoryManager.h" -#include +#include #include using std::cerr; Index: llvm/lib/Reoptimizer/TraceCache/TraceCache.cpp diff -u llvm/lib/Reoptimizer/TraceCache/TraceCache.cpp:1.15 llvm/lib/Reoptimizer/TraceCache/TraceCache.cpp:1.16 --- llvm/lib/Reoptimizer/TraceCache/TraceCache.cpp:1.15 Fri Jul 18 11:11:03 2003 +++ llvm/lib/Reoptimizer/TraceCache/TraceCache.cpp Fri Jul 25 12:33:21 2003 @@ -13,7 +13,7 @@ #include "llvm/Reoptimizer/VirtualMem.h" #include "llvm/Reoptimizer/InstrUtils.h" #include "llvm/Reoptimizer/GetTraceTime.h" -#include +#include #include #include From lattner at cs.uiuc.edu Fri Jul 25 12:34:22 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:34:22 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/ElfReader.cpp Message-ID: <200307251733.MAA24778@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Inst/lib: ElfReader.cpp updated: 1.11 -> 1.12 --- Log message: Use C++ header, not the C header --- Diffs of the changes: Index: llvm/lib/Reoptimizer/Inst/lib/ElfReader.cpp diff -u llvm/lib/Reoptimizer/Inst/lib/ElfReader.cpp:1.11 llvm/lib/Reoptimizer/Inst/lib/ElfReader.cpp:1.12 --- llvm/lib/Reoptimizer/Inst/lib/ElfReader.cpp:1.11 Sun May 4 16:18:52 2003 +++ llvm/lib/Reoptimizer/Inst/lib/ElfReader.cpp Fri Jul 25 12:33:20 2003 @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include From lattner at cs.uiuc.edu Fri Jul 25 12:34:32 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:34:32 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/BinInterface/sparcdis.cpp Message-ID: <200307251733.MAA24769@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/BinInterface: sparcdis.cpp updated: 1.13 -> 1.14 --- Log message: Use C++ header, not the C header --- Diffs of the changes: Index: llvm/lib/Reoptimizer/BinInterface/sparcdis.cpp diff -u llvm/lib/Reoptimizer/BinInterface/sparcdis.cpp:1.13 llvm/lib/Reoptimizer/BinInterface/sparcdis.cpp:1.14 --- llvm/lib/Reoptimizer/BinInterface/sparcdis.cpp:1.13 Mon Jun 30 16:58:46 2003 +++ llvm/lib/Reoptimizer/BinInterface/sparcdis.cpp Fri Jul 25 12:33:19 2003 @@ -21,9 +21,7 @@ #include "llvm/Reoptimizer/BinInterface/sparc9.h" // SPARC9 opcode definitions #include "Config/stdio.h" #include "Config/stdlib.h" - -// Include assert since other LLVM header files haven't picked it up -#include "Config/assert.h" +#include void sparc_printop_rs1(unsigned instr, int labelrs1) { From lattner at cs.uiuc.edu Fri Jul 25 12:34:42 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:34:42 2003 Subject: [llvm-commits] CVS: llvm/utils/TableGen/Record.h Message-ID: <200307251733.MAA24749@apoc.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: Record.h updated: 1.9 -> 1.10 --- Log message: Use C++ headers, not C headers --- Diffs of the changes: Index: llvm/utils/TableGen/Record.h diff -u llvm/utils/TableGen/Record.h:1.9 llvm/utils/TableGen/Record.h:1.10 --- llvm/utils/TableGen/Record.h:1.9 Wed Jun 11 09:17:21 2003 +++ llvm/utils/TableGen/Record.h Fri Jul 25 12:32:51 2003 @@ -10,7 +10,7 @@ #include #include #include -#include +#include class Init; class UnsetInit; From lattner at cs.uiuc.edu Fri Jul 25 12:35:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:35:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/DSSupport.h Message-ID: <200307251734.MAA24848@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: DSSupport.h updated: 1.20 -> 1.21 --- Log message: Use the C++ header, not the C header --- Diffs of the changes: Index: llvm/include/llvm/Analysis/DSSupport.h diff -u llvm/include/llvm/Analysis/DSSupport.h:1.20 llvm/include/llvm/Analysis/DSSupport.h:1.21 --- llvm/include/llvm/Analysis/DSSupport.h:1.20 Tue Jul 1 16:11:59 2003 +++ llvm/include/llvm/Analysis/DSSupport.h Fri Jul 25 12:34:17 2003 @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include "Support/HashExtras.h" #include "Support/hash_set" From lattner at cs.uiuc.edu Fri Jul 25 12:35:11 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:35:11 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/AbstractTypeUser.h Message-ID: <200307251734.MAA24841@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: AbstractTypeUser.h updated: 1.8 -> 1.9 --- Log message: Use the C++ header, not the C header --- Diffs of the changes: Index: llvm/include/llvm/AbstractTypeUser.h diff -u llvm/include/llvm/AbstractTypeUser.h:1.8 llvm/include/llvm/AbstractTypeUser.h:1.9 --- llvm/include/llvm/AbstractTypeUser.h:1.8 Mon Jun 30 16:58:26 2003 +++ llvm/include/llvm/AbstractTypeUser.h Fri Jul 25 12:34:16 2003 @@ -21,15 +21,14 @@ #ifndef LLVM_ABSTRACT_TYPE_USER_H #define LLVM_ABSTRACT_TYPE_USER_H -// -// This is the "master" include for assert.h -// Whether this file needs it or not, it must always include assert.h for the -// files which include llvm/AbstractTypeUser.h +// This is the "master" include for Whether this file needs it or not, +// it must always include for the files which include +// llvm/AbstractTypeUser.h // // In this way, most every LLVM source file will have access to the assert() -// macro without having to #include directly. +// macro without having to #include directly. // -#include "Config/assert.h" +#include class Type; class DerivedType; From lattner at cs.uiuc.edu Fri Jul 25 12:35:22 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:35:22 2003 Subject: [llvm-commits] CVS: llvm/include/Support/Annotation.h Message-ID: <200307251734.MAA24834@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: Annotation.h updated: 1.10 -> 1.11 --- Log message: Use the C++ header, not the C header --- Diffs of the changes: Index: llvm/include/Support/Annotation.h diff -u llvm/include/Support/Annotation.h:1.10 llvm/include/Support/Annotation.h:1.11 --- llvm/include/Support/Annotation.h:1.10 Fri Jul 25 11:47:07 2003 +++ llvm/include/Support/Annotation.h Fri Jul 25 12:34:15 2003 @@ -16,7 +16,7 @@ #define SUPPORT_ANNOTATION_H #include -#include +#include class AnnotationID; class Annotation; From lattner at cs.uiuc.edu Fri Jul 25 12:36:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:36:01 2003 Subject: [llvm-commits] CVS: llvm/include/Config/assert.h Message-ID: <200307251735.MAA24859@apoc.cs.uiuc.edu> Changes in directory llvm/include/Config: assert.h (r1.2) removed --- Log message: Regardless of whether C provides assert.h, C++ source can always include , making this header unneeded. --- Diffs of the changes: From lattner at cs.uiuc.edu Fri Jul 25 12:40:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:40:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/AbstractTypeUser.h Message-ID: <200307251739.MAA00737@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: AbstractTypeUser.h updated: 1.9 -> 1.10 --- Log message: Remove inline declarations that GCC 3.3 doesn't like without a body --- Diffs of the changes: Index: llvm/include/llvm/AbstractTypeUser.h diff -u llvm/include/llvm/AbstractTypeUser.h:1.9 llvm/include/llvm/AbstractTypeUser.h:1.10 --- llvm/include/llvm/AbstractTypeUser.h:1.9 Fri Jul 25 12:34:16 2003 +++ llvm/include/llvm/AbstractTypeUser.h Fri Jul 25 12:39:33 2003 @@ -72,8 +72,8 @@ // These functions are defined at the bottom of Type.h. See the comment there // for justification. - inline void addUser(); - inline void removeUser(); + void addUser(); + void removeUser(); public: // ctor - Add use to type if abstract. Note that Ty must not be null inline PATypeHandle(const Type *ty, AbstractTypeUser *user) @@ -121,7 +121,7 @@ // this, we MUST remove ourself from the AbstractTypeUser list, even though // the type is apparently concrete. // - inline void removeUserFromConcrete(); + void removeUserFromConcrete(); }; From lattner at cs.uiuc.edu Fri Jul 25 12:47:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:47:00 2003 Subject: [llvm-commits] CVS: llvm/include/Support/PostOrderIterator.h Message-ID: <200307251746.MAA17388@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: PostOrderIterator.h updated: 1.9 -> 1.10 --- Log message: Fix visibility problem exposed by GCC 3.3 --- Diffs of the changes: Index: llvm/include/Support/PostOrderIterator.h diff -u llvm/include/Support/PostOrderIterator.h:1.9 llvm/include/Support/PostOrderIterator.h:1.10 --- llvm/include/Support/PostOrderIterator.h:1.9 Mon Jun 16 19:35:55 2003 +++ llvm/include/Support/PostOrderIterator.h Fri Jul 25 12:46:25 2003 @@ -17,7 +17,6 @@ template > class po_iterator : public forward_iterator { typedef forward_iterator super; - typedef typename super::pointer pointer; typedef typename GT::NodeType NodeType; typedef typename GT::ChildIteratorType ChildItTy; @@ -43,6 +42,7 @@ } inline po_iterator() { /* End is when stack is empty */ } public: + typedef typename super::pointer pointer; typedef po_iterator _Self; // Provide static "constructors"... From lattner at cs.uiuc.edu Fri Jul 25 12:50:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:50:01 2003 Subject: [llvm-commits] CVS: llvm/include/Support/DepthFirstIterator.h Message-ID: <200307251749.MAA23637@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: DepthFirstIterator.h updated: 1.5 -> 1.6 --- Log message: Fix another accessibility problem illuminated by GCC 3.3 --- Diffs of the changes: Index: llvm/include/Support/DepthFirstIterator.h diff -u llvm/include/Support/DepthFirstIterator.h:1.5 llvm/include/Support/DepthFirstIterator.h:1.6 --- llvm/include/Support/DepthFirstIterator.h:1.5 Mon Jun 16 19:35:55 2003 +++ llvm/include/Support/DepthFirstIterator.h Fri Jul 25 12:49:28 2003 @@ -17,7 +17,6 @@ template > class df_iterator : public forward_iterator { typedef forward_iterator super; - typedef typename super::pointer pointer; typedef typename GT::NodeType NodeType; typedef typename GT::ChildIteratorType ChildItTy; @@ -51,6 +50,7 @@ inline df_iterator() { /* End is when stack is empty */ } public: + typedef typename super::pointer pointer; typedef df_iterator _Self; // Provide static begin and end methods as our public "constructors" From lattner at cs.uiuc.edu Fri Jul 25 12:59:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:59:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h TargetInstrInfo.h TargetRegInfo.h Message-ID: <200307251758.MAA21409@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: MRegisterInfo.h updated: 1.17 -> 1.18 TargetInstrInfo.h updated: 1.47 -> 1.48 TargetRegInfo.h updated: 1.41 -> 1.42 --- Log message: #include as necessary... --- Diffs of the changes: Index: llvm/include/llvm/Target/MRegisterInfo.h diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.17 llvm/include/llvm/Target/MRegisterInfo.h:1.18 --- llvm/include/llvm/Target/MRegisterInfo.h:1.17 Sat Jun 21 22:06:38 2003 +++ llvm/include/llvm/Target/MRegisterInfo.h Fri Jul 25 12:58:41 2003 @@ -10,6 +10,7 @@ #define LLVM_TARGET_MREGISTERINFO_H #include "llvm/CodeGen/MachineBasicBlock.h" +#include class Type; class MachineFunction; Index: llvm/include/llvm/Target/TargetInstrInfo.h diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.47 llvm/include/llvm/Target/TargetInstrInfo.h:1.48 --- llvm/include/llvm/Target/TargetInstrInfo.h:1.47 Mon Jun 30 16:58:35 2003 +++ llvm/include/llvm/Target/TargetInstrInfo.h Fri Jul 25 12:58:41 2003 @@ -9,6 +9,7 @@ #include "Support/DataTypes.h" #include +#include class MachineInstr; class TargetMachine; Index: llvm/include/llvm/Target/TargetRegInfo.h diff -u llvm/include/llvm/Target/TargetRegInfo.h:1.41 llvm/include/llvm/Target/TargetRegInfo.h:1.42 --- llvm/include/llvm/Target/TargetRegInfo.h:1.41 Sun Jul 20 10:39:30 2003 +++ llvm/include/llvm/Target/TargetRegInfo.h Fri Jul 25 12:58:41 2003 @@ -10,6 +10,7 @@ #include "Support/hash_map" #include +#include class TargetMachine; class IGNode; From lattner at cs.uiuc.edu Fri Jul 25 12:59:12 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:59:12 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/DependenceGraph.h Message-ID: <200307251758.MAA21398@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: DependenceGraph.h updated: 1.6 -> 1.7 --- Log message: #include as necessary... --- Diffs of the changes: Index: llvm/include/llvm/Analysis/DependenceGraph.h diff -u llvm/include/llvm/Analysis/DependenceGraph.h:1.6 llvm/include/llvm/Analysis/DependenceGraph.h:1.7 --- llvm/include/llvm/Analysis/DependenceGraph.h:1.6 Mon Jun 30 16:58:28 2003 +++ llvm/include/llvm/Analysis/DependenceGraph.h Fri Jul 25 12:58:40 2003 @@ -21,6 +21,7 @@ #include #include #include +#include class Instruction; class Function; From lattner at cs.uiuc.edu Fri Jul 25 12:59:22 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 12:59:22 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Pass.h Message-ID: <200307251758.MAA21391@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: Pass.h updated: 1.35 -> 1.36 --- Log message: #include as necessary... --- Diffs of the changes: Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.35 llvm/include/llvm/Pass.h:1.36 --- llvm/include/llvm/Pass.h:1.35 Mon Jun 30 16:58:26 2003 +++ llvm/include/llvm/Pass.h Fri Jul 25 12:58:38 2003 @@ -26,6 +26,7 @@ #include #include #include +#include class Value; class BasicBlock; class Function; From lattner at cs.uiuc.edu Fri Jul 25 13:07:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 13:07:03 2003 Subject: [llvm-commits] CVS: llvm/www/docs/OpenProjects.html Message-ID: <200307251806.NAA09322@tank.cs.uiuc.edu> Changes in directory llvm/www/docs: OpenProjects.html updated: 1.7 -> 1.8 --- Log message: Brian implemented the static compiler, take it off the list --- Diffs of the changes: Index: llvm/www/docs/OpenProjects.html diff -u llvm/www/docs/OpenProjects.html:1.7 llvm/www/docs/OpenProjects.html:1.8 --- llvm/www/docs/OpenProjects.html:1.7 Wed Jun 25 09:31:06 2003 +++ llvm/www/docs/OpenProjects.html Fri Jul 25 13:05:38 2003 @@ -183,9 +183,9 @@ Pointer and Alias Analysis
      -We have a strong base for development of both pointer analysis based -optimizations as well as pointer analyses themselves. It seems natural to want -to take advantage of this...

      +We have a strong base for development of both +pointer analysis based optimizations as well as pointer analyses themselves. It +seems natural to want to take advantage of this...

      1. Implement a flow-sensitive context-sensitive alias analysis algorithm
        @@ -254,7 +254,6 @@
        1. Implement a global register allocator
        2. Implement a better instruction selector -
        3. Implement a static compiler in addition to the JIT (easy project)
        4. Implement support for the "switch" instruction without requiring the lower-switches pass.
        @@ -280,6 +279,6 @@
        Chris Lattner
        -Last modified: Wed Jun 25 09:30:27 CDT 2003 +Last modified: Fri Jul 25 13:04:03 CDT 2003 From lattner at cs.uiuc.edu Fri Jul 25 13:07:17 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 13:07:17 2003 Subject: [llvm-commits] CVS: llvm/www/docs/CodingStandards.html Message-ID: <200307251806.NAA09314@tank.cs.uiuc.edu> Changes in directory llvm/www/docs: CodingStandards.html updated: 1.6 -> 1.7 --- Log message: Change reference to assert.h to mention cassert --- Diffs of the changes: Index: llvm/www/docs/CodingStandards.html diff -u llvm/www/docs/CodingStandards.html:1.6 llvm/www/docs/CodingStandards.html:1.7 --- llvm/www/docs/CodingStandards.html:1.6 Wed Apr 23 11:25:38 2003 +++ llvm/www/docs/CodingStandards.html Fri Jul 25 13:05:51 2003 @@ -257,7 +257,7 @@


    Assert Liberally

      -Use the "assert" function to its fullest. Check all of your preconditions and assumptions, you never know when a bug (not neccesarily even yours) might be caught early by an assertion, which reduces debugging time dramatically. The "assert.h" header file is probably already included by the header files you are using, so it doesn't cost anything to use it.

      +Use the "assert" function to its fullest. Check all of your preconditions and assumptions, you never know when a bug (not neccesarily even yours) might be caught early by an assertion, which reduces debugging time dramatically. The "<cassert>" header file is probably already included by the header files you are using, so it doesn't cost anything to use it.

      To further assist with debugging, make sure to put some kind of error message in the assertion statement (which is printed if the assertion is tripped). This helps the poor debugging make sense of why an assertion is being made and enforced, and hopefully what to do about it. Here is one complete example:

      @@ -660,7 +660,7 @@

      Chris Lattner
      -Last modified: Wed Apr 23 11:20:49 CDT 2003 +Last modified: Fri Jul 25 12:29:52 CDT 2003 From lattner at cs.uiuc.edu Fri Jul 25 13:08:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 13:08:01 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/ExecutionEngine.h Message-ID: <200307251807.NAA00525@apoc.cs.uiuc.edu> Changes in directory llvm/tools/lli: ExecutionEngine.h updated: 1.4 -> 1.5 --- Log message: More cassert inclusion for GCC 3.3 --- Diffs of the changes: Index: llvm/tools/lli/ExecutionEngine.h diff -u llvm/tools/lli/ExecutionEngine.h:1.4 llvm/tools/lli/ExecutionEngine.h:1.5 --- llvm/tools/lli/ExecutionEngine.h:1.4 Sun May 11 21:14:26 2003 +++ llvm/tools/lli/ExecutionEngine.h Fri Jul 25 13:06:53 2003 @@ -11,6 +11,7 @@ #include #include #include +#include class Constant; class Type; class GlobalValue; From gaeke at cs.uiuc.edu Fri Jul 25 15:22:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri Jul 25 15:22:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp Message-ID: <200307252021.PAA32699@neo.cs.uiuc.edu> Changes in directory llvm/lib/CWriter: Writer.cpp updated: 1.110 -> 1.111 --- Log message: Don't include llvm/SlotCalculator.h, or . Move up the inclusion of llvm/Support/Mangler.h. --- Diffs of the changes: Index: llvm/lib/CWriter/Writer.cpp diff -u llvm/lib/CWriter/Writer.cpp:1.110 llvm/lib/CWriter/Writer.cpp:1.111 --- llvm/lib/CWriter/Writer.cpp:1.110 Thu Jul 24 15:20:10 2003 +++ llvm/lib/CWriter/Writer.cpp Fri Jul 25 15:21:06 2003 @@ -12,18 +12,16 @@ #include "llvm/Pass.h" #include "llvm/SymbolTable.h" #include "llvm/Intrinsics.h" -#include "llvm/SlotCalculator.h" #include "llvm/Analysis/FindUsedTypes.h" #include "llvm/Analysis/ConstantsScanner.h" #include "llvm/Support/InstVisitor.h" #include "llvm/Support/InstIterator.h" #include "llvm/Support/CallSite.h" +#include "llvm/Support/Mangler.h" #include "Support/StringExtras.h" #include "Support/STLExtras.h" #include -#include #include -#include "llvm/Support/Mangler.h" namespace { class CWriter : public Pass, public InstVisitor { From gaeke at cs.uiuc.edu Fri Jul 25 15:22:13 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri Jul 25 15:22:13 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Mangler.h Message-ID: <200307252021.PAA32694@neo.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Mangler.h updated: 1.2 -> 1.3 --- Log message: Forward-declare class Module to make the header file self-contained. --- Diffs of the changes: Index: llvm/include/llvm/Support/Mangler.h diff -u llvm/include/llvm/Support/Mangler.h:1.2 llvm/include/llvm/Support/Mangler.h:1.3 --- llvm/include/llvm/Support/Mangler.h:1.2 Thu Jul 24 16:37:54 2003 +++ llvm/include/llvm/Support/Mangler.h Fri Jul 25 15:20:53 2003 @@ -8,6 +8,7 @@ #define LLVM_SUPPORT_MANGLER_H class Value; +class Module; #include #include From gaeke at cs.uiuc.edu Fri Jul 25 15:22:24 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri Jul 25 15:22:24 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/Mangler.cpp Message-ID: <200307252021.PAA32689@neo.cs.uiuc.edu> Changes in directory llvm/lib/Support: Mangler.cpp updated: 1.2 -> 1.3 --- Log message: Include llvm/Support/Mangler.h first. Don't include , , , or llvm/Value.h. Move up the inclusion of llvm/Support/Mangler.h. --- Diffs of the changes: Index: llvm/lib/Support/Mangler.cpp diff -u llvm/lib/Support/Mangler.cpp:1.2 llvm/lib/Support/Mangler.cpp:1.3 --- llvm/lib/Support/Mangler.cpp:1.2 Thu Jul 24 16:37:57 2003 +++ llvm/lib/Support/Mangler.cpp Fri Jul 25 15:21:20 2003 @@ -4,14 +4,10 @@ // //===----------------------------------------------------------------------===// -#include -#include -#include -#include "llvm/Value.h" +#include "llvm/Support/Mangler.h" #include "llvm/Module.h" #include "llvm/Type.h" #include "Support/StringExtras.h" -#include "llvm/Support/Mangler.h" /// makeNameProper - We don't want identifier names with ., space, or /// - in them, so we mangle these characters into the strings "d_", From lattner at cs.uiuc.edu Fri Jul 25 15:46:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 15:46:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/GraphChecker.cpp Message-ID: <200307252045.PAA04310@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: GraphChecker.cpp updated: 1.3 -> 1.4 --- Log message: Add a more general check-flags which can be used to ensure arbitrary flags are set --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/GraphChecker.cpp diff -u llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.3 llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.4 --- llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.3 Sun Jun 29 17:36:15 2003 +++ llvm/lib/Analysis/DataStructure/GraphChecker.cpp Fri Jul 25 15:45:40 2003 @@ -9,8 +9,8 @@ // --dsgc-abort-if-any-collapsed - Abort if any collapsed nodes are found // --dsgc-abort-if-collapsed= - Abort if a node pointed to by an SSA // value with name in is collapsed -// --dsgc-abort-if-incomplete=- Abort if any of the named SSA values -// are incomplete. +// --dsgc-check-flags= - Abort if the specified nodes have flags +// that are not specified. // --dsgc-abort-if-merged= - Abort if any of the named SSA values // point to the same node. // @@ -38,8 +38,8 @@ AbortIfCollapsed("dsgc-abort-if-collapsed", cl::Hidden, cl::CommaSeparated, cl::desc("Abort if any of the named symbols is collapsed")); cl::list - AbortIfIncomplete("dsgc-abort-if-incomplete", cl::Hidden, cl::CommaSeparated, - cl::desc("Abort if any of the named symbols is incomplete")); + CheckFlags("dsgc-check-flags", cl::Hidden, cl::CommaSeparated, + cl::desc("Check that flags are specified for nodes")); cl::list AbortIfMerged("dsgc-abort-if-merged", cl::Hidden, cl::CommaSeparated, cl::desc("Abort if any of the named symbols are merged together")); @@ -68,7 +68,7 @@ DSGC::DSGC() { if (!AbortIfAnyCollapsed && AbortIfCollapsed.empty() && - AbortIfIncomplete.empty() && AbortIfMerged.empty()) { + CheckFlags.empty() && AbortIfMerged.empty()) { std::cerr << "The -datastructure-gc is useless if you don't specify any" " -dsgc-* options. See the -help-hidden output for a list.\n"; abort(); @@ -114,16 +114,39 @@ } } - if (!AbortIfCollapsed.empty() || !AbortIfIncomplete.empty() || + if (!AbortIfCollapsed.empty() || !CheckFlags.empty() || !AbortIfMerged.empty()) { // Convert from a list to a set, because we don't have cl::set's yet. FIXME std::set AbortIfCollapsedS(AbortIfCollapsed.begin(), AbortIfCollapsed.end()); - std::set AbortIfIncompleteS(AbortIfIncomplete.begin(), - AbortIfIncomplete.end()); std::set AbortIfMergedS(AbortIfMerged.begin(), AbortIfMerged.end()); + std::map CheckFlagsM; + for (cl::list::iterator I = CheckFlags.begin(), + E = CheckFlags.end(); I != E; ++I) { + unsigned ColonPos = I->rfind(':'); + if (ColonPos == std::string::npos) { + std::cerr << "Error: '" << *I + << "' is an invalid value for the --dsgc-check-flags option!\n"; + abort(); + } + + unsigned Flags = 0; + for (; ColonPos != I->size(); ++ColonPos) + switch ((*I)[ColonPos]) { + case 'S': Flags |= DSNode::AllocaNode; break; + case 'H': Flags |= DSNode::HeapNode; break; + case 'G': Flags |= DSNode::GlobalNode; break; + case 'U': Flags |= DSNode::UnknownNode; break; + case 'I': Flags |= DSNode::Incomplete; break; + case 'M': Flags |= DSNode::Modified; break; + case 'R': Flags |= DSNode::Read; break; + case 'A': Flags |= DSNode::Array; break; + default: std::cerr << "Invalid DSNode flag!\n"; break; + } + CheckFlagsM[std::string(I->begin(), I->begin()+ColonPos)] = Flags; + } // Now we loop over all of the scalars, checking to see if any are collapsed // that are not supposed to be, or if any are merged together. @@ -133,7 +156,7 @@ for (DSGraph::ScalarMapTy::const_iterator I = SM.begin(), E = SM.end(); I != E; ++I) if (I->first->hasName() && I->second.getNode()) { - std::string Name = I->first->getName(); + const std::string &Name = I->first->getName(); DSNode *N = I->second.getNode(); // Verify it is not collapsed if it is not supposed to be... @@ -143,8 +166,9 @@ abort(); } - if (N->isIncomplete() && AbortIfIncompleteS.count(Name)) { - std::cerr << "Node for value '%" << Name << "' is incomplete: "; + if (CheckFlagsM.count(Name) && CheckFlagsM[Name] != N->getNodeFlags()) { + std::cerr << "Node flags are not as expected for node: " << Name + << "\n"; N->print(std::cerr, &G); abort(); } From lattner at cs.uiuc.edu Fri Jul 25 15:50:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 15:50:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/GraphChecker.cpp Message-ID: <200307252049.PAA04867@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: GraphChecker.cpp updated: 1.4 -> 1.5 --- Log message: Dont' try to parse the colon --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/GraphChecker.cpp diff -u llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.4 llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.5 --- llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.4 Fri Jul 25 15:45:40 2003 +++ llvm/lib/Analysis/DataStructure/GraphChecker.cpp Fri Jul 25 15:49:29 2003 @@ -133,7 +133,7 @@ } unsigned Flags = 0; - for (; ColonPos != I->size(); ++ColonPos) + for (++ColonPos; ColonPos != I->size(); ++ColonPos) switch ((*I)[ColonPos]) { case 'S': Flags |= DSNode::AllocaNode; break; case 'H': Flags |= DSNode::HeapNode; break; @@ -143,7 +143,7 @@ case 'M': Flags |= DSNode::Modified; break; case 'R': Flags |= DSNode::Read; break; case 'A': Flags |= DSNode::Array; break; - default: std::cerr << "Invalid DSNode flag!\n"; break; + default: std::cerr << "Invalid DSNode flag!\n"; abort(); } CheckFlagsM[std::string(I->begin(), I->begin()+ColonPos)] = Flags; } From lattner at cs.uiuc.edu Fri Jul 25 15:55:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 15:55:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll Message-ID: <200307252054.PAA05613@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Analysis/DSGraph: GlobalsGraphFuncPtr.ll added (r1.1) --- Log message: Checkin of Vikram's ggfuncptr.c test adapted for automatic checking --- Diffs of the changes: Index: llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll diff -c /dev/null llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll:1.1 *** /dev/null Fri Jul 25 15:54:08 2003 --- llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll Fri Jul 25 15:53:58 2003 *************** *** 0 **** --- 1,66 ---- + ; Test resolvable and unresolvable calls through function pointers: + ; -- both should be retained in function graphs until resolved or until main + ; -- former should get resolved in or before main() and never appear in GG + ; -- latter should remain unresolved in main() and copied to GG + ; -- globals in GG pointed to by latter should be marked I, but not other nodes + ; + ; RUN: analyze %s -datastructure-gc -dsgc-check-flags=KnownPtr:S,UnknownPtr:SI -dsgc-dspass=bu + + %Z = internal global int 0 + %X = internal global int 0 + %M = internal global int 0 + %.str_1 = internal constant [9 x sbyte] c"&Z = %p\0A\00" + + implementation + + declare int %printf(sbyte*, ...) + declare void %exit_dummy(int*) + + internal void %makeCalls(void (int*)* %GpKnown.1, void (int*)* %GpUnknown.1, + int* %GpKnownPtr, int* %GpUnknownPtr) { + %tmp.0 = load int* %Z + %tmp.1.not = setne int %tmp.0, 0 + br bool %tmp.1.not, label %else, label %then + + then: + ; pass to exit_dummy: never resolved + call void %GpUnknown.1( int* %GpUnknownPtr ) + %tmp.61 = load int* %Z + %inc1 = add int %tmp.61, 1 + store int %inc1, int* %Z + %tmp.71 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([9 x sbyte]* %.str_1, long 0, long 0), int* %Z ) + ret void + + else: + ; pass to knownF: resolved in main + call void %GpKnown.1( int* %GpKnownPtr ) + %tmp.6 = load int* %Z + %inc = add int %tmp.6, 1 + store int %inc, int* %Z + + ; "known external": resolved here + %tmp.7 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([9 x sbyte]* %.str_1, long 0, long 0), int* %Z ) + ret void + } + + internal void %knownF(int* %Y.1) { + %tmp.1 = seteq int* %Y.1, null + br bool %tmp.1, label %then, label %UnifiedExitNode + + then: + call void %knownF( int* %Y.1 ) ; direct call to self: resolved here + br label %UnifiedExitNode + + UnifiedExitNode: + ret void + } + + int %main(int %argc.1) { + %KnownPtr = alloca int + %UnknownPtr = alloca int + store int 1, int* %Z + call void %makeCalls( void (int*)* %knownF, void (int*)* %exit_dummy, + int* %KnownPtr, int* %UnknownPtr ) + ret int 0 + } + From lattner at cs.uiuc.edu Fri Jul 25 15:56:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 15:56:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/DSGraphs/ggfuncptr.c Message-ID: <200307252055.PAA05627@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/DSGraphs: ggfuncptr.c (r1.1) removed --- Log message: Remove testcase which has been automatized --- Diffs of the changes: From vadve at cs.uiuc.edu Fri Jul 25 16:00:01 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Fri Jul 25 16:00:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h Message-ID: <200307252059.PAA25357@psmith.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineInstr.h updated: 1.106 -> 1.107 --- Log message: Add an assertion. --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/MachineInstr.h diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.106 llvm/include/llvm/CodeGen/MachineInstr.h:1.107 --- llvm/include/llvm/CodeGen/MachineInstr.h:1.106 Thu Jul 10 14:45:07 2003 +++ llvm/include/llvm/CodeGen/MachineInstr.h Fri Jul 25 15:58:57 2003 @@ -449,9 +449,8 @@ bool isRegUsed(int regNum) const { return regsUsed.find(regNum) != regsUsed.end(); } - - // insertusedreg - Add a register to the Used registers set... void insertUsedReg(unsigned Reg) { + assert(((int) Reg) >= 0 && "Invalid register being marked as used"); regsUsed.insert((int) Reg); } From vadve at cs.uiuc.edu Fri Jul 25 16:01:01 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Fri Jul 25 16:01:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/PhyRegAlloc.h Message-ID: <200307252100.QAA25371@psmith.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: PhyRegAlloc.h updated: 1.42 -> 1.43 --- Log message: Remove unused field. Change the way unused regs. are marked and found to consider regType info (since multiple reg types may share the same reg class, e.g., single and double on Sparc). --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/PhyRegAlloc.h diff -u llvm/include/llvm/CodeGen/PhyRegAlloc.h:1.42 llvm/include/llvm/CodeGen/PhyRegAlloc.h:1.43 --- llvm/include/llvm/CodeGen/PhyRegAlloc.h:1.42 Sat May 31 02:41:54 2003 +++ llvm/include/llvm/CodeGen/PhyRegAlloc.h Fri Jul 25 16:00:13 2003 @@ -71,8 +71,6 @@ AddedInstrns AddedInstrAtEntry; // to store instrns added at entry LoopInfo *LoopDepthCalc; // to calculate loop depths - std::vector ResColList; // A set of reserved regs if desired. - // currently not used public: PhyRegAlloc(Function *F, const TargetMachine& TM, FunctionLiveVarInfo *Lvi, @@ -87,11 +85,11 @@ // access to register classes by class ID // const RegClass* getRegClassByID(unsigned int id) const { - return RegClassList[id]; + return RegClassList[id]; + } + RegClass* getRegClassByID(unsigned int id) { + return RegClassList[id]; } - RegClass* getRegClassByID(unsigned int id) { - return RegClassList[id]; } - private: void addInterference(const Value *Def, const ValueSet *LVSet, @@ -134,11 +132,14 @@ std::vector& MIBef, std::vector& MIAft); - int getUnusedUniRegAtMI(RegClass *RC, const MachineInstr *MInst, - const ValueSet *LVSetBef); + int getUnusedUniRegAtMI(RegClass *RC, const int RegType, + const MachineInstr *MInst, const ValueSet *LVSetBef); + + void setRelRegsUsedByThisInst(RegClass *RC, const int RegType, + const MachineInstr *MInst ); - void setRelRegsUsedByThisInst(RegClass *RC, const MachineInstr *MInst ); - int getUniRegNotUsedByThisInst(RegClass *RC, const MachineInstr *MInst); + int getUniRegNotUsedByThisInst(RegClass *RC, const int RegType, + const MachineInstr *MInst); void addInterf4PseudoInstr(const MachineInstr *MInst); }; From vadve at cs.uiuc.edu Fri Jul 25 16:02:01 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Fri Jul 25 16:02:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetRegInfo.h Message-ID: <200307252101.QAA25394@psmith.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetRegInfo.h updated: 1.42 -> 1.43 --- Log message: Change the way unused regs. are marked and found to consider regType info (since multiple reg types may share the same reg class). Remove machine-specific regalloc. methods that are no longer needed. --- Diffs of the changes: Index: llvm/include/llvm/Target/TargetRegInfo.h diff -u llvm/include/llvm/Target/TargetRegInfo.h:1.42 llvm/include/llvm/Target/TargetRegInfo.h:1.43 --- llvm/include/llvm/Target/TargetRegInfo.h:1.42 Fri Jul 25 12:58:41 2003 +++ llvm/include/llvm/Target/TargetRegInfo.h Fri Jul 25 16:01:43 2003 @@ -39,13 +39,45 @@ inline unsigned getNumOfAvailRegs() const { return NumOfAvailRegs; } inline unsigned getNumOfAllRegs() const { return NumOfAllRegs; } + // This method marks the registers used for a given register number. + // This defaults to marking a single register but may mark multiple + // registers when a single number denotes paired registers. + // + virtual void markColorsUsed(unsigned RegInClass, + int UserRegType, + int RegTypeWanted, + std::vector &IsColorUsedArr) const { + assert(RegInClass < NumOfAllRegs && RegInClass < IsColorUsedArr.size()); + assert(UserRegType == RegTypeWanted && + "Default method is probably incorrect for class with multiple types."); + IsColorUsedArr[RegInClass] = true; + } + + // This method finds unused registers of the specified register type, + // using the given "used" flag array IsColorUsedArr. It defaults to + // checking a single entry in the array directly, but that can be overridden + // for paired registers and other such silliness. + // It returns -1 if no unused color is found. + // + virtual int findUnusedColor(int RegTypeWanted, + const std::vector &IsColorUsedArr) const { + // find first unused color in the IsColorUsedArr directly + unsigned NC = this->getNumOfAvailRegs(); + assert(IsColorUsedArr.size() >= NC && "Invalid colors-used array"); + for (unsigned c = 0; c < NC; c++) + if (!IsColorUsedArr[c]) + return c; + return -1; + } + // This method should find a color which is not used by neighbors // (i.e., a false position in IsColorUsedArr) and virtual void colorIGNode(IGNode *Node, - std::vector &IsColorUsedArr) const = 0; + const std::vector &IsColorUsedArr) const = 0; + virtual bool isRegVolatile(int Reg) const = 0; - //If any specific register needs extra information + // If any specific register needs extra information virtual bool modifiedByCall(int Reg) const {return false; } virtual const char* const getRegName(unsigned reg) const = 0; @@ -130,14 +162,16 @@ virtual void colorMethodArgs(const Function *Func, LiveRangeInfo &LRI, AddedInstrns *FirstAI) const = 0; - virtual void colorCallArgs(MachineInstr *CalI, - LiveRangeInfo& LRI, AddedInstrns *CallAI, - PhyRegAlloc &PRA, const BasicBlock *BB) const = 0; - - virtual void colorRetValue(MachineInstr *RetI, LiveRangeInfo &LRI, - AddedInstrns *RetAI) const = 0; - - + // Method for inserting caller saving code. The caller must save all the + // volatile registers across a call based on the calling conventions of + // an architecture. This must insert code for saving and restoring + // such registers on + // + virtual void insertCallerSavingCode(std::vector& instrnsBefore, + std::vector& instrnsAfter, + MachineInstr *CallMI, + const BasicBlock *BB, + PhyRegAlloc &PRA) const = 0; // The following methods are used to generate "copy" machine instructions // for an architecture. Currently they are used in TargetRegClass @@ -227,26 +261,17 @@ } // Get the register type for a register identified different ways. - // - virtual int getRegType(const Type* type) const = 0; - virtual int getRegType(const LiveRange *LR) const = 0; + // Note that getRegTypeForLR(LR) != getRegTypeForDataType(LR->getType())! + // The reg class of a LR depends both on the Value types in it and whether + // they are CC registers or not (for example). + virtual int getRegTypeForDataType(const Type* type) const = 0; + virtual int getRegTypeForLR(const LiveRange *LR) const = 0; virtual int getRegType(int unifiedRegNum) const = 0; // The following methods are used to get the frame/stack pointers // virtual unsigned getFramePointer() const = 0; virtual unsigned getStackPointer() const = 0; - - // Method for inserting caller saving code. The caller must save all the - // volatile registers across a call based on the calling conventions of - // an architecture. This must insert code for saving and restoring - // such registers on - // - virtual void insertCallerSavingCode(std::vector& instrnsBefore, - std::vector& instrnsAfter, - MachineInstr *MInst, - const BasicBlock *BB, - PhyRegAlloc &PRA) const = 0; // This method gives the the number of bytes of stack spaceallocated // to a register when it is spilled to the stack. From vadve at cs.uiuc.edu Fri Jul 25 16:07:00 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Fri Jul 25 16:07:00 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp PhyRegAlloc.cpp RegClass.cpp RegClass.h Message-ID: <200307252106.QAA25418@psmith.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/RegAlloc: LiveRangeInfo.cpp updated: 1.41 -> 1.42 PhyRegAlloc.cpp updated: 1.98 -> 1.99 RegClass.cpp updated: 1.22 -> 1.23 RegClass.h updated: 1.16 -> 1.17 --- Log message: (1) Change the way unused regs. are marked and found to consider regType info (since multiple reg types may share the same reg class). (2) Remove machine-specific regalloc. methods that are no longer needed. In particular, arguments and return value from a call do not need machine-specific code for allocation. (3) Rename TargetRegInfo::getRegType variants to avoid unintentional overloading when an include file is omitted. --- Diffs of the changes: Index: llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp diff -u llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp:1.41 llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp:1.42 --- llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp:1.41 Sat May 31 02:32:01 2003 +++ llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp Fri Jul 25 16:06:09 2003 @@ -12,6 +12,7 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" +#include "llvm/Target/TargetRegInfo.h" #include "llvm/Function.h" #include "Support/SetOperations.h" using std::cerr; @@ -354,7 +355,8 @@ if (LROfUse == LROfDef) // nothing to merge if they are same continue; - if (MRI.getRegType(LROfDef) == MRI.getRegType(LROfUse)) { + if (MRI.getRegTypeForLR(LROfDef) == + MRI.getRegTypeForLR(LROfUse)) { // If the two RegTypes are the same if (!RCOfDef->getInterference(LROfDef, LROfUse) ) { Index: llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp diff -u llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp:1.98 llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp:1.99 --- llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp:1.98 Thu Jul 10 14:42:55 2003 +++ llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp Fri Jul 25 16:06:09 2003 @@ -18,6 +18,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetInstrInfo.h" +#include "llvm/Target/TargetRegInfo.h" #include "llvm/Function.h" #include "llvm/Type.h" #include "llvm/iOther.h" @@ -87,8 +88,8 @@ // create each RegisterClass and put in RegClassList // for (unsigned rc=0; rc != NumOfRegClasses; rc++) - RegClassList.push_back(new RegClass(F, MRI.getMachineRegClass(rc), - &ResColList)); + RegClassList.push_back(new RegClass(F, &tm.getRegInfo(), + MRI.getMachineRegClass(rc))); } @@ -488,7 +489,6 @@ } } - void PhyRegAlloc::updateInstruction(MachineInstr* MInst, BasicBlock* BB) { unsigned Opcode = MInst->getOpCode(); @@ -521,21 +521,16 @@ // as a sanity check. OperandsColoredMap[MInst] = true; - // Now insert special instructions (if necessary) for call/return - // instructions. Do this before inserting spill code since some - // registers must be used by outgoing call arguments or the return value - // of a call, and spill code should not use those registers. + // Now insert caller-saving code before/after the call. + // Do this before inserting spill code since some registers must be + // used by save/restore and spill code should not use those registers. // - if (TM.getInstrInfo().isCall(Opcode) || - TM.getInstrInfo().isReturn(Opcode)) { + if (TM.getInstrInfo().isCall(Opcode)) { AddedInstrns &AI = AddedInstrMap[MInst]; - - if (TM.getInstrInfo().isCall(Opcode)) - MRI.colorCallArgs(MInst, LRI, &AI, *this, BB); - else if (TM.getInstrInfo().isReturn(Opcode)) - MRI.colorRetValue(MInst, LRI, &AI); + MRI.insertCallerSavingCode(AI.InstrnsBefore, AI.InstrnsAfter, + MInst, BB, *this); } - + // Now insert spill code for remaining operands not allocated to // registers. This must be done even for call return instructions // since those are not handled by the special code above. @@ -573,7 +568,7 @@ // Also, fix operands of call/return instructions. // for (MachineBasicBlock::iterator MII = MBB.begin(); MII != MBB.end(); ++MII) - if (!TM.getInstrInfo().isDummyPhiInstr((*MII)->getOpCode())) // ignore Phis + if (!TM.getInstrInfo().isDummyPhiInstr((*MII)->getOpCode()))// ignore Phis updateInstruction(*MII, MBB.getBasicBlock()); // Now, move code out of delay slots of branches and returns if needed. @@ -644,34 +639,46 @@ // Finally iterate over all instructions in BB and insert before/after // - for (MachineBasicBlock::iterator MII = MBB.begin(); - MII != MBB.end(); ++MII) { - + for (MachineBasicBlock::iterator MII=MBB.begin(); MII != MBB.end(); ++MII) { MachineInstr *MInst = *MII; - unsigned Opcode = MInst->getOpCode(); - + // do not process Phis - if (TM.getInstrInfo().isDummyPhiInstr(Opcode)) + if (TM.getInstrInfo().isDummyPhiInstr(MInst->getOpCode())) continue; - // Now add instructions that the register allocator inserts before/after - // this machine instructions (done only for calls/rets/incoming args) - // We do this here, to ensure that spill for an instruction is inserted - // closest as possible to an instruction (see above insertCode4Spill...) - - // If there are instructions to be added, *before* this machine - // instruction, add them now. - // + // if there are any added instructions... if (AddedInstrMap.count(MInst)) { - PrependInstructions(AddedInstrMap[MInst].InstrnsBefore, MBB, MII,""); - } - - // If there are instructions to be added *after* this machine - // instruction, add them now. All cases with delay slots have been - // c - if (!AddedInstrMap[MInst].InstrnsAfter.empty()) { - AppendInstructions(AddedInstrMap[MInst].InstrnsAfter, MBB, MII,""); - } + AddedInstrns &CallAI = AddedInstrMap[MInst]; + +#ifndef NDEBUG + // Temporary sanity checking code to detect whether the same machine + // instruction is ever inserted twice before/after a call. + // I suspect this is happening but am not sure. --Vikram, 7/1/03. + // + std::set instrsSeen; + for (int i = 0, N = CallAI.InstrnsBefore.size(); i < N; ++i) { + assert(instrsSeen.count(CallAI.InstrnsBefore[i]) == 0 && + "Duplicate machine instruction in InstrnsBefore!"); + instrsSeen.insert(CallAI.InstrnsBefore[i]); + } + for (int i = 0, N = CallAI.InstrnsAfter.size(); i < N; ++i) { + assert(instrsSeen.count(CallAI.InstrnsAfter[i]) == 0 && + "Duplicate machine instruction in InstrnsBefore/After!"); + instrsSeen.insert(CallAI.InstrnsAfter[i]); + } +#endif + + // Now add the instructions before/after this MI. + // We do this here to ensure that spill for an instruction is inserted + // as close as possible to an instruction (see above insertCode4Spill) + // + if (! CallAI.InstrnsBefore.empty()) + PrependInstructions(CallAI.InstrnsBefore, MBB, MII,""); + + if (! CallAI.InstrnsAfter.empty()) + AppendInstructions(CallAI.InstrnsAfter, MBB, MII,""); + + } // if there are any added instructions } // for each machine instruction } @@ -687,6 +694,7 @@ // used by other spilled operands of the same instruction. Then it uses // this register temporarily to accomodate the spilled value. //---------------------------------------------------------------------------- + void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR, MachineInstr *MInst, const BasicBlock *BB, @@ -700,7 +708,7 @@ MachineOperand& Op = MInst->getOperand(OpNum); bool isDef = Op.opIsDefOnly(); bool isDefAndUse = Op.opIsDefAndUse(); - unsigned RegType = MRI.getRegType(LR); + unsigned RegType = MRI.getRegTypeForLR(LR); int SpillOff = LR->getSpillOffFromFP(); RegClass *RC = LR->getRegClass(); const ValueSet &LVSetBef = LVI->getLiveVarSetBeforeMInst(MInst, BB); @@ -793,7 +801,7 @@ RegClass* RC = getRegClassByID(MRI.getRegClassIDOfRegType(RegType)); - int RegU = getUnusedUniRegAtMI(RC, MInst, LVSetBef); + int RegU = getUnusedUniRegAtMI(RC, RegType, MInst, LVSetBef); if (RegU == -1) { // we couldn't find an unused register. Generate code to free up a reg by @@ -801,7 +809,7 @@ int TmpOff = MF.getInfo()->pushTempValue(MRI.getSpilledRegSize(RegType)); - RegU = getUniRegNotUsedByThisInst(RC, MInst); + RegU = getUniRegNotUsedByThisInst(RC, RegType, MInst); // Check if we need a scratch register to copy this register to memory. int scratchRegType = -1; @@ -841,40 +849,37 @@ //---------------------------------------------------------------------------- int PhyRegAlloc::getUnusedUniRegAtMI(RegClass *RC, - const MachineInstr *MInst, - const ValueSet *LVSetBef) { - - unsigned NumAvailRegs = RC->getNumOfAvailRegs(); + const int RegType, + const MachineInstr *MInst, + const ValueSet *LVSetBef) { - std::vector &IsColorUsedArr = RC->getIsColorUsedArr(); + RC->clearColorsUsed(); // Reset array - for (unsigned i=0; i < NumAvailRegs; i++) // Reset array - IsColorUsedArr[i] = false; - ValueSet::const_iterator LIt = LVSetBef->begin(); // for each live var in live variable set after machine inst for ( ; LIt != LVSetBef->end(); ++LIt) { - // get the live range corresponding to live var + // get the live range corresponding to live var, and its RegClass LiveRange *const LRofLV = LRI.getLiveRangeForValue(*LIt ); // LR can be null if it is a const since a const // doesn't have a dominating def - see Assumptions above - if (LRofLV && LRofLV->getRegClass() == RC && LRofLV->hasColor() ) - IsColorUsedArr[ LRofLV->getColor() ] = true; + if (LRofLV && LRofLV->getRegClass() == RC && LRofLV->hasColor()) + RC->markColorsUsed(LRofLV->getColor(), + MRI.getRegTypeForLR(LRofLV), RegType); } // It is possible that one operand of this MInst was already spilled // and it received some register temporarily. If that's the case, // it is recorded in machine operand. We must skip such registers. // - setRelRegsUsedByThisInst(RC, MInst); + setRelRegsUsedByThisInst(RC, RegType, MInst); + + int unusedReg = RC->getUnusedColor(RegType); // find first unused color + if (unusedReg >= 0) + return MRI.getUnifiedRegNum(RC->getID(), unusedReg); - for (unsigned c=0; c < NumAvailRegs; c++) // find first unused color - if (!IsColorUsedArr[c]) - return MRI.getUnifiedRegNum(RC->getID(), c); - return -1; } @@ -884,22 +889,18 @@ // by operands of a machine instruction. Returns the unified reg number. //---------------------------------------------------------------------------- int PhyRegAlloc::getUniRegNotUsedByThisInst(RegClass *RC, + const int RegType, const MachineInstr *MInst) { + RC->clearColorsUsed(); - vector &IsColorUsedArr = RC->getIsColorUsedArr(); - unsigned NumAvailRegs = RC->getNumOfAvailRegs(); + setRelRegsUsedByThisInst(RC, RegType, MInst); - for (unsigned i=0; i < NumAvailRegs ; i++) // Reset array - IsColorUsedArr[i] = false; + // find the first unused color + int unusedReg = RC->getUnusedColor(RegType); + assert(unusedReg >= 0 && + "FATAL: No free register could be found in reg class!!"); - setRelRegsUsedByThisInst(RC, MInst); - - for (unsigned c=0; c < RC->getNumOfAvailRegs(); c++)// find first unused color - if (!IsColorUsedArr[c]) - return MRI.getUnifiedRegNum(RC->getID(), c); - - assert(0 && "FATAL: No free register could be found in reg class!!"); - return 0; + return MRI.getUnifiedRegNum(RC->getID(), unusedReg); } @@ -908,30 +909,26 @@ // It sets the bits corresponding to the registers used by this machine // instructions. Both explicit and implicit operands are set. //---------------------------------------------------------------------------- + void PhyRegAlloc::setRelRegsUsedByThisInst(RegClass *RC, + const int RegType, const MachineInstr *MInst ) { assert(OperandsColoredMap[MInst] == true && "Illegal to call setRelRegsUsedByThisInst() until colored operands " "are marked for an instruction."); - vector &IsColorUsedArr = RC->getIsColorUsedArr(); - // Add the registers already marked as used by the instruction. // This should include any scratch registers that are used to save // values across the instruction (e.g., for saving state register values). const std::set ®sUsed = MInst->getRegsUsed(); - for (std::set::iterator I=regsUsed.begin(), E=regsUsed.end(); I != E; ++I) + for (std::set::iterator I=regsUsed.begin(),E=regsUsed.end(); I != E; ++I) { int i = *I; unsigned classId = 0; int classRegNum = MRI.getClassRegNum(i, classId); if (RC->getID() == classId) - { - assert(classRegNum < (int) IsColorUsedArr.size() && - "Illegal register number for this reg class?"); - IsColorUsedArr[classRegNum] = true; - } + RC->markColorsUsed(classRegNum, RegType, RegType); } // If there are implicit references, mark their allocated regs as well @@ -941,7 +938,8 @@ LRofImpRef = LRI.getLiveRangeForValue(MInst->getImplicitRef(z))) if (LRofImpRef->hasColor()) // this implicit reference is in a LR that received a color - IsColorUsedArr[LRofImpRef->getColor()] = true; + RC->markColorsUsed(LRofImpRef->getColor(), + MRI.getRegTypeForLR(LRofImpRef), RegType); } Index: llvm/lib/CodeGen/RegAlloc/RegClass.cpp diff -u llvm/lib/CodeGen/RegAlloc/RegClass.cpp:1.22 llvm/lib/CodeGen/RegAlloc/RegClass.cpp:1.23 --- llvm/lib/CodeGen/RegAlloc/RegClass.cpp:1.22 Wed Jan 15 15:02:16 2003 +++ llvm/lib/CodeGen/RegAlloc/RegClass.cpp Fri Jul 25 16:06:09 2003 @@ -7,6 +7,7 @@ #include "RegClass.h" #include "RegAllocCommon.h" #include "llvm/CodeGen/IGNode.h" +#include "llvm/Target/TargetRegInfo.h" using std::cerr; //---------------------------------------------------------------------------- @@ -14,14 +15,15 @@ // createInterferenceGraph() above. //---------------------------------------------------------------------------- RegClass::RegClass(const Function *M, - const TargetRegClassInfo *Mrc, - const ReservedColorListType *RCL) - : Meth(M), MRC(Mrc), RegClassID( Mrc->getRegClassID() ), - IG(this), IGNodeStack(), ReservedColorList(RCL) { + const TargetRegInfo *_MRI_, + const TargetRegClassInfo *_MRC_) + : Meth(M), MRI(_MRI_), MRC(_MRC_), + RegClassID( _MRC_->getRegClassID() ), + IG(this), IGNodeStack() { if( DEBUG_RA >= RA_DEBUG_Interference) cerr << "Created Reg Class: " << RegClassID << "\n"; - IsColorUsedArr.resize(Mrc->getNumOfAllRegs()); + IsColorUsedArr.resize(MRC->getNumOfAllRegs()); } @@ -133,7 +135,7 @@ if( IGNode->isOnStack() ) continue; // if the degree of IGNode is lower - if( (unsigned) IGNode->getCurDegree() < MRC->getNumOfAvailRegs() ) { + if( (unsigned) IGNode->getCurDegree() < MRC->getNumOfAvailRegs()) { IGNodeStack.push( IGNode ); // push IGNode on to the stack IGNode->pushOnStack(); // set OnStack and dec deg of neighs @@ -205,17 +207,8 @@ if( ! Node->hasColor() ) { // not colored as an arg etc. - // init all elements of to IsColorUsedAr false; - // - for (unsigned i=0; i < MRC->getNumOfAllRegs(); i++) - IsColorUsedArr[i] = false; - - // init all reserved_regs to true - we can't use them - // - for( unsigned i=0; i < ReservedColorList->size() ; i++) { - IsColorUsedArr[(*ReservedColorList)[i]] = true; - } + clearColorsUsed(); // initialize all colors used by neighbors of this node to true LiveRange *LR = Node->getParentLR(); @@ -224,15 +217,22 @@ IGNode *NeighIGNode = Node->getAdjIGNode(n); LiveRange *NeighLR = NeighIGNode->getParentLR(); - if (NeighLR->hasColor()) { // if has a color - IsColorUsedArr[NeighLR->getColor()] = true; // mark color as used - } else if (NeighLR->hasSuggestedColor() && - NeighLR->isSuggestedColorUsable()) { - // this color is suggested for the neighbour, so don't use it - IsColorUsedArr[NeighLR->getSuggestedColor()] = true; - } + // Don't use a color if it is in use by the neighbour, + // or is suggested for use by the neighbour, + // markColorsUsed() should be given the color and the reg type for + // LR, not for NeighLR, because it should mark registers used based on + // the type we are looking for, not on the regType for the neighbour. + if (NeighLR->hasColor()) + this->markColorsUsed(NeighLR->getColor(), + MRI->getRegTypeForLR(NeighLR), + MRI->getRegTypeForLR(LR)); // use LR, not NeighLR + else if (NeighLR->hasSuggestedColor() && + NeighLR->isSuggestedColorUsable()) + this->markColorsUsed(NeighLR->getSuggestedColor(), + MRI->getRegTypeForLR(NeighLR), + MRI->getRegTypeForLR(LR)); // use LR, not NeighLR } - + // call the target specific code for coloring // MRC->colorIGNode(Node, IsColorUsedArr); Index: llvm/lib/CodeGen/RegAlloc/RegClass.h diff -u llvm/lib/CodeGen/RegAlloc/RegClass.h:1.16 llvm/lib/CodeGen/RegAlloc/RegClass.h:1.17 --- llvm/lib/CodeGen/RegAlloc/RegClass.h:1.16 Wed Jan 15 15:02:16 2003 +++ llvm/lib/CodeGen/RegAlloc/RegClass.h Fri Jul 25 16:06:09 2003 @@ -13,8 +13,6 @@ #include class TargetRegClassInfo; -typedef std::vector ReservedColorListType; - //----------------------------------------------------------------------------- // Class RegClass @@ -35,18 +33,14 @@ //----------------------------------------------------------------------------- class RegClass { const Function *const Meth; // Function we are working on - const TargetRegClassInfo *const MRC; // corresponding MRC + const TargetRegInfo *MRI; // Machine register information + const TargetRegClassInfo *const MRC; // Machine reg. class for this RegClass const unsigned RegClassID; // my int ID InterferenceGraph IG; // Interference graph - constructed by // buildInterferenceGraph std::stack IGNodeStack; // the stack used for coloring - // ReservedColorList - for passing registers that are pre-allocated and cannot - // be used by the register allocator for this function. - // - const ReservedColorListType *const ReservedColorList; - // IsColorUsedArr - An array used for coloring each node. This array must be // of size MRC->getNumOfAllRegs(). Allocated once in the constructor for // efficiency. @@ -65,12 +59,24 @@ void colorIGNode(IGNode *const Node); + // This directly marks the colors used by a particular register number + // within the register class. External users should use the public + // versions of this function below. + inline void markColorUsed(unsigned classRegNum) { + assert(classRegNum < IsColorUsedArr.size() && "Invalid register used?"); + IsColorUsedArr[classRegNum] = true; + } + + inline bool isColorUsed(unsigned regNum) const { + assert(regNum < IsColorUsedArr.size() && "Invalid register used?"); + return IsColorUsedArr[regNum]; + } public: RegClass(const Function *M, - const TargetRegClassInfo *MRC, - const ReservedColorListType *RCL = 0); + const TargetRegInfo *_MRI_, + const TargetRegClassInfo *_MRC_); inline void createInterferenceGraph() { IG.createGraph(); } @@ -78,6 +84,8 @@ inline const unsigned getID() const { return RegClassID; } + inline const TargetRegClassInfo* getTargetRegClass() const { return MRC; } + // main method called for coloring regs // void colorAllRegs(); @@ -105,8 +113,18 @@ { IG.mergeIGNodesOfLRs(LR1, LR2); } - inline std::vector &getIsColorUsedArr() { return IsColorUsedArr; } - + inline void clearColorsUsed() { + IsColorUsedArr.clear(); + IsColorUsedArr.resize(MRC->getNumOfAllRegs()); + } + inline void markColorsUsed(unsigned ClassRegNum, + int UserRegType, + int RegTypeWanted) { + MRC->markColorsUsed(ClassRegNum, UserRegType, RegTypeWanted,IsColorUsedArr); + } + inline int getUnusedColor(int machineRegType) const { + return MRC->findUnusedColor(machineRegType, IsColorUsedArr); + } void printIGNodeList() const; void printIG(); From lattner at cs.uiuc.edu Fri Jul 25 16:10:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 16:10:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/DSGraphs/ggcollapse.c Message-ID: <200307252109.QAA05891@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/DSGraphs: ggcollapse.c (r1.1) removed --- Log message: This test has been automatized --- Diffs of the changes: From lattner at cs.uiuc.edu Fri Jul 25 16:10:15 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 16:10:15 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll 2003-06-30-TopDownResolve.ll Message-ID: <200307252109.QAA05876@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Analysis/DSGraph: 2003-06-29-IncompleteTDPass.ll updated: 1.1 -> 1.2 2003-06-30-TopDownResolve.ll updated: 1.2 -> 1.3 --- Log message: Update to use more modern graph checker --- Diffs of the changes: Index: llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll diff -u llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll:1.1 llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll:1.2 --- llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll:1.1 Sun Jun 29 17:35:55 2003 +++ llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll Fri Jul 25 16:09:20 2003 @@ -1,4 +1,4 @@ -; RUN: analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-abort-if-incomplete=Ptr +; RUN: analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=Ptr:HR Index: llvm/test/Regression/Analysis/DSGraph/2003-06-30-TopDownResolve.ll diff -u llvm/test/Regression/Analysis/DSGraph/2003-06-30-TopDownResolve.ll:1.2 llvm/test/Regression/Analysis/DSGraph/2003-06-30-TopDownResolve.ll:1.3 --- llvm/test/Regression/Analysis/DSGraph/2003-06-30-TopDownResolve.ll:1.2 Tue Jul 1 11:28:32 2003 +++ llvm/test/Regression/Analysis/DSGraph/2003-06-30-TopDownResolve.ll Fri Jul 25 16:09:20 2003 @@ -1,4 +1,4 @@ -; RUN: analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-abort-if-incomplete=X +; RUN: analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=X:GM %G = internal global int 5 From lattner at cs.uiuc.edu Fri Jul 25 16:10:28 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 16:10:28 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Analysis/DSGraph/2003-07-16-ConstantExprCollapse.ll Message-ID: <200307252109.QAA05798@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Analysis/DSGraph: 2003-07-16-ConstantExprCollapse.ll added (r1.1) --- Log message: New testcase, an automatized version of Vikrams ggcollapse.c file --- Diffs of the changes: Index: llvm/test/Regression/Analysis/DSGraph/2003-07-16-ConstantExprCollapse.ll diff -c /dev/null llvm/test/Regression/Analysis/DSGraph/2003-07-16-ConstantExprCollapse.ll:1.1 *** /dev/null Fri Jul 25 16:09:21 2003 --- llvm/test/Regression/Analysis/DSGraph/2003-07-16-ConstantExprCollapse.ll Fri Jul 25 16:09:11 2003 *************** *** 0 **** --- 1,15 ---- + ; This should cause the global node to collapse!! + ; + ; RUN: analyze %s -datastructure-gc --dsgc-check-flags=test:GAU + + %Tree = type { int, %Tree*, %Tree* } + %T5 = external global %Tree + + implementation ; Functions: + + void %makeMore(%Tree** %X) { + store %Tree* cast (long add (long cast (%Tree* %T5 to long), long 5) to %Tree*), %Tree** %X + %test = load %Tree** %X + ret void + } + From vadve at cs.uiuc.edu Fri Jul 25 16:10:41 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Fri Jul 25 16:10:41 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcInstrSelection.cpp Message-ID: <200307252109.QAA25433@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcInstrSelection.cpp updated: 1.107 -> 1.108 --- Log message: 1. Fix a case that was marking the invalid reg. num. (-1) as used, causing a nasty array bound error later. 2. Fix silly typo causing logical shift of unsigned long to use SRL instead of SRLX. --- Diffs of the changes: Index: llvm/lib/Target/Sparc/SparcInstrSelection.cpp diff -u llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.107 llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.108 --- llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.107 Thu Jul 10 15:07:54 2003 +++ llvm/lib/Target/Sparc/SparcInstrSelection.cpp Fri Jul 25 16:08:58 2003 @@ -1538,7 +1538,7 @@ BuildMI(V9::JMPLRETi, 3).addReg(returnAddrTmp).addSImm(8) .addMReg(target.getRegInfo().getZeroRegNum(), MOTy::Def); - // If ther is a value to return, we need to: + // If there is a value to return, we need to: // (a) Sign-extend the value if it is smaller than 8 bytes (reg size) // (b) Insert a copy to copy the return value to the appropriate reg. // -- For FP values, create a FMOVS or FMOVD instruction @@ -1580,7 +1580,7 @@ new TmpInstruction(mcfi, retValToUse, NULL, "argReg"); retMI->addImplicitRef(retVReg); - + if (retType->isFloatingPoint()) M = (BuildMI(retType==Type::FloatTy? V9::FMOVS : V9::FMOVD, 2) .addReg(retValToUse).addReg(retVReg, MOTy::Def)); @@ -2511,7 +2511,7 @@ CallArgInfo& argInfo = argDesc->getArgInfo(argNo); Value* argVal = argInfo.getArgVal(); // don't use callInstr arg here const Type* argType = argVal->getType(); - unsigned regType = regInfo.getRegType(argType); + unsigned regType = regInfo.getRegTypeForDataType(argType); unsigned argSize = target.getTargetData().getTypeSize(argType); int regNumForArg = TargetRegInfo::getInvalidRegNum(); unsigned regClassIDOfArgReg; @@ -2523,15 +2523,31 @@ // K = #integer argument registers. bool isFPArg = argVal->getType()->isFloatingPoint(); if (isVarArgs && isFPArg) { - // If it is a function with no prototype, pass value - // as an FP value as well as a varargs value - if (noPrototype) - argInfo.setUseFPArgReg(); - - // If this arg. is in the first $K$ regs, add copy- + + if (noPrototype) { + // It is a function with no prototype: pass value + // as an FP value as well as a varargs value. The FP value + // may go in a register or on the stack. The copy instruction + // to the outgoing reg/stack is created by the normal argument + // handling code since this is the "normal" passing mode. + // + regNumForArg = regInfo.regNumForFPArg(regType, + false, false, argNo, + regClassIDOfArgReg); + if (regNumForArg == regInfo.getInvalidRegNum()) + argInfo.setUseStackSlot(); + else + argInfo.setUseFPArgReg(); + } + + // If this arg. is in the first $K$ regs, add special copy- // float-to-int instructions to pass the value as an int. - // To check if it is in teh first $K$, get the register - // number for the arg #i. + // To check if it is in the first $K$, get the register + // number for the arg #i. These copy instructions are + // generated here because they are extra cases and not needed + // for the normal argument handling (some code reuse is + // possible though -- later). + // int copyRegNum = regInfo.regNumForIntArg(false, false, argNo, regClassIDOfArgReg); if (copyRegNum != regInfo.getInvalidRegNum()) { @@ -2543,7 +2559,7 @@ argVal, NULL, "argRegCopy"); callMI->addImplicitRef(argVReg); - + // Get a temp stack location to use to copy // float-to-int via the stack. // @@ -2630,7 +2646,9 @@ M = BuildMI(storeOpCode, 3).addReg(argVal) .addMReg(regInfo.getStackPointer()).addSImm(argOffset); mvec.push_back(M); - } else { + } + else if (regNumForArg != regInfo.getInvalidRegNum()) { + // Create a virtual register to represent the arg reg. Mark // this vreg as being an implicit operand of the call MI. TmpInstruction* argVReg = @@ -2656,6 +2674,9 @@ mvec.push_back(M); } + else + assert(argInfo.getArgCopy() != regInfo.getInvalidRegNum() && + "Arg. not in stack slot, primary or secondary register?"); } // add call instruction and delay slot before copying return value @@ -2736,7 +2757,7 @@ "Shr unsupported for other types"); Add3OperandInstr(opType->isSigned() ? (opType == Type::LongTy ? V9::SRAXr6 : V9::SRAr5) - : (opType == Type::LongTy ? V9::SRLXr6 : V9::SRLr5), + : (opType == Type::ULongTy ? V9::SRLXr6 : V9::SRLr5), subtreeRoot, mvec); break; } From vadve at cs.uiuc.edu Fri Jul 25 16:13:00 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Fri Jul 25 16:13:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcInternals.h SparcRegClassInfo.cpp SparcRegClassInfo.h SparcRegInfo.cpp Message-ID: <200307252112.QAA25458@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcInternals.h updated: 1.94 -> 1.95 SparcRegClassInfo.cpp updated: 1.24 -> 1.25 SparcRegClassInfo.h updated: 1.18 -> 1.19 SparcRegInfo.cpp updated: 1.104 -> 1.105 --- Log message: (1) Major fix to the way unused regs. are marked and found for the FP Single and FP double reg types (which share the same reg class). Now all methods marking/finding unused regs consider the regType within the reg class, and SparcFloatRegClass specializes this code. (2) Remove machine-specific regalloc. methods that are no longer needed. In particular, arguments and return value from a call do not need machine-specific code for allocation. (3) Rename TargetRegInfo::getRegType variants to avoid unintentional overloading when an include file is omitted. --- Diffs of the changes: Index: llvm/lib/Target/Sparc/SparcInternals.h diff -u llvm/lib/Target/Sparc/SparcInternals.h:1.94 llvm/lib/Target/Sparc/SparcInternals.h:1.95 --- llvm/lib/Target/Sparc/SparcInternals.h:1.94 Sun Jul 20 10:38:04 2003 +++ llvm/lib/Target/Sparc/SparcInternals.h Fri Jul 25 16:12:15 2003 @@ -385,13 +385,13 @@ void colorMethodArgs(const Function *Meth, LiveRangeInfo &LRI, AddedInstrns *FirstAI) const; - void colorCallArgs(MachineInstr *CallMI, LiveRangeInfo &LRI, - AddedInstrns *CallAI, PhyRegAlloc &PRA, - const BasicBlock *BB) const; - - void colorRetValue(MachineInstr *RetI, LiveRangeInfo& LRI, - AddedInstrns *RetAI) const; - + // This method inserts the caller saving code for call instructions + // + void insertCallerSavingCode(std::vector& instrnsBefore, + std::vector& instrnsAfter, + MachineInstr *CallMI, + const BasicBlock *BB, + PhyRegAlloc &PRA ) const; // method used for printing a register for debugging purposes // @@ -452,19 +452,15 @@ } // Get the register type for a register identified different ways. - int getRegType(const Type* type) const; - int getRegType(const LiveRange *LR) const; + // Note that getRegTypeForLR(LR) != getRegTypeForDataType(LR->getType())! + // The reg class of a LR depends both on the Value types in it and whether + // they are CC registers or not (for example). + int getRegTypeForDataType(const Type* type) const; + int getRegTypeForLR(const LiveRange *LR) const; int getRegType(int unifiedRegNum) const; virtual unsigned getFramePointer() const; virtual unsigned getStackPointer() const; - - // This method inserts the caller saving code for call instructions - // - void insertCallerSavingCode(std::vector& instrnsBefore, - std::vector& instrnsAfter, - MachineInstr *MInst, - const BasicBlock *BB, PhyRegAlloc &PRA ) const; }; Index: llvm/lib/Target/Sparc/SparcRegClassInfo.cpp diff -u llvm/lib/Target/Sparc/SparcRegClassInfo.cpp:1.24 llvm/lib/Target/Sparc/SparcRegClassInfo.cpp:1.25 --- llvm/lib/Target/Sparc/SparcRegClassInfo.cpp:1.24 Thu Jul 10 14:42:11 2003 +++ llvm/lib/Target/Sparc/SparcRegClassInfo.cpp Fri Jul 25 16:12:15 2003 @@ -5,6 +5,7 @@ //===----------------------------------------------------------------------===// #include "SparcRegClassInfo.h" +#include "SparcInternals.h" #include "llvm/Type.h" #include "../../CodeGen/RegAlloc/RegAllocCommon.h" // FIXME! @@ -22,7 +23,7 @@ // //----------------------------------------------------------------------------- void SparcIntRegClass::colorIGNode(IGNode * Node, - std::vector &IsColorUsedArr) const + const std::vector &IsColorUsedArr) const { LiveRange *LR = Node->getParentLR(); @@ -129,7 +130,7 @@ // depends solely on the opcode, so the name can be chosen in EmitAssembly. //----------------------------------------------------------------------------- void SparcIntCCRegClass::colorIGNode(IGNode *Node, - std::vector &IsColorUsedArr) const + const std::vector &IsColorUsedArr) const { if (Node->getNumOfNeighbors() > 0) Node->getParentLR()->markForSpill(); @@ -177,13 +178,21 @@ // //---------------------------------------------------------------------------- void SparcFloatRegClass::colorIGNode(IGNode * Node, - std::vector &IsColorUsedArr) const + const std::vector &IsColorUsedArr) const { LiveRange *LR = Node->getParentLR(); - // Mark the second color for double-precision registers: - // This is UGLY and should be merged into nearly identical code - // in RegClass::colorIGNode that handles the first color. +#ifndef NDEBUG + // Check that the correct colors have been are marked for fp-doubles. + // + // FIXME: This is old code that is no longer needed. Temporarily converting + // it into a big assertion just to check that the replacement logic + // (invoking SparcFloatRegClass::markColorsUsed() directly from + // RegClass::colorIGNode) works correctly. + // + // In fact, this entire function should be identical to + // SparcIntRegClass::colorIGNode(), and perhaps can be + // made into a general case in CodeGen/RegAlloc/RegClass.cpp. // unsigned NumNeighbors = Node->getNumOfNeighbors(); // total # of neighbors for(unsigned n=0; n < NumNeighbors; n++) { // for each neigh @@ -192,17 +201,19 @@ if (NeighLR->hasColor() && NeighLR->getType() == Type::DoubleTy) { - IsColorUsedArr[ (NeighLR->getColor()) + 1 ] = true; + assert(IsColorUsedArr[ NeighLR->getColor() ] && + IsColorUsedArr[ NeighLR->getColor()+1 ]); } else if (NeighLR->hasSuggestedColor() && NeighLR-> isSuggestedColorUsable() ) { // if the neighbour can use the suggested color - IsColorUsedArr[ NeighLR->getSuggestedColor() ] = true; + assert(IsColorUsedArr[ NeighLR->getSuggestedColor() ]); if (NeighLR->getType() == Type::DoubleTy) - IsColorUsedArr[ (NeighLR->getSuggestedColor()) + 1 ] = true; + assert(IsColorUsedArr[ NeighLR->getSuggestedColor()+1 ]); } } +#endif // **NOTE: We don't check for call interferences in allocating suggested // color in this class since ALL registers are volatile. If this fact @@ -275,6 +286,58 @@ } } +//----------------------------------------------------------------------------- +// This method marks the registers used for a given register number. +// This marks a single register for Float regs, but the R,R+1 pair +// for double-precision registers. +//----------------------------------------------------------------------------- + +void SparcFloatRegClass::markColorsUsed(unsigned RegInClass, + int UserRegType, + int RegTypeWanted, + std::vector &IsColorUsedArr) const +{ + if (UserRegType == UltraSparcRegInfo::FPDoubleRegType || + RegTypeWanted == UltraSparcRegInfo::FPDoubleRegType) { + // This register is used as or is needed as a double-precision reg. + // We need to mark the [even,odd] pair corresponding to this reg. + // Get the even numbered register corresponding to this reg. + unsigned EvenRegInClass = RegInClass & ~1u; + assert(EvenRegInClass+1 < NumOfAllRegs && + EvenRegInClass+1 < IsColorUsedArr.size()); + IsColorUsedArr[EvenRegInClass] = true; + IsColorUsedArr[EvenRegInClass+1] = true; + } + else { + assert(RegInClass < NumOfAllRegs && RegInClass < IsColorUsedArr.size()); + assert(UserRegType == RegTypeWanted + && "Something other than FP single/double types share a reg class?"); + IsColorUsedArr[RegInClass] = true; + } +} + +// This method finds unused registers of the specified register type, +// using the given "used" flag array IsColorUsedArr. It checks a single +// entry in the array directly for float regs, and checks the pair [R,R+1] +// for double-precision registers +// It returns -1 if no unused color is found. +// +int SparcFloatRegClass::findUnusedColor(int RegTypeWanted, + const std::vector &IsColorUsedArr) const +{ + if (RegTypeWanted == UltraSparcRegInfo::FPDoubleRegType) { + unsigned NC = 2 * this->getNumOfAvailRegs(); + assert(IsColorUsedArr.size() == NC && "Invalid colors-used array"); + for (unsigned c = 0; c < NC; c+=2) + if (!IsColorUsedArr[c]) { + assert(!IsColorUsedArr[c+1] && "Incorrect used regs for FP double!"); + return c; + } + return -1; + } + else + return TargetRegClassInfo::findUnusedColor(RegTypeWanted, IsColorUsedArr); +} //----------------------------------------------------------------------------- // Helper method for coloring a node of Float Reg class. @@ -285,22 +348,24 @@ int SparcFloatRegClass::findFloatColor(const LiveRange *LR, unsigned Start, unsigned End, - std::vector &IsColorUsedArr) const + const std::vector &IsColorUsedArr) const { - bool ColorFound = false; - unsigned c; - if (LR->getType() == Type::DoubleTy) { // find first unused color for a double - for (c=Start; c < End ; c+= 2) - if (!IsColorUsedArr[c] && !IsColorUsedArr[c+1]) + assert(Start % 2 == 0 && "Odd register number could be used for double!"); + for (unsigned c=Start; c < End ; c+= 2) + if (!IsColorUsedArr[c]) { + assert(!IsColorUsedArr[c+1] && + "Incorrect marking of used regs for Sparc FP double!"); return c; + } } else { // find first unused color for a single - for (c = Start; c < End; c++) + for (unsigned c = Start; c < End; c++) if (!IsColorUsedArr[c]) return c; } - + return -1; + } Index: llvm/lib/Target/Sparc/SparcRegClassInfo.h diff -u llvm/lib/Target/Sparc/SparcRegClassInfo.h:1.18 llvm/lib/Target/Sparc/SparcRegClassInfo.h:1.19 --- llvm/lib/Target/Sparc/SparcRegClassInfo.h:1.18 Sun Jul 20 10:38:24 2003 +++ llvm/lib/Target/Sparc/SparcRegClassInfo.h Fri Jul 25 16:12:15 2003 @@ -19,7 +19,8 @@ SparcIntRegClass(unsigned ID) : TargetRegClassInfo(ID, NumOfAvailRegs, NumOfAllRegs) { } - void colorIGNode(IGNode *Node, std::vector &IsColorUsedArr) const; + void colorIGNode(IGNode *Node, + const std::vector &IsColorUsedArr) const; inline bool isRegVolatile(int Reg) const { return (Reg < (int)StartOfNonVolatileRegs); @@ -81,12 +82,32 @@ class SparcFloatRegClass : public TargetRegClassInfo { int findFloatColor(const LiveRange *LR, unsigned Start, - unsigned End, std::vector &IsColorUsedArr) const; + unsigned End, + const std::vector &IsColorUsedArr) const; public: SparcFloatRegClass(unsigned ID) : TargetRegClassInfo(ID, NumOfAvailRegs, NumOfAllRegs) {} - void colorIGNode(IGNode *Node, std::vector &IsColorUsedArr) const; + // This method marks the registers used for a given register number. + // This marks a single register for Float regs, but the R,R+1 pair + // for double-precision registers. + // + virtual void markColorsUsed(unsigned RegInClass, + int UserRegType, + int RegTypeWanted, + std::vector &IsColorUsedArr) const; + + // This method finds unused registers of the specified register type, + // using the given "used" flag array IsColorUsedArr. It checks a single + // entry in the array directly for float regs, and checks the pair [R,R+1] + // for double-precision registers + // It returns -1 if no unused color is found. + // + virtual int findUnusedColor(int RegTypeWanted, + const std::vector &IsColorUsedArr) const; + + void colorIGNode(IGNode *Node, + const std::vector &IsColorUsedArr) const; // according to Sparc 64 ABI, all %fp regs are volatile inline bool isRegVolatile(int Reg) const { return true; } @@ -129,7 +150,8 @@ SparcIntCCRegClass(unsigned ID) : TargetRegClassInfo(ID, 1, 3) { } - void colorIGNode(IGNode *Node, std::vector &IsColorUsedArr) const; + void colorIGNode(IGNode *Node, + const std::vector &IsColorUsedArr) const; // according to Sparc 64 ABI, %ccr is volatile // @@ -143,8 +165,6 @@ }; - - //----------------------------------------------------------------------------- // Float CC Register Class // Only 4 Float CC registers are available for allocation. @@ -154,7 +174,8 @@ SparcFloatCCRegClass(unsigned ID) : TargetRegClassInfo(ID, 4, 5) { } - void colorIGNode(IGNode *Node, std::vector &IsColorUsedArr) const { + void colorIGNode(IGNode *Node, + const std::vector &IsColorUsedArr) const { for(unsigned c = 0; c != 4; ++c) if (!IsColorUsedArr[c]) { // find unused color Node->setColor(c); @@ -184,7 +205,8 @@ SparcSpecialRegClass(unsigned ID) : TargetRegClassInfo(ID, 0, 1) { } - void colorIGNode(IGNode *Node, std::vector &IsColorUsedArr) const { + void colorIGNode(IGNode *Node, + const std::vector &IsColorUsedArr) const { assert(0 && "SparcSpecialRegClass should never be used for allocation"); } Index: llvm/lib/Target/Sparc/SparcRegInfo.cpp diff -u llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.104 llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.105 --- llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.104 Mon Jul 21 14:56:49 2003 +++ llvm/lib/Target/Sparc/SparcRegInfo.cpp Fri Jul 25 16:12:15 2003 @@ -229,12 +229,12 @@ } } -int UltraSparcRegInfo::getRegType(const Type* type) const +int UltraSparcRegInfo::getRegTypeForDataType(const Type* type) const { return getRegTypeForClassAndType(getRegClassIDOfType(type), type); } -int UltraSparcRegInfo::getRegType(const LiveRange *LR) const +int UltraSparcRegInfo::getRegTypeForLR(const LiveRange *LR) const { return getRegTypeForClassAndType(LR->getRegClassID(), LR->getType()); } @@ -355,27 +355,26 @@ void UltraSparcRegInfo::suggestRegs4MethodArgs(const Function *Meth, LiveRangeInfo& LRI) const { - // check if this is a varArgs function. needed for choosing regs. + // Check if this is a varArgs function. needed for choosing regs. bool isVarArgs = isVarArgsFunction(Meth->getType()); - // for each argument. count INT and FP arguments separately. - unsigned argNo=0, intArgNo=0, fpArgNo=0; + // Count the arguments, *ignoring* whether they are int or FP args. + // Use this common arg numbering to pick the right int or fp register. + unsigned argNo=0; for(Function::const_aiterator I = Meth->abegin(), E = Meth->aend(); I != E; ++I, ++argNo) { - // get the LR of arg LiveRange *LR = LRI.getLiveRangeForValue(I); assert(LR && "No live range found for method arg"); - unsigned regType = getRegType(LR); - unsigned regClassIDOfArgReg = BadRegClass; // reg class of chosen reg (unused) + unsigned regType = getRegTypeForLR(LR); + unsigned regClassIDOfArgReg = BadRegClass; // for chosen reg (unused) int regNum = (regType == IntRegType) - ? regNumForIntArg(/*inCallee*/ true, isVarArgs, - argNo, regClassIDOfArgReg) - : regNumForFPArg(regType, /*inCallee*/ true, isVarArgs, - argNo, regClassIDOfArgReg); + ? regNumForIntArg(/*inCallee*/ true, isVarArgs, argNo, regClassIDOfArgReg) + : regNumForFPArg(regType, /*inCallee*/ true, isVarArgs, argNo, + regClassIDOfArgReg); - if(regNum != getInvalidRegNum()) + if (regNum != getInvalidRegNum()) LR->setSuggestedColor(regNum); } } @@ -403,7 +402,7 @@ LiveRange *LR = LRI.getLiveRangeForValue(I); assert( LR && "No live range found for method arg"); - unsigned regType = getRegType(LR); + unsigned regType = getRegTypeForLR(LR); unsigned RegClassID = LR->getRegClassID(); // Find whether this argument is coming in a register (if not, on stack) @@ -601,7 +600,7 @@ if (!LR) continue; // no live ranges for constants and labels - unsigned regType = getRegType(LR); + unsigned regType = getRegTypeForLR(LR); unsigned regClassIDOfArgReg = BadRegClass; // chosen reg class (unused) // Choose a register for this arg depending on whether it is @@ -623,242 +622,6 @@ //--------------------------------------------------------------------------- -// Helper method for UltraSparcRegInfo::colorCallArgs(). -//--------------------------------------------------------------------------- - -void -UltraSparcRegInfo::InitializeOutgoingArg(MachineInstr* CallMI, - AddedInstrns *CallAI, - PhyRegAlloc &PRA, LiveRange* LR, - unsigned regType, unsigned RegClassID, - int UniArgRegOrNone, unsigned argNo, - std::vector &AddedInstrnsBefore) - const -{ - assert(0 && "Should never get here because we are now using precopying!"); - - MachineInstr *AdMI; - bool isArgInReg = false; - unsigned UniArgReg = BadRegClass; // unused unless initialized below - if (UniArgRegOrNone != getInvalidRegNum()) - { - isArgInReg = true; - UniArgReg = (unsigned) UniArgRegOrNone; - } - - if (! LR->isMarkedForSpill()) { - unsigned UniLRReg = getUnifiedRegNum(RegClassID, LR->getColor()); - - // if LR received the correct color, nothing to do - if( isArgInReg && UniArgReg == UniLRReg ) - return; - - // The LR is allocated to a register UniLRReg and must be copied - // to UniArgReg or to the stack slot. - // - if( isArgInReg ) { - // Copy UniLRReg to UniArgReg - cpReg2RegMI(AddedInstrnsBefore, UniLRReg, UniArgReg, regType); - } - else { - // Copy UniLRReg to the stack to pass the arg on stack. - const TargetFrameInfo& frameInfo = target.getFrameInfo(); - int argOffset = frameInfo.getOutgoingArgOffset(PRA.MF, argNo); - cpReg2MemMI(CallAI->InstrnsBefore, - UniLRReg, getStackPointer(), argOffset, regType); - } - - } else { // LR is not colored (i.e., spilled) - - if( isArgInReg ) { - // Insert a load instruction to load the LR to UniArgReg - cpMem2RegMI(AddedInstrnsBefore, getFramePointer(), - LR->getSpillOffFromFP(), UniArgReg, regType); - // Now add the instruction - } - - else { - // Now, we have to pass the arg on stack. Since LR also did NOT - // receive a register we have to move an argument in memory to - // outgoing parameter on stack. - // Use TReg to load and store the value. - // Use TmpOff to save TReg, since that may have a live value. - // - int TReg = PRA.getUniRegNotUsedByThisInst(LR->getRegClass(), CallMI); - int TmpOff = PRA.MF.getInfo()-> - pushTempValue(getSpilledRegSize(getRegType(LR))); - const TargetFrameInfo& frameInfo = target.getFrameInfo(); - int argOffset = frameInfo.getOutgoingArgOffset(PRA.MF, argNo); - - MachineInstr *Ad1, *Ad2, *Ad3, *Ad4; - - // Sequence: - // (1) Save TReg on stack - // (2) Load LR value into TReg from stack pos of LR - // (3) Store Treg on outgoing Arg pos on stack - // (4) Load the old value of TReg from stack to TReg (restore it) - // - // OPTIMIZE THIS: - // When reverse pointers in MahineInstr are introduced: - // Call PRA.getUnusedRegAtMI(....) to get an unused reg. Step 1 is - // needed only if this fails. Currently, we cannot call the - // above method since we cannot find LVSetBefore without the BB - // - // NOTE: We directly add to CallAI->InstrnsBefore instead of adding to - // AddedInstrnsBefore since these instructions must not be reordered. - cpReg2MemMI(CallAI->InstrnsBefore, - TReg, getFramePointer(), TmpOff, regType); - cpMem2RegMI(CallAI->InstrnsBefore, - getFramePointer(), LR->getSpillOffFromFP(), TReg, regType); - cpReg2MemMI(CallAI->InstrnsBefore, - TReg, getStackPointer(), argOffset, regType); - cpMem2RegMI(CallAI->InstrnsBefore, - getFramePointer(), TmpOff, TReg, regType); - } - } -} - -//--------------------------------------------------------------------------- -// After graph coloring, we have call this method to see whehter the return -// value and the call args received the correct colors. If not, we have -// to instert copy instructions. -//--------------------------------------------------------------------------- - -void UltraSparcRegInfo::colorCallArgs(MachineInstr *CallMI, - LiveRangeInfo &LRI, - AddedInstrns *CallAI, - PhyRegAlloc &PRA, - const BasicBlock *BB) const { - - assert ( (target.getInstrInfo()).isCall(CallMI->getOpCode()) ); - - CallArgsDescriptor* argDesc = CallArgsDescriptor::get(CallMI); - - // First color the return value of the call. - // If there is a LR for the return value, it means this - // method returns a value - - MachineInstr *AdMI; - - const Value *RetVal = argDesc->getReturnValue(); - - if (RetVal) { - LiveRange *RetValLR = LRI.getLiveRangeForValue( RetVal ); - assert(RetValLR && "ERROR: No LR for non-void return value"); - - // Mark the return value register as used by this instruction - unsigned RegClassID = RetValLR->getRegClassID(); - unsigned CorrectCol = (RegClassID == IntRegClassID - ? (unsigned) SparcIntRegClass::o0 - : (unsigned) SparcFloatRegClass::f0); - - CallMI->insertUsedReg(getUnifiedRegNum(RegClassID, CorrectCol)); - - } // if there a return value - - - //------------------------------------------- - // Now color all args of the call instruction - //------------------------------------------- - - std::vector AddedInstrnsBefore; - - unsigned NumOfCallArgs = argDesc->getNumArgs(); - - for(unsigned argNo=0, i=0, intArgNo=0, fpArgNo=0; - i < NumOfCallArgs; ++i, ++argNo) { - - const Value *CallArg = argDesc->getArgInfo(i).getArgVal(); - unsigned regType = getRegType(CallArg->getType()); - - // Find whether this argument is coming in a register (if not, on stack) - // Also find the correct register the argument must use (UniArgReg) - // - bool isArgInReg = false; - int UniArgReg = getInvalidRegNum(); // reg that LR MUST be colored with - unsigned regClassIDOfArgReg = BadRegClass; // reg class of chosen reg - - // Find the register that must be used for this arg, depending on - // whether it is an INT or FP value. Here we ignore whether or not it - // is a varargs calls, because FP arguments will be explicitly copied - // to an integer Value and handled under (argCopy != NULL) below. - // - int regNum = (regType == IntRegType) - ? regNumForIntArg(/*inCallee*/ false, /*isVarArgs*/ false, - argNo, regClassIDOfArgReg) - : regNumForFPArg(regType, /*inCallee*/ false, /*isVarArgs*/ false, - argNo, regClassIDOfArgReg); - - if (regNum != getInvalidRegNum()) { - isArgInReg = true; - UniArgReg = getUnifiedRegNum(regClassIDOfArgReg, regNum); - CallMI->insertUsedReg(UniArgReg); // mark the reg as used - } - - // Repeat for the second copy of the argument, which would be - // an FP argument being passed to a function with no prototype. - // It may either be passed as a copy in an integer register - // (in argCopy), or on the stack (useStackSlot). - int argCopyReg = argDesc->getArgInfo(i).getArgCopy(); - if (argCopyReg != TargetRegInfo::getInvalidRegNum()) - { - CallMI->insertUsedReg(argCopyReg); // mark the reg as used - } - } // for each parameter in call instruction - - // If we added any instruction before the call instruction, verify - // that they are in the proper order and if not, reorder them - // - std::vector ReorderedVec; - if (!AddedInstrnsBefore.empty()) { - - if (DEBUG_RA) { - std::cerr << "\nCalling reorder with instrns: \n"; - for(unsigned i=0; i < AddedInstrnsBefore.size(); i++) - std::cerr << *(AddedInstrnsBefore[i]); - } - - OrderAddedInstrns(AddedInstrnsBefore, ReorderedVec, PRA); - assert(ReorderedVec.size() >= AddedInstrnsBefore.size() - && "Dropped some instructions when reordering!"); - - if (DEBUG_RA) { - std::cerr << "\nAfter reordering instrns: \n"; - for(unsigned i = 0; i < ReorderedVec.size(); i++) - std::cerr << *ReorderedVec[i]; - } - } - - // Now insert caller saving code for this call instruction - // - insertCallerSavingCode(CallAI->InstrnsBefore, CallAI->InstrnsAfter, - CallMI, BB, PRA); - - // Then insert the final reordered code for the call arguments. - // - for(unsigned i=0; i < ReorderedVec.size(); i++) - CallAI->InstrnsBefore.push_back( ReorderedVec[i] ); - -#ifndef NDEBUG - // Temporary sanity checking code to detect whether the same machine - // instruction is ever inserted twice before/after a call. - // I suspect this is happening but am not sure. --Vikram, 7/1/03. - // - std::set instrsSeen; - for (int i = 0, N = CallAI->InstrnsBefore.size(); i < N; ++i) { - assert(instrsSeen.find(CallAI->InstrnsBefore[i]) == instrsSeen.end() && - "Duplicate machine instruction in InstrnsBefore!"); - instrsSeen.insert(CallAI->InstrnsBefore[i]); - } - for (int i = 0, N = CallAI->InstrnsAfter.size(); i < N; ++i) { - assert(instrsSeen.find(CallAI->InstrnsAfter[i]) == instrsSeen.end() && - "Duplicate machine instruction in InstrnsBefore/After!"); - instrsSeen.insert(CallAI->InstrnsAfter[i]); - } -#endif -} - -//--------------------------------------------------------------------------- // this method is called for an LLVM return instruction to identify which // values will be returned from this method and to suggest colors. //--------------------------------------------------------------------------- @@ -880,41 +643,6 @@ : (unsigned) SparcFloatRegClass::f0); } - - -//--------------------------------------------------------------------------- -// Colors the return value of a method to %i0 or %f0, if possible. If it is -// not possilbe to directly color the LR, insert a copy instruction to move -// the LR to %i0 or %f0. When the LR is spilled, instead of the copy, we -// have to put a load instruction. -//--------------------------------------------------------------------------- -void UltraSparcRegInfo::colorRetValue(MachineInstr *RetMI, - LiveRangeInfo &LRI, - AddedInstrns *RetAI) const { - - assert((target.getInstrInfo()).isReturn( RetMI->getOpCode())); - - // To find the return value (if any), we can get the LLVM return instr. - // from the return address register, which is the first operand - Value* tmpI = RetMI->getOperand(0).getVRegValue(); - ReturnInst* retI=cast(cast(tmpI)->getOperand(0)); - if (const Value *RetVal = retI->getReturnValue()) { - - unsigned RegClassID = getRegClassIDOfType(RetVal->getType()); - unsigned regType = getRegType(RetVal->getType()); - unsigned CorrectCol = (RegClassID == IntRegClassID - ? (unsigned) SparcIntRegClass::i0 - : (unsigned) SparcFloatRegClass::f0); - - // convert to unified number - unsigned UniRetReg = getUnifiedRegNum(RegClassID, CorrectCol); - - // Mark the register as used by this instruction - RetMI->insertUsedReg(UniRetReg); - } // if there is a return value - -} - //--------------------------------------------------------------------------- // Check if a specified register type needs a scratch register to be // copied to/from memory. If it does, the reg. type that must be used @@ -1126,7 +854,7 @@ void UltraSparcRegInfo::cpValue2Value(Value *Src, Value *Dest, std::vector& mvec) const { - int RegType = getRegType(Src->getType()); + int RegType = getRegTypeForDataType(Src->getType()); MachineInstr * MI = NULL; switch( RegType ) { @@ -1251,7 +979,7 @@ // if we haven't already pushed that register - unsigned RegType = getRegType(LR); + unsigned RegType = getRegTypeForLR(LR); // Now get two instructions - to push on stack and pop from stack // and add them to InstrnsBefore and InstrnsAfter of the @@ -1369,241 +1097,4 @@ if (RegClassID == FloatRegClassID && LR->getType() == Type::DoubleTy) std::cerr << "+" << getUnifiedRegName(uRegName+1); std::cerr << "]\n"; -} - -//--------------------------------------------------------------------------- -// This method examines instructions inserted by RegAlloc code before a -// machine instruction to detect invalid orders that destroy values before -// they are used. If it detects such conditions, it reorders the instructions. -// -// The unordered instructions come in the UnordVec. These instructions are -// instructions inserted by RegAlloc. All such instruction MUST have -// their USES BEFORE THE DEFS after reordering. -// -// The UnordVec & OrdVec must be DISTINCT. The OrdVec must be empty when -// this method is called. -// -// This method uses two vectors for efficiency in accessing -// -// Since instructions are inserted in RegAlloc, this assumes that the -// first operand is the source reg and the last operand is the dest reg. -// It also does not consider operands that are both use and def. -// -// All the uses are before THE def to a register -//--------------------------------------------------------------------------- - -void UltraSparcRegInfo::OrderAddedInstrns(std::vector &UnordVec, - std::vector &OrdVec, - PhyRegAlloc &PRA) const{ - - /* - Problem: We can have instructions inserted by RegAlloc like - 1. add %ox %g0 %oy - 2. add %oy %g0 %oz, where z!=x or z==x - - This is wrong since %oy used by 2 is overwritten by 1 - - Solution: - We re-order the instructions so that the uses are before the defs - - Algorithm: - - do - for each instruction 'DefInst' in the UnOrdVec - for each instruction 'UseInst' that follows the DefInst - if the reg defined by DefInst is used by UseInst - mark DefInst as not movable in this iteration - If DefInst is not marked as not-movable, move DefInst to OrdVec - while all instructions in DefInst are moved to OrdVec - - For moving, we call the move2OrdVec(). It checks whether there is a def - in it for the uses in the instruction to be added to OrdVec. If there - are no preceding defs, it just appends the instruction. If there is a - preceding def, it puts two instructions to save the reg on stack before - the load and puts a restore at use. - - */ - - bool CouldMoveAll; - bool DebugPrint = false; - - do { - CouldMoveAll = true; - std::vector::iterator DefIt = UnordVec.begin(); - - for( ; DefIt != UnordVec.end(); ++DefIt ) { - - // for each instruction in the UnordVec do ... - - MachineInstr *DefInst = *DefIt; - - if( DefInst == NULL) continue; - - //std::cerr << "\nInst in UnordVec = " << *DefInst; - - // last operand is the def (unless for a store which has no def reg) - MachineOperand& DefOp = DefInst->getOperand(DefInst->getNumOperands()-1); - - if ((DefOp.opIsDefOnly() || DefOp.opIsDefAndUse()) && - DefOp.getType() == MachineOperand::MO_MachineRegister) { - - // If the operand in DefInst is a def ... - bool DefEqUse = false; - - std::vector::iterator UseIt = DefIt; - UseIt++; - - for( ; UseIt != UnordVec.end(); ++UseIt ) { - - MachineInstr *UseInst = *UseIt; - if( UseInst == NULL) continue; - - // for each inst (UseInst) that is below the DefInst do ... - MachineOperand& UseOp = UseInst->getOperand(0); - - if (!UseOp.opIsDefOnly() && - UseOp.getType() == MachineOperand::MO_MachineRegister) { - - // if use is a register ... - - if( DefOp.getMachineRegNum() == UseOp.getMachineRegNum() ) { - - // if Def and this use are the same, it means that this use - // is destroyed by a def before it is used - - // std::cerr << "\nCouldn't move " << *DefInst; - - DefEqUse = true; - CouldMoveAll = false; - DebugPrint = true; - break; - } // if two registers are equal - - } // if use is a register - - }// for all use instructions - - if( ! DefEqUse ) { - - // after examining all the instructions that follow the DefInst - // if there are no dependencies, we can move it to the OrdVec - - // std::cerr << "Moved to Ord: " << *DefInst; - - moveInst2OrdVec(OrdVec, DefInst, PRA); - - //OrdVec.push_back(DefInst); - - // mark the pos of DefInst with NULL to indicate that it is - // empty - *DefIt = NULL; - } - - } // if Def is a machine register - - } // for all instructions in the UnordVec - - - } while(!CouldMoveAll); - - if (DebugPrint && DEBUG_RA) { - std::cerr << "\nAdded instructions were reordered to:\n"; - for(unsigned i=0; i < OrdVec.size(); i++) - std::cerr << *OrdVec[i]; - } -} - - - - - -void UltraSparcRegInfo::moveInst2OrdVec(std::vector &OrdVec, - MachineInstr *UnordInst, - PhyRegAlloc &PRA) const { - MachineOperand& UseOp = UnordInst->getOperand(0); - - if (!UseOp.opIsDefOnly() && - UseOp.getType() == MachineOperand::MO_MachineRegister) { - - // for the use of UnordInst, see whether there is a defining instr - // before in the OrdVec - bool DefEqUse = false; - - std::vector::iterator OrdIt = OrdVec.begin(); - - for( ; OrdIt != OrdVec.end(); ++OrdIt ) { - - MachineInstr *OrdInst = *OrdIt ; - - MachineOperand& DefOp = - OrdInst->getOperand(OrdInst->getNumOperands()-1); - - if( (DefOp.opIsDefOnly() || DefOp.opIsDefAndUse()) && - DefOp.getType() == MachineOperand::MO_MachineRegister) { - - //std::cerr << "\nDefining Ord Inst: " << *OrdInst; - - if( DefOp.getMachineRegNum() == UseOp.getMachineRegNum() ) { - - // we are here because there is a preceding def in the OrdVec - // for the use in this intr we are going to insert. This - // happened because the original code was like: - // 1. add %ox %g0 %oy - // 2. add %oy %g0 %ox - // In Round1, we added 2 to OrdVec but 1 remained in UnordVec - // Now we are processing %ox of 1. - // We have to - - int UReg = DefOp.getMachineRegNum(); - int RegType = getRegType(UReg); - MachineInstr *AdIBef, *AdIAft; - - int StackOff = - PRA.MF.getInfo()->pushTempValue(getSpilledRegSize(RegType)); - - // Save the UReg (%ox) on stack before it's destroyed - std::vector mvec; - cpReg2MemMI(mvec, UReg, getFramePointer(), StackOff, RegType); - for (std::vector::iterator MI=mvec.begin(); - MI != mvec.end(); ++MI) - OrdIt = 1+OrdVec.insert(OrdIt, *MI); - - // Load directly into DReg (%oy) - MachineOperand& DOp= - (UnordInst->getOperand(UnordInst->getNumOperands()-1)); - assert((DOp.opIsDefOnly() || DefOp.opIsDefAndUse()) && - "Last operand is not the def"); - const int DReg = DOp.getMachineRegNum(); - - cpMem2RegMI(OrdVec, getFramePointer(), StackOff, DReg, RegType); - - if( DEBUG_RA ) { - std::cerr << "\nFixed CIRCULAR references by reordering:"; - std::cerr << "\nBefore CIRCULAR Reordering:\n"; - std::cerr << *UnordInst; - std::cerr << *OrdInst; - - std::cerr << "\nAfter CIRCULAR Reordering - All Inst so far:\n"; - for(unsigned i=0; i < OrdVec.size(); i++) - std::cerr << *(OrdVec[i]); - } - - // Do not copy the UseInst to OrdVec - DefEqUse = true; - break; - - }// if two registers are equal - - } // if Def is a register - - } // for each instr in OrdVec - - if(!DefEqUse) { - - // We didn't find a def in the OrdVec, so just append this inst - OrdVec.push_back( UnordInst ); - //std::cerr << "Reordered Inst (Moved Dn): " << *UnordInst; - } - - }// if the operand in UnordInst is a use } From lattner at cs.uiuc.edu Fri Jul 25 16:14:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 16:14:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Analysis/DSGraph/globalgraph.c globals.c Message-ID: <200307252113.QAA06041@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Analysis/DSGraph: globalgraph.c updated: 1.1 -> 1.2 globals.c updated: 1.1 -> 1.2 --- Log message: Add fixmes --- Diffs of the changes: Index: llvm/test/Regression/Analysis/DSGraph/globalgraph.c diff -u llvm/test/Regression/Analysis/DSGraph/globalgraph.c:1.1 llvm/test/Regression/Analysis/DSGraph/globalgraph.c:1.2 --- llvm/test/Regression/Analysis/DSGraph/globalgraph.c:1.1 Wed Jul 16 16:48:38 2003 +++ llvm/test/Regression/Analysis/DSGraph/globalgraph.c Fri Jul 25 16:13:16 2003 @@ -1,3 +1,5 @@ +/* FIXME: this testcase should be automated! */ + #include typedef struct Tree_struct { Index: llvm/test/Regression/Analysis/DSGraph/globals.c diff -u llvm/test/Regression/Analysis/DSGraph/globals.c:1.1 llvm/test/Regression/Analysis/DSGraph/globals.c:1.2 --- llvm/test/Regression/Analysis/DSGraph/globals.c:1.1 Wed Jul 16 16:48:38 2003 +++ llvm/test/Regression/Analysis/DSGraph/globals.c Fri Jul 25 16:13:16 2003 @@ -1,5 +1,7 @@ /* Test globals used and unused within different parts of a program */ +/* FIXME: This testcase should be automated */ + #include extern void exit_dummy(int*); From lattner at cs.uiuc.edu Fri Jul 25 17:27:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 17:27:01 2003 Subject: [llvm-commits] CVS: llvm/test/Makefile.tests Message-ID: <200307252226.RAA09761@apoc.cs.uiuc.edu> Changes in directory llvm/test: Makefile.tests updated: 1.70 -> 1.71 --- Log message: Simplify some makefile magic, no functional changes --- Diffs of the changes: Index: llvm/test/Makefile.tests diff -u llvm/test/Makefile.tests:1.70 llvm/test/Makefile.tests:1.71 --- llvm/test/Makefile.tests:1.70 Tue Jul 8 18:40:48 2003 +++ llvm/test/Makefile.tests Fri Jul 25 17:26:17 2003 @@ -1,6 +1,8 @@ ##----------------------------------------------------------*- Makefile -*-===## +## ## Common rules for generating, linking, and compiling via LLVM. This is ## used to implement a robust testing framework for LLVM +## ##-------------------------------------------------------------------------===## # If the user specified a TEST= option on the command line, we do not want to do @@ -65,22 +67,17 @@ ## If TRACE or TRACEM is "yes", set the appropriate llc flag (-trace or -tracem) ## mark that tracing on, and set the TRACELIBS variable. TRACEFLAGS = -DOTRACING = ifeq ($(TRACE), yes) - TRACEFLAGS += -trace - DOTRACING = yes -else - ifeq ($(TRACEM), yes) - TRACEFLAGS += -tracem - DOTRACING = yes - endif -endif -ifdef DOTRACING + TRACEFLAGS = -trace TRACELIBS := -L$(LEVEL)/test/Libraries/Output -linstr.$(ARCH) endif +ifeq ($(TRACEM), yes) + TRACEFLAGS = -tracem + TRACELIBS := -L$(LEVEL)/test/Libraries/Output -linstr.$(ARCH) +endif -LLCLIBS := $(LLCLIBS) -lm +LLCLIBS += -lm clean:: $(RM) -f a.out core From lattner at cs.uiuc.edu Fri Jul 25 17:38:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 17:38:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile.programs Message-ID: <200307252237.RAA09801@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile.programs updated: 1.76 -> 1.77 --- Log message: TRACINGDIFFS has never worked, remove it Remove DOTRACING. It was previously set if TRACE or MTRACE was set, just test them instead --- Diffs of the changes: Index: llvm/test/Programs/Makefile.programs diff -u llvm/test/Programs/Makefile.programs:1.76 llvm/test/Programs/Makefile.programs:1.77 --- llvm/test/Programs/Makefile.programs:1.76 Wed Jul 23 14:29:47 2003 +++ llvm/test/Programs/Makefile.programs Fri Jul 25 17:37:18 2003 @@ -7,7 +7,7 @@ # # 1. The native platform compiler # 2. LLVM Bytecode Compiler + LLI interpreter (if ENABLE_LLI is enabled) -# 3. LLVM Bytecode Compiler + LLC Sparc machine code backend +# 3. LLVM Bytecode Compiler + LLC static compiler # 4. LLVM Bytecode Compiler + C Backend + Native Sun Compiler # 5. LLVM Bytecode Compiler + LLI Just-In-Time Compiler # @@ -46,7 +46,6 @@ .PRECIOUS: Output/%.cbe Output/%.cbe.c Output/%.llvm.bc .PRECIOUS: Output/%.linked.bc .PRECIOUS: Output/%.run.bc Output/%.run.s Output/%.tracing Output/%.trace -.PRECIOUS: Output/%.out-tracing Output/%.diff-tracing PROGDIR = $(LEVEL)/test/Programs @@ -121,7 +120,6 @@ CBEDIFFS := $(addsuffix .diff-cbe, $(PREFIXED_PROGRAMS_TO_TEST)) #Diffs for tracing framework -TRACINGDIFFS := $(addsuffix .diff-tracing, $(PREFIXED_PROGRAMS_TO_TEST)) GETTIMECOMPARISON := $(addsuffix .performance, $(PREFIXED_PROGRAMS_TO_TEST)) # Build Program outputs: @@ -129,7 +127,7 @@ .PRECIOUS: Output/%.out-nat Output/%.out-cbe Output/%.llc.bc # Build diffs from the output... -.PRECIOUS: Output/%.diff-lli Output/%.diff-jit Output/%.diff-tracing +.PRECIOUS: Output/%.diff-lli Output/%.diff-jit .PRECIOUS: Output/%.diff-llc Output/%.diff-cbe @@ -146,7 +144,7 @@ DISABLE_DIFFS := 1 endif -ifdef DOTRACING +ifneq ($(TRACE)$(TRACEM),) ## When tracing is enabled do the following: ## -- disable output diffs ## -- generate llc output if not disabled @@ -184,10 +182,6 @@ all:: $(TRACINGCODEGEN) all:: $(TRACINGLLCCODEGEN) all:: $(TRACINGEXECUTABLE) -#all:: $(TRACINGDIFFS) -# TRACINGDIFFS does not work - it wants to diff llc against tracing, -# but DiffOutput always diffs against native, and GET_LLVM_TRACE disables -# native. all:: $(GETTIMECOMPARISON) DISABLE_CBE = 1 @@ -405,10 +399,6 @@ $(PROGRAMS_TO_TEST:%=Output/%.diff-cbe): \ Output/%.diff-cbe: Output/%.out-nat Output/%.out-cbe -$(DIFFPROG) cbe $* $(HIDEDIFF) - -$(PROGRAMS_TO_TEST:%=Output/%.diff-tracing): \ -Output/%.diff-tracing: Output/%.out-llc Output/%.out-tracing - -$(DIFFPROG) tracing $* $(HIDEDIFF) ifndef DISABLE_DIFFS $(PROGRAMS_TO_TEST:%=Output/%.exe-lli): \ From lattner at cs.uiuc.edu Fri Jul 25 17:41:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jul 25 17:41:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile.programs Message-ID: <200307252240.RAA10500@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile.programs updated: 1.77 -> 1.78 --- Log message: Recover some lost testing performance by only running opt if OPTPASSES is not empty! --- Diffs of the changes: Index: llvm/test/Programs/Makefile.programs diff -u llvm/test/Programs/Makefile.programs:1.77 llvm/test/Programs/Makefile.programs:1.78 --- llvm/test/Programs/Makefile.programs:1.77 Fri Jul 25 17:37:18 2003 +++ llvm/test/Programs/Makefile.programs Fri Jul 25 17:39:50 2003 @@ -230,15 +230,19 @@ $(PROGRAMS_TO_TEST:%=Output/%.llvm.bc): \ Output/%.llvm.bc: Output/%.linked.bc $(LGCCLDPROG) $(LGCCLD) $(STATS) $< -lgcc -lc $(LIBS) crtend.o -o Output/$*.llvm - $(LOPT) $(OPTPASSES) < $@ > $@.tmp +ifneq ($(OPTPASSES),) + $(LOPT) -q $(OPTPASSES) < $@ > $@.tmp $(MV) -f $@.tmp $@ +endif $(PROGRAMS_TO_TEST:%=Output/%.llvm): \ Output/%.llvm: Output/%.linked.bc $(LGCCLDPROG) $(LGCCLD) $(STATS) $< -lgcc -lc $(LIBS) crtend.o -o Output/$*.llvm - $(LOPT) $(OPTPASSES) < $@ > $@.tmp +ifneq ($(OPTPASSES),) + $(LOPT) -q $(OPTPASSES) < $@ > $@.tmp $(MV) -f $@.tmp $@ endif +endif # ifndef DISABLE_FOR_LLVM_PROGRAMS # Targets to get the pass arguments that gccas and gccld are using... Output/gccas-pass-args: $(LGCCAS) From lattner at cs.uiuc.edu Sat Jul 26 17:57:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 17:57:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/DSSupport.h DataStructure.h Message-ID: <200307262256.RAA21059@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: DSSupport.h updated: 1.21 -> 1.22 DataStructure.h updated: 1.69 -> 1.70 --- Log message: Remove #includes --- Diffs of the changes: Index: llvm/include/llvm/Analysis/DSSupport.h diff -u llvm/include/llvm/Analysis/DSSupport.h:1.21 llvm/include/llvm/Analysis/DSSupport.h:1.22 --- llvm/include/llvm/Analysis/DSSupport.h:1.21 Fri Jul 25 12:34:17 2003 +++ llvm/include/llvm/Analysis/DSSupport.h Sat Jul 26 17:56:46 2003 @@ -11,7 +11,6 @@ #include #include #include -#include "Support/HashExtras.h" #include "Support/hash_set" class Function; Index: llvm/include/llvm/Analysis/DataStructure.h diff -u llvm/include/llvm/Analysis/DataStructure.h:1.69 llvm/include/llvm/Analysis/DataStructure.h:1.70 --- llvm/include/llvm/Analysis/DataStructure.h:1.69 Wed Jul 2 18:43:06 2003 +++ llvm/include/llvm/Analysis/DataStructure.h Sat Jul 26 17:56:46 2003 @@ -8,7 +8,6 @@ #define LLVM_ANALYSIS_DATA_STRUCTURE_H #include "llvm/Pass.h" -#include "Support/HashExtras.h" #include "Support/hash_set" class Type; From lattner at cs.uiuc.edu Sat Jul 26 18:00:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 18:00:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/InstrForest.h LiveRangeInfo.h Message-ID: <200307262259.RAA22327@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: InstrForest.h updated: 1.27 -> 1.28 LiveRangeInfo.h updated: 1.16 -> 1.17 --- Log message: Remove extraneous #includes --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/InstrForest.h diff -u llvm/include/llvm/CodeGen/InstrForest.h:1.27 llvm/include/llvm/CodeGen/InstrForest.h:1.28 --- llvm/include/llvm/CodeGen/InstrForest.h:1.27 Sat Jun 21 22:06:13 2003 +++ llvm/include/llvm/CodeGen/InstrForest.h Sat Jul 26 17:59:45 2003 @@ -20,7 +20,6 @@ #define LLVM_CODEGEN_INSTRFOREST_H #include "llvm/Instruction.h" -#include "Support/HashExtras.h" class Constant; class Function; Index: llvm/include/llvm/CodeGen/LiveRangeInfo.h diff -u llvm/include/llvm/CodeGen/LiveRangeInfo.h:1.16 llvm/include/llvm/CodeGen/LiveRangeInfo.h:1.17 --- llvm/include/llvm/CodeGen/LiveRangeInfo.h:1.16 Tue Jan 14 16:56:14 2003 +++ llvm/include/llvm/CodeGen/LiveRangeInfo.h Sat Jul 26 17:59:45 2003 @@ -19,8 +19,8 @@ #ifndef LIVE_RANGE_INFO_H #define LIVE_RANGE_INFO_H -#include "Support/HashExtras.h" #include "llvm/CodeGen/ValueSet.h" +#include "Support/hash_map" class LiveRange; class MachineInstr; From lattner at cs.uiuc.edu Sat Jul 26 18:01:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 18:01:00 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/InstrSched/SchedGraph.h Message-ID: <200307262300.SAA22354@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/InstrSched: SchedGraph.h updated: 1.28 -> 1.29 --- Log message: Remove extraneous #includes --- Diffs of the changes: Index: llvm/lib/CodeGen/InstrSched/SchedGraph.h diff -u llvm/lib/CodeGen/InstrSched/SchedGraph.h:1.28 llvm/lib/CodeGen/InstrSched/SchedGraph.h:1.29 --- llvm/lib/CodeGen/InstrSched/SchedGraph.h:1.28 Mon Jun 2 17:45:07 2003 +++ llvm/lib/CodeGen/InstrSched/SchedGraph.h Sat Jul 26 18:00:29 2003 @@ -15,7 +15,6 @@ #define LLVM_CODEGEN_SCHEDGRAPH_H #include "llvm/CodeGen/MachineInstr.h" -#include "Support/HashExtras.h" #include "Support/GraphTraits.h" class Value; From lattner at cs.uiuc.edu Sat Jul 26 18:01:12 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 18:01:12 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/GraphChecker.cpp Message-ID: <200307262300.SAA22343@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: GraphChecker.cpp updated: 1.5 -> 1.6 --- Log message: Fix another minor bug --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/GraphChecker.cpp diff -u llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.5 llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.6 --- llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.5 Fri Jul 25 15:49:29 2003 +++ llvm/lib/Analysis/DataStructure/GraphChecker.cpp Sat Jul 26 18:00:05 2003 @@ -133,8 +133,8 @@ } unsigned Flags = 0; - for (++ColonPos; ColonPos != I->size(); ++ColonPos) - switch ((*I)[ColonPos]) { + for (unsigned C = ColonPos+1; C != I->size(); ++C) + switch ((*I)[C]) { case 'S': Flags |= DSNode::AllocaNode; break; case 'H': Flags |= DSNode::HeapNode; break; case 'G': Flags |= DSNode::GlobalNode; break; From lattner at cs.uiuc.edu Sat Jul 26 18:02:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 18:02:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h Message-ID: <200307262301.SAA22367@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/ModuloScheduling: ModuloSchedGraph.h updated: 1.8 -> 1.9 --- Log message: Remove #include --- Diffs of the changes: Index: llvm/lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h diff -u llvm/lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h:1.8 llvm/lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h:1.9 --- llvm/lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h:1.8 Tue Jun 10 14:09:00 2003 +++ llvm/lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h Sat Jul 26 18:01:04 2003 @@ -11,7 +11,6 @@ #include "llvm/Instruction.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" -#include "Support/HashExtras.h" #include "Support/GraphTraits.h" #include "Support/hash_map" #include "../InstrSched/SchedGraphCommon.h" From lattner at cs.uiuc.edu Sat Jul 26 18:05:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 18:05:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/PrologEpilogCodeInserter.cpp SparcV9CodeEmitter.cpp SparcV9CodeEmitter.h Message-ID: <200307262304.SAA23939@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: PrologEpilogCodeInserter.cpp updated: 1.27 -> 1.28 SparcV9CodeEmitter.cpp updated: 1.21 -> 1.22 SparcV9CodeEmitter.h updated: 1.11 -> 1.12 --- Log message: This code doesn't modify the LLVM structure, keep stuff const --- Diffs of the changes: Index: llvm/lib/Target/Sparc/PrologEpilogCodeInserter.cpp diff -u llvm/lib/Target/Sparc/PrologEpilogCodeInserter.cpp:1.27 llvm/lib/Target/Sparc/PrologEpilogCodeInserter.cpp:1.28 --- llvm/lib/Target/Sparc/PrologEpilogCodeInserter.cpp:1.27 Fri Jun 6 04:52:23 2003 +++ llvm/lib/Target/Sparc/PrologEpilogCodeInserter.cpp Sat Jul 26 18:04:00 2003 @@ -133,8 +133,8 @@ for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) { MachineBasicBlock &MBB = *I; - BasicBlock &BB = *I->getBasicBlock(); - Instruction *TermInst = (Instruction*)BB.getTerminator(); + const BasicBlock &BB = *I->getBasicBlock(); + const Instruction *TermInst = (Instruction*)BB.getTerminator(); if (TermInst->getOpcode() == Instruction::Ret) { int ZR = TM.getRegInfo().getZeroRegNum(); Index: llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp diff -u llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp:1.21 llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp:1.22 --- llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp:1.21 Wed Jul 16 15:30:40 2003 +++ llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp Sat Jul 26 18:04:00 2003 @@ -571,7 +571,7 @@ // Duplicate code of the above case for VirtualRegister, BasicBlock... // It should really hit this case, but Sparc backend uses VRegs instead DEBUG(std::cerr << "Saving reference to MBB\n"); - BasicBlock *BB = MO.getMachineBasicBlock()->getBasicBlock(); + const BasicBlock *BB = MO.getMachineBasicBlock()->getBasicBlock(); unsigned* CurrPC = (unsigned*)(intptr_t)MCE.getCurrentPCValue(); BBRefs.push_back(std::make_pair(BB, std::make_pair(CurrPC, &MI))); } else if (MO.isExternalSymbol()) { Index: llvm/lib/Target/Sparc/SparcV9CodeEmitter.h diff -u llvm/lib/Target/Sparc/SparcV9CodeEmitter.h:1.11 llvm/lib/Target/Sparc/SparcV9CodeEmitter.h:1.12 --- llvm/lib/Target/Sparc/SparcV9CodeEmitter.h:1.11 Wed Jul 16 15:30:40 2003 +++ llvm/lib/Target/Sparc/SparcV9CodeEmitter.h Sat Jul 26 18:04:00 2003 @@ -18,13 +18,13 @@ class SparcV9CodeEmitter : public MachineFunctionPass { TargetMachine &TM; MachineCodeEmitter &MCE; - BasicBlock *currBB; + const BasicBlock *currBB; // Tracks which instruction references which BasicBlock - std::vector > > BBRefs; // Tracks where each BasicBlock starts - std::map BBLocations; + std::map BBLocations; // Tracks locations of Constants which are laid out in memory (e.g. FP) // But we also need to map Constants to ConstantPool indices From lattner at cs.uiuc.edu Sat Jul 26 18:07:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 18:07:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp Message-ID: <200307262306.SAA25891@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: InstSelectSimple.cpp updated: 1.115 -> 1.116 --- Log message: If the pass changes _anything_ it must return true --- Diffs of the changes: Index: llvm/lib/Target/X86/InstSelectSimple.cpp diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.115 llvm/lib/Target/X86/InstSelectSimple.cpp:1.116 --- llvm/lib/Target/X86/InstSelectSimple.cpp:1.115 Wed Jul 23 10:22:21 2003 +++ llvm/lib/Target/X86/InstSelectSimple.cpp Sat Jul 26 18:05:37 2003 @@ -85,7 +85,8 @@ RegMap.clear(); MBBMap.clear(); F = 0; - return false; // We never modify the LLVM itself. + // We always build a machine code representation for the function + return true; } virtual const char *getPassName() const { From lattner at cs.uiuc.edu Sat Jul 26 18:07:13 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 18:07:13 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86CodeEmitter.cpp Message-ID: <200307262306.SAA25731@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86CodeEmitter.cpp updated: 1.30 -> 1.31 --- Log message: We don't modify the LLVM rep, remain const correct --- Diffs of the changes: Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.30 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.31 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.30 Mon Jun 30 16:58:51 2003 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Sat Jul 26 18:06:00 2003 @@ -143,8 +143,8 @@ class Emitter : public MachineFunctionPass { const X86InstrInfo *II; MachineCodeEmitter &MCE; - std::map BasicBlockAddrs; - std::vector > BBRefs; + std::map BasicBlockAddrs; + std::vector > BBRefs; public: Emitter(MachineCodeEmitter &mce) : II(0), MCE(mce) {} From lattner at cs.uiuc.edu Sat Jul 26 18:19:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 18:19:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/InstrForest.h Message-ID: <200307262318.SAA07620@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: InstrForest.h updated: 1.28 -> 1.29 --- Log message: Whoops, this one was needed --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/InstrForest.h diff -u llvm/include/llvm/CodeGen/InstrForest.h:1.28 llvm/include/llvm/CodeGen/InstrForest.h:1.29 --- llvm/include/llvm/CodeGen/InstrForest.h:1.28 Sat Jul 26 17:59:45 2003 +++ llvm/include/llvm/CodeGen/InstrForest.h Sat Jul 26 18:18:11 2003 @@ -20,6 +20,7 @@ #define LLVM_CODEGEN_INSTRFOREST_H #include "llvm/Instruction.h" +#include "Support/hash_map" class Constant; class Function; From lattner at cs.uiuc.edu Sat Jul 26 18:23:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 18:23:00 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/InstrSched/SchedGraph.h Message-ID: <200307262322.SAA09475@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/InstrSched: SchedGraph.h updated: 1.29 -> 1.30 --- Log message: Hrm, another necesary one :( --- Diffs of the changes: Index: llvm/lib/CodeGen/InstrSched/SchedGraph.h diff -u llvm/lib/CodeGen/InstrSched/SchedGraph.h:1.29 llvm/lib/CodeGen/InstrSched/SchedGraph.h:1.30 --- llvm/lib/CodeGen/InstrSched/SchedGraph.h:1.29 Sat Jul 26 18:00:29 2003 +++ llvm/lib/CodeGen/InstrSched/SchedGraph.h Sat Jul 26 18:22:19 2003 @@ -16,6 +16,7 @@ #include "llvm/CodeGen/MachineInstr.h" #include "Support/GraphTraits.h" +#include "Support/hash_map" class Value; class Instruction; From lattner at cs.uiuc.edu Sat Jul 26 18:24:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 18:24:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp Message-ID: <200307262323.SAA11220@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/InstrSched: InstrScheduling.cpp updated: 1.53 -> 1.54 --- Log message: Be const correct --- Diffs of the changes: Index: llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp diff -u llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp:1.53 llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp:1.54 --- llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp:1.53 Thu May 22 16:49:18 2003 +++ llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp Sat Jul 26 18:23:41 2003 @@ -1197,9 +1197,9 @@ nopNodeVec.push_back(graph->getGraphNodeForInstr(MBB[i])); //remove the MI from the Machine Code For Instruction - TerminatorInst *TI = MBB.getBasicBlock()->getTerminator(); + const TerminatorInst *TI = MBB.getBasicBlock()->getTerminator(); MachineCodeForInstruction& llvmMvec = - MachineCodeForInstruction::get((Instruction *)TI); + MachineCodeForInstruction::get((const Instruction *)TI); for(MachineCodeForInstruction::iterator mciI=llvmMvec.begin(), mciE=llvmMvec.end(); mciI!=mciE; ++mciI){ From lattner at cs.uiuc.edu Sat Jul 26 18:26:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 18:26:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineFunction.cpp PHIElimination.cpp Message-ID: <200307262325.SAA13578@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineFunction.cpp updated: 1.40 -> 1.41 PHIElimination.cpp updated: 1.10 -> 1.11 --- Log message: Const correctness fixes --- Diffs of the changes: Index: llvm/lib/CodeGen/MachineFunction.cpp diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.40 llvm/lib/CodeGen/MachineFunction.cpp:1.41 --- llvm/lib/CodeGen/MachineFunction.cpp:1.40 Mon Jun 30 16:58:43 2003 +++ llvm/lib/CodeGen/MachineFunction.cpp Sat Jul 26 18:24:56 2003 @@ -126,7 +126,7 @@ getConstantPool()->print(OS); for (const_iterator BB = begin(); BB != end(); ++BB) { - BasicBlock *LBB = BB->getBasicBlock(); + const BasicBlock *LBB = BB->getBasicBlock(); OS << "\n" << LBB->getName() << " (" << (const void*)LBB << "):\n"; for (MachineBasicBlock::const_iterator I = BB->begin(); I != BB->end();++I){ OS << "\t"; Index: llvm/lib/CodeGen/PHIElimination.cpp diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.10 llvm/lib/CodeGen/PHIElimination.cpp:1.11 --- llvm/lib/CodeGen/PHIElimination.cpp:1.10 Thu Jun 5 12:15:04 2003 +++ llvm/lib/CodeGen/PHIElimination.cpp Sat Jul 26 18:24:56 2003 @@ -200,8 +200,8 @@ // at an appropriate point later. // bool ValueIsLive = false; - BasicBlock *BB = opBlock.getBasicBlock(); - for (succ_iterator SI = succ_begin(BB), E = succ_end(BB); + const BasicBlock *BB = opBlock.getBasicBlock(); + for (succ_const_iterator SI = succ_begin(BB), E = succ_end(BB); SI != E && !ValueIsLive; ++SI) { const std::pair & SuccInfo = LV->getBasicBlockInfo(*SI); From lattner at cs.uiuc.edu Sat Jul 26 18:30:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 18:30:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp Message-ID: <200307262329.SAA18312@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/InstrSelection: InstrSelection.cpp updated: 1.58 -> 1.59 --- Log message: Making this code const-correct would be a pain, so I'll hack it. --- Diffs of the changes: Index: llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp diff -u llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp:1.58 llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp:1.59 --- llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp:1.58 Sat May 31 02:38:37 2003 +++ llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp Sat Jul 26 18:29:40 2003 @@ -189,8 +189,8 @@ // MachineFunction &MF = MachineFunction::get(&F); for (MachineFunction::iterator BB = MF.begin(); BB != MF.end(); ++BB) { - for (BasicBlock::iterator IIt = BB->getBasicBlock()->begin(); - PHINode *PN = dyn_cast(IIt); ++IIt) { + for (BasicBlock::const_iterator IIt = BB->getBasicBlock()->begin(); + const PHINode *PN = dyn_cast(IIt); ++IIt) { // FIXME: This is probably wrong... Value *PhiCpRes = new PHINode(PN->getType(), "PhiCp:"); @@ -209,7 +209,7 @@ for (vector::iterator MI=mvec.begin(); MI != mvec.end(); ++MI) { vector CpVec2 = - FixConstantOperandsForInstr(PN, *MI, Target); + FixConstantOperandsForInstr(const_cast(PN), *MI, Target); CpVec2.push_back(*MI); CpVec.insert(CpVec.end(), CpVec2.begin(), CpVec2.end()); } @@ -218,7 +218,8 @@ } vector mvec; - Target.getRegInfo().cpValue2Value(PhiCpRes, PN, mvec); + Target.getRegInfo().cpValue2Value(PhiCpRes, const_cast(PN), + mvec); BB->insert(BB->begin(), mvec.begin(), mvec.end()); } // for each Phi Instr in BB } // for all BBs in function From lattner at cs.uiuc.edu Sat Jul 26 18:31:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 18:31:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp Message-ID: <200307262330.SAA18337@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/RegAlloc: PhyRegAlloc.cpp updated: 1.99 -> 1.100 --- Log message: Making this code const-correct would be a pain, so I'll hack it. --- Diffs of the changes: Index: llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp diff -u llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp:1.99 llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp:1.100 --- llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp:1.99 Fri Jul 25 16:06:09 2003 +++ llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp Sat Jul 26 18:29:51 2003 @@ -569,7 +569,7 @@ // for (MachineBasicBlock::iterator MII = MBB.begin(); MII != MBB.end(); ++MII) if (!TM.getInstrInfo().isDummyPhiInstr((*MII)->getOpCode()))// ignore Phis - updateInstruction(*MII, MBB.getBasicBlock()); + updateInstruction(*MII, const_cast(MBB.getBasicBlock())); // Now, move code out of delay slots of branches and returns if needed. // (Also, move "after" code from calls to the last delay slot instruction.) From lattner at cs.uiuc.edu Sat Jul 26 18:31:13 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 18:31:13 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineBasicBlock.h Message-ID: <200307262330.SAA19750@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineBasicBlock.h updated: 1.10 -> 1.11 --- Log message: Code generation phases are not allowed to modify the LLVM representation. Because of this, we'll make the MBB->BB mapping const as it should be --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/MachineBasicBlock.h diff -u llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.10 llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.11 --- llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.10 Fri Dec 13 01:30:45 2002 +++ llvm/include/llvm/CodeGen/MachineBasicBlock.h Sat Jul 26 18:30:37 2003 @@ -15,15 +15,15 @@ class MachineBasicBlock { std::vector Insts; MachineBasicBlock *Prev, *Next; - BasicBlock *BB; + const BasicBlock *BB; public: - MachineBasicBlock(BasicBlock *bb = 0) : Prev(0), Next(0), BB(bb) {} + MachineBasicBlock(const BasicBlock *bb = 0) : Prev(0), Next(0), BB(bb) {} ~MachineBasicBlock() {} /// getBasicBlock - Return the LLVM basic block that this instance /// corresponded to originally. /// - BasicBlock *getBasicBlock() const { return BB; } + const BasicBlock *getBasicBlock() const { return BB; } typedef std::vector::iterator iterator; typedef std::vector::const_iterator const_iterator; From lattner at cs.uiuc.edu Sat Jul 26 18:51:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 18:51:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp X86.h X86TargetMachine.cpp Message-ID: <200307262350.SAA23156@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: InstSelectSimple.cpp updated: 1.116 -> 1.117 X86.h updated: 1.14 -> 1.15 X86TargetMachine.cpp updated: 1.19 -> 1.20 --- Log message: Rename function to be more consistent with filename --- Diffs of the changes: Index: llvm/lib/Target/X86/InstSelectSimple.cpp diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.116 llvm/lib/Target/X86/InstSelectSimple.cpp:1.117 --- llvm/lib/Target/X86/InstSelectSimple.cpp:1.116 Sat Jul 26 18:05:37 2003 +++ llvm/lib/Target/X86/InstSelectSimple.cpp Sat Jul 26 18:49:58 2003 @@ -2091,10 +2091,10 @@ } -/// createSimpleX86InstructionSelector - This pass converts an LLVM function +/// createX86SimpleInstructionSelector - This pass converts an LLVM function /// into a machine code representation is a very simple peep-hole fashion. The /// generated code sucks but the implementation is nice and simple. /// -Pass *createSimpleX86InstructionSelector(TargetMachine &TM) { +Pass *createX86SimpleInstructionSelector(TargetMachine &TM) { return new ISel(TM); } Index: llvm/lib/Target/X86/X86.h diff -u llvm/lib/Target/X86/X86.h:1.14 llvm/lib/Target/X86/X86.h:1.15 --- llvm/lib/Target/X86/X86.h:1.14 Wed Jul 23 15:25:08 2003 +++ llvm/lib/Target/X86/X86.h Sat Jul 26 18:49:58 2003 @@ -12,11 +12,11 @@ class TargetMachine; class Pass; -/// createSimpleX86InstructionSelector - This pass converts an LLVM function +/// createX86SimpleInstructionSelector - This pass converts an LLVM function /// into a machine code representation is a very simple peep-hole fashion. The /// generated code sucks but the implementation is nice and simple. /// -Pass *createSimpleX86InstructionSelector(TargetMachine &TM); +Pass *createX86SimpleInstructionSelector(TargetMachine &TM); /// createX86PeepholeOptimizer - Create a pass to perform X86 specific peephole /// optimizations. Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.19 llvm/lib/Target/X86/X86TargetMachine.cpp:1.20 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.19 Wed Jul 23 15:25:08 2003 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Sat Jul 26 18:49:58 2003 @@ -45,7 +45,7 @@ bool X86TargetMachine::addPassesToEmitAssembly(PassManager &PM, std::ostream &Out) { PM.add(createLowerSwitchPass()); - PM.add(createSimpleX86InstructionSelector(*this)); + PM.add(createX86SimpleInstructionSelector(*this)); PM.add(createLocalRegisterAllocator()); PM.add(createX86FloatingPointStackifierPass()); PM.add(createPrologEpilogCodeInserter()); @@ -62,7 +62,7 @@ // FIXME: Implement the switch instruction in the instruction selector! PM.add(createLowerSwitchPass()); - PM.add(createSimpleX86InstructionSelector(*this)); + PM.add(createX86SimpleInstructionSelector(*this)); // TODO: optional optimizations go here From lattner at cs.uiuc.edu Sat Jul 26 19:29:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jul 26 19:29:00 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Jello/hello2.ll simplesttest.ll Message-ID: <200307270028.TAA25473@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Jello: hello2.ll added (r1.1) simplesttest.ll updated: 1.3 -> 1.4 --- Log message: Somehow "simplest" test became a hello world test. Rectify this. --- Diffs of the changes: Index: llvm/test/Regression/Jello/hello2.ll diff -c /dev/null llvm/test/Regression/Jello/hello2.ll:1.1 *** /dev/null Sat Jul 26 19:28:20 2003 --- llvm/test/Regression/Jello/hello2.ll Sat Jul 26 19:28:10 2003 *************** *** 0 **** --- 1,19 ---- + + %X = global int 7 + %msg = internal global [13 x sbyte] c"Hello World\0A\00" + + + implementation + + declare void %printf([13 x sbyte]*) + + void %bar() { + call void %printf([13 x sbyte]* %msg) + ret void + } + + int %main() { + call void %bar() + ret int 0 + } + Index: llvm/test/Regression/Jello/simplesttest.ll diff -u llvm/test/Regression/Jello/simplesttest.ll:1.3 llvm/test/Regression/Jello/simplesttest.ll:1.4 --- llvm/test/Regression/Jello/simplesttest.ll:1.3 Wed Dec 4 17:58:41 2002 +++ llvm/test/Regression/Jello/simplesttest.ll Sat Jul 26 19:28:10 2003 @@ -1,19 +1,7 @@ -%X = global int 7 -%msg = internal global [13 x sbyte] c"Hello World\0A\00" - - implementation -declare void %printf([13 x sbyte]*) - -void %bar() { - call void %printf([13 x sbyte]* %msg) - ret void -} - int %main() { - call void %bar() ret int 0 } From lattner at cs.uiuc.edu Sun Jul 27 22:41:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jul 27 22:41:01 2003 Subject: [llvm-commits] CVS: llvm/utils/TableGen/Record.cpp Record.h Message-ID: <200307280340.WAA27200@apoc.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: Record.cpp updated: 1.8 -> 1.9 Record.h updated: 1.10 -> 1.11 --- Log message: Allow initializing variable initializers with variables --- Diffs of the changes: Index: llvm/utils/TableGen/Record.cpp diff -u llvm/utils/TableGen/Record.cpp:1.8 llvm/utils/TableGen/Record.cpp:1.9 --- llvm/utils/TableGen/Record.cpp:1.8 Thu Dec 5 22:42:10 2002 +++ llvm/utils/TableGen/Record.cpp Sun Jul 27 22:39:57 2003 @@ -127,6 +127,15 @@ return DI; } +Init *RecordRecTy::convertValue(TypedInit *VI) { + // Ensure that VI is compatible with Rec. + if (RecordRecTy *RRT = dynamic_cast(VI->getType())) + if (RRT->getRecord()->isSubClassOf(getRecord()) || + RRT->getRecord() == getRecord()) + return VI; + return 0; +} + //===----------------------------------------------------------------------===// // Initializer implementations //===----------------------------------------------------------------------===// Index: llvm/utils/TableGen/Record.h diff -u llvm/utils/TableGen/Record.h:1.10 llvm/utils/TableGen/Record.h:1.11 --- llvm/utils/TableGen/Record.h:1.10 Fri Jul 25 12:32:51 2003 +++ llvm/utils/TableGen/Record.h Sun Jul 27 22:39:57 2003 @@ -136,7 +136,8 @@ Record *getRecord() const { return Rec; } Init *convertValue(UnsetInit *UI) { return (Init*)UI; } - Init *convertValue( DefInit *DI); + Init *convertValue( DefInit *DI); + Init *convertValue(TypedInit *VI); void print(std::ostream &OS) const; }; From lattner at cs.uiuc.edu Sun Jul 27 22:50:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jul 27 22:50:01 2003 Subject: [llvm-commits] CVS: llvm/utils/TableGen/FileParser.y Message-ID: <200307280349.WAA28345@apoc.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: FileParser.y updated: 1.5 -> 1.6 --- Log message: Add support for Set statements without {}'s. Now we can just say set Foo = bar in def blah: blahclass {} --- Diffs of the changes: Index: llvm/utils/TableGen/FileParser.y diff -u llvm/utils/TableGen/FileParser.y:1.5 llvm/utils/TableGen/FileParser.y:1.6 --- llvm/utils/TableGen/FileParser.y:1.5 Tue May 20 18:45:36 2003 +++ llvm/utils/TableGen/FileParser.y Sun Jul 27 22:49:40 2003 @@ -438,13 +438,20 @@ Object : ClassInst | DefInst; -// Support Set commands wrapping objects... -Object : SET ID OptBitList '=' Value IN { - SetStack.push_back(std::make_pair(std::make_pair(*$2, $3), $5)); - delete $2; - } '{' ObjectList '}' { - delete SetStack.back().first.second; // Delete OptBitList - SetStack.pop_back(); +// SETCommand - A 'SET' statement start... +SETCommand : SET ID OptBitList '=' Value IN { + SetStack.push_back(std::make_pair(std::make_pair(*$2, $3), $5)); + delete $2; +}; + +// Support Set commands wrapping objects... both with and without braces. +Object : SETCommand '{' ObjectList '}' { + delete SetStack.back().first.second; // Delete OptBitList + SetStack.pop_back(); + } + | SETCommand Object { + delete SetStack.back().first.second; // Delete OptBitList + SetStack.pop_back(); }; ObjectList : Object {} | ObjectList Object {}; From lattner at cs.uiuc.edu Sun Jul 27 23:26:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jul 27 23:26:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcV9_Reg.td Message-ID: <200307280425.XAA28811@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcV9_Reg.td updated: 1.1 -> 1.2 --- Log message: Specify the value type for the register, not just the size. --- Diffs of the changes: Index: llvm/lib/Target/Sparc/SparcV9_Reg.td diff -u llvm/lib/Target/Sparc/SparcV9_Reg.td:1.1 llvm/lib/Target/Sparc/SparcV9_Reg.td:1.2 --- llvm/lib/Target/Sparc/SparcV9_Reg.td:1.1 Wed May 28 22:31:43 2003 +++ llvm/lib/Target/Sparc/SparcV9_Reg.td Sun Jul 27 23:25:36 2003 @@ -9,7 +9,10 @@ class V9Reg : Register { set Namespace = "SparcV9"; } // Ri - One of the 32 64 bit integer registers -class Ri num> : V9Reg { set Size = 64; field bits<5> Num = num; } +class Ri num> : V9Reg { + set RegType = i64; // All integer registers are 64 bits in size + field bits<5> Num = num; // Numbers are identified with a 5 bit ID +} 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>; From lattner at cs.uiuc.edu Sun Jul 27 23:26:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jul 27 23:26:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Target.td Message-ID: <200307280425.XAA28791@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target: Target.td updated: 1.1 -> 1.2 --- Log message: Instead of specifying the SIZE of the register, go so far as to specify what value type it is. --- Diffs of the changes: Index: llvm/lib/Target/Target.td diff -u llvm/lib/Target/Target.td:1.1 llvm/lib/Target/Target.td:1.2 --- llvm/lib/Target/Target.td:1.1 Thu May 29 13:48:17 2003 +++ llvm/lib/Target/Target.td Sun Jul 27 23:24:59 2003 @@ -6,9 +6,24 @@ // Target-Independent interface //===----------------------------------------------------------------------===// + +// Value types - These values correspond to the register types defined in the +// MRegsterInfo.h file. +class ValueType {} +def i1 : ValueType; // One bit boolean value +def i8 : ValueType; // 8-bit integer value +def i16 : ValueType; // 16-bit integer value +def i32 : ValueType; // 32-bit integer value +def i64 : ValueType; // 64-bit integer value +def i128 : ValueType; // 128-bit integer value +def f32 : ValueType; // 32-bit floating point value +def f64 : ValueType; // 64-bit floating point value +def f80 : ValueType; // 80-bit floating point value +def f128 : ValueType; // 128-bit floating point value + class Register { string Namespace = ""; - int Size; + ValueType RegType; } class Instruction {