diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-08-23 19:28:39 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-08-23 19:28:39 +0000 |
commit | 157b956e42871b53bb9c72e28d6f3409edb4fe42 (patch) | |
tree | 669101e883a64a51fcc851943f3ff0fb89d551cd /projects | |
parent | c21214ac59735dc71cbbd923ff284a3d60146303 (diff) |
Moved the "SmallExamples" out of the /projects directory and into a new
/examples directory. History was maintained. These programs do not need to
be configured but things in /projects must be.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16002 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'projects')
20 files changed, 0 insertions, 18489 deletions
diff --git a/projects/SmallExamples/Fibonacci/Makefile b/projects/SmallExamples/Fibonacci/Makefile deleted file mode 100644 index df1e12806b..0000000000 --- a/projects/SmallExamples/Fibonacci/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- projects/HowToUseJIT/Makefile -----------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file was developed by Valery A. Khamenya and is distributed under -# the University of Illinois Open Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../.. -TOOLNAME = Fibonacci -USEDLIBS = lli-jit lli-interpreter codegen executionengine x86 selectiondag \ - scalaropts analysis.a transformutils.a bcreader target.a vmcore \ - support.a - -include $(LEVEL)/Makefile.common diff --git a/projects/SmallExamples/Fibonacci/fibonacci.cpp b/projects/SmallExamples/Fibonacci/fibonacci.cpp deleted file mode 100644 index 776378dc1f..0000000000 --- a/projects/SmallExamples/Fibonacci/fibonacci.cpp +++ /dev/null @@ -1,188 +0,0 @@ -//===--- fibonacci.cpp - An example use of the JIT ----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file was developed by Valery A. Khamenya and is distributed under the -// University of Illinois Open Source License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This small program provides an example of how to build quickly a small -// module with function Fibonacci and execute it with the JIT. -// -// This simple example shows as well 30% speed up with LLVM 1.3 -// in comparison to gcc 3.3.3 at AMD Athlon XP 1500+ . -// -// (Modified from HowToUseJIT.cpp and Stacker/lib/compiler/StackerCompiler.cpp) -// -//===------------------------------------------------------------------------=== -// Goal: -// The goal of this snippet is to create in the memory -// the LLVM module consisting of one function as follow: -// -// int fib(int x) { -// if(x<=2) return 1; -// return fib(x-1)+fib(x-2); -// } -// -// then compile the module via JIT, then execute the `fib' -// function and return result to a driver, i.e. to a "host program". -// - -#include <iostream> - -#include <llvm/Module.h> -#include <llvm/DerivedTypes.h> -#include <llvm/Constants.h> -#include <llvm/Instructions.h> -#include <llvm/ModuleProvider.h> -#include <llvm/Analysis/Verifier.h> -#include "llvm/ExecutionEngine/ExecutionEngine.h" -#include "llvm/ExecutionEngine/GenericValue.h" - - -using namespace llvm; - -int main(int argc, char**argv) { - - int n = argc > 1 ? atol(argv[1]) : 44; - - // Create some module to put our function into it. - Module *M = new Module("test"); - - - // We are about to create the "fib" function: - Function *FibF; - - { - // first create type for the single argument of fib function: - // the type is 'int ()' - std::vector<const Type*> ArgT(1); - ArgT[0] = Type::IntTy; - - // now create full type of the "fib" function: - FunctionType *FibT = FunctionType::get(Type::IntTy, // type of result - ArgT, - /*not vararg*/false); - - // Now create the fib function entry and - // insert this entry into module M - // (By passing a module as the last parameter to the Function constructor, - // it automatically gets appended to the Module.) - FibF = new Function(FibT, - Function::ExternalLinkage, // maybe too much - "fib", M); - - // Add a basic block to the function... (again, it automatically inserts - // because of the last argument.) - BasicBlock *BB = new BasicBlock("EntryBlock of fib function", FibF); - - // Get pointers to the constants ... - Value *One = ConstantSInt::get(Type::IntTy, 1); - Value *Two = ConstantSInt::get(Type::IntTy, 2); - - // Get pointers to the integer argument of the add1 function... - assert(FibF->abegin() != FibF->aend()); // Make sure there's an arg - - Argument &ArgX = FibF->afront(); // Get the arg - ArgX.setName("AnArg"); // Give it a nice symbolic name for fun. - - SetCondInst* CondInst - = new SetCondInst( Instruction::SetLE, - &ArgX, Two ); - - BB->getInstList().push_back(CondInst); - - // Create the true_block - BasicBlock* true_bb = new BasicBlock("arg<=2"); - - - // Create the return instruction and add it - // to the basic block for true case: - true_bb->getInstList().push_back(new ReturnInst(One)); - - // Create an exit block - BasicBlock* exit_bb = new BasicBlock("arg>2"); - - { - - // create fib(x-1) - CallInst* CallFibX1; - { - // Create the sub instruction... does not insert... - Instruction *Sub - = BinaryOperator::create(Instruction::Sub, &ArgX, One, - "arg"); - - exit_bb->getInstList().push_back(Sub); - - CallFibX1 = new CallInst(FibF, Sub, "fib(x-1)"); - exit_bb->getInstList().push_back(CallFibX1); - - } - - // create fib(x-2) - CallInst* CallFibX2; - { - // Create the sub instruction... does not insert... - Instruction * Sub - = BinaryOperator::create(Instruction::Sub, &ArgX, Two, - "arg"); - - exit_bb->getInstList().push_back(Sub); - CallFibX2 = new CallInst(FibF, Sub, "fib(x-2)"); - exit_bb->getInstList().push_back(CallFibX2); - - } - - // Create the add instruction... does not insert... - Instruction *Add = - BinaryOperator::create(Instruction::Add, - CallFibX1, CallFibX2, "addresult"); - - // explicitly insert it into the basic block... - exit_bb->getInstList().push_back(Add); - - // Create the return instruction and add it to the basic block - exit_bb->getInstList().push_back(new ReturnInst(Add)); - } - - // Create a branch on the SetCond - BranchInst* br_inst = - new BranchInst( true_bb, exit_bb, CondInst ); - - BB->getInstList().push_back( br_inst ); - FibF->getBasicBlockList().push_back(true_bb); - FibF->getBasicBlockList().push_back(exit_bb); - } - - // Now we going to create JIT - ExistingModuleProvider* MP = new ExistingModuleProvider(M); - ExecutionEngine* EE = ExecutionEngine::create( MP, false ); - - // Call the `foo' function with argument n: - std::vector<GenericValue> args(1); - args[0].IntVal = n; - - - std::clog << "verifying... "; - if (verifyModule(*M)) { - std::cerr << argv[0] - << ": assembly parsed, but does not verify as correct!\n"; - return 1; - } - else - std::clog << "OK\n"; - - - std::clog << "We just constructed this LLVM module:\n\n---------\n" << *M; - std::clog << "---------\nstarting fibonacci(" - << n << ") with JIT...\n" << std::flush; - - GenericValue gv = EE->runFunction(FibF, args); - - // import result of execution: - std::cout << "Result: " << gv.IntVal << std:: endl; - - return 0; -} diff --git a/projects/SmallExamples/HowToUseJIT/HowToUseJIT.cpp b/projects/SmallExamples/HowToUseJIT/HowToUseJIT.cpp deleted file mode 100644 index 889b34aa95..0000000000 --- a/projects/SmallExamples/HowToUseJIT/HowToUseJIT.cpp +++ /dev/null @@ -1,109 +0,0 @@ -//===--- HowToUseJIT.cpp - An example use of the JIT ----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file was developed by Valery A. Khamenya and is distributed under the -// University of Illinois Open Source License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This small program provides an example of how to quickly build a small -// module with two functions and execute it with the JIT. -// -// Goal: -// The goal of this snippet is to create in the memory -// the LLVM module consisting of two functions as follow: -// -// int add1(int x) { -// return x+1; -// } -// -// int foo() { -// return add1(10); -// } -// -// then compile the module via JIT, then execute the `foo' -// function and return result to a driver, i.e. to a "host program". -// -// Some remarks and questions: -// -// - could we invoke some code using noname functions too? -// e.g. evaluate "foo()+foo()" without fears to introduce -// conflict of temporary function name with some real -// existing function name? -// -//===----------------------------------------------------------------------===// - -#include "llvm/Module.h" -#include "llvm/Constants.h" -#include "llvm/Type.h" -#include "llvm/Instructions.h" -#include "llvm/ModuleProvider.h" -#include "llvm/ExecutionEngine/ExecutionEngine.h" -#include "llvm/ExecutionEngine/GenericValue.h" -#include <iostream> -using namespace llvm; - -int main() { - // Create some module to put our function into it. - Module *M = new Module("test"); - - // Create the add1 function entry and insert this entry into module M. The - // function will have a return type of "int" and take an argument of "int". - // The '0' terminates the list of argument types. - Function *Add1F = M->getOrInsertFunction("add1", Type::IntTy, Type::IntTy, 0); - - // Add a basic block to the function. As before, it automatically inserts - // because of the last argument. - BasicBlock *BB = new BasicBlock("EntryBlock", Add1F); - - // Get pointers to the constant `1'. - Value *One = ConstantSInt::get(Type::IntTy, 1); - - // Get pointers to the integer argument of the add1 function... - assert(Add1F->abegin() != Add1F->aend()); // Make sure there's an arg - Argument *ArgX = Add1F->abegin(); // Get the arg - ArgX->setName("AnArg"); // Give it a nice symbolic name for fun. - - // Create the add instruction, inserting it into the end of BB. - Instruction *Add = BinaryOperator::createAdd(One, ArgX, "addresult", BB); - - // Create the return instruction and add it to the basic block - new ReturnInst(Add, BB); - - // Now, function add1 is ready. - - - // Now we going to create function `foo', which returns an int and takes no - // arguments. - Function *FooF = M->getOrInsertFunction("foo", Type::IntTy, 0); - - // Add a basic block to the FooF function. - BB = new BasicBlock("EntryBlock", FooF); - - // Get pointers to the constant `10'. - Value *Ten = ConstantSInt::get(Type::IntTy, 10); - - // Pass Ten to the call call: - std::vector<Value*> Params; - Params.push_back(Ten); - CallInst * Add1CallRes = new CallInst(Add1F, Params, "add1", BB); - - // Create the return instruction and add it to the basic block. - new ReturnInst(Add1CallRes, BB); - - // Now we create the JIT. - ExistingModuleProvider* MP = new ExistingModuleProvider(M); - ExecutionEngine* EE = ExecutionEngine::create(MP, false); - - std::cout << "We just constructed this LLVM module:\n\n" << *M; - std::cout << "\n\nRunning foo: " << std::flush; - - // Call the `foo' function with no arguments: - std::vector<GenericValue> noargs; - GenericValue gv = EE->runFunction(FooF, noargs); - - // Import result of execution: - std::cout << "Result: " << gv.IntVal << "\n"; - return 0; -} diff --git a/projects/SmallExamples/HowToUseJIT/Makefile b/projects/SmallExamples/HowToUseJIT/Makefile deleted file mode 100644 index 519c38ea09..0000000000 --- a/projects/SmallExamples/HowToUseJIT/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- projects/HowToUseJIT/Makefile -----------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file was developed by Valery A. Khamenya and is distributed under -# the University of Illinois Open Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../.. -TOOLNAME = HowToUseJIT -USEDLIBS = lli-jit lli-interpreter codegen executionengine x86 selectiondag \ - scalaropts analysis.a transformutils.a bcreader target.a vmcore \ - support.a - -include $(LEVEL)/Makefile.common diff --git a/projects/SmallExamples/Makefile b/projects/SmallExamples/Makefile deleted file mode 100644 index 9bf67bf2d4..0000000000 --- a/projects/SmallExamples/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- projects/Makefile ------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file was developed by the LLVM research group and is distributed under -# the University of Illinois Open Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL=../.. - -include $(LEVEL)/Makefile.config - -DIRS = Fibonacci HowToUseJIT - -include $(BUILD_SRC_ROOT)/Makefile.rules diff --git a/projects/SmallExamples/ModuleMaker/Makefile b/projects/SmallExamples/ModuleMaker/Makefile deleted file mode 100644 index 034ab053ba..0000000000 --- a/projects/SmallExamples/ModuleMaker/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -##===- projects/ModuleMaker/Makefile -----------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file was developed by the LLVM research group and is distributed under -# the University of Illinois Open Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -# -# This is a sample Makefile for a project that uses LLVM. -# - -# -# Indicates our relative path to the top of the project's root directory. -# -LEVEL = . - -# -# Directories that needs to be built. -# -DIRS = tools - -# -# Include the Master Makefile that knows how to build all. -# -include $(LEVEL)/Makefile.common - diff --git a/projects/SmallExamples/ModuleMaker/Makefile.common.in b/projects/SmallExamples/ModuleMaker/Makefile.common.in deleted file mode 100644 index 1f1cfc3c2e..0000000000 --- a/projects/SmallExamples/ModuleMaker/Makefile.common.in +++ /dev/null @@ -1,23 +0,0 @@ -# -# Configure the location of the LLVM object root. We know it is two -# directories up. The source tree location we do not know; let the LLVM -# Makefiles find it for us. -# -LLVM_OBJ_ROOT=$(LEVEL)/../../.. - -# -# Grab the LLVM configuration file. -# -include $(LEVEL)/../../../Makefile.config - -# -# Reconfigure the source directories -# -BUILD_SRC_ROOT:=$(LLVM_SRC_ROOT)/projects/SmallExamples/ModuleMaker -BUILD_SRC_DIR := $(subst //,/,$(BUILD_SRC_ROOT)/$(patsubst $(BUILD_OBJ_ROOT)%,%,$(BUILD_OBJ_DIR))) - -# -# Include LLVM's build rules. -# -include $(LLVM_SRC_ROOT)/Makefile.rules - diff --git a/projects/SmallExamples/ModuleMaker/README.txt b/projects/SmallExamples/ModuleMaker/README.txt deleted file mode 100644 index 877cf8fb98..0000000000 --- a/projects/SmallExamples/ModuleMaker/README.txt +++ /dev/null @@ -1,9 +0,0 @@ -//===----------------------------------------------------------------------===// -// ModuleMaker Sample project -//===----------------------------------------------------------------------===// - -This project is a extremely simple example of two things: building an LLVM -"project" and using some simple pieces of the LLVM API. The actual executable -generated by this project simply emits an LLVM bytecode file to standard output. -It is designed to show some basic usage of LLVM APIs, and how to link to LLVM -libraries. diff --git a/projects/SmallExamples/ModuleMaker/autoconf/LICENSE.TXT b/projects/SmallExamples/ModuleMaker/autoconf/LICENSE.TXT deleted file mode 100644 index 72fdd39edc..0000000000 --- a/projects/SmallExamples/ModuleMaker/autoconf/LICENSE.TXT +++ /dev/null @@ -1,24 +0,0 @@ ------------------------------------------------------------------------------- -Autoconf Files ------------------------------------------------------------------------------- -All autoconf files are licensed under the LLVM license with the following -additions: - -llvm/autoconf/install-sh: - This script is licensed under the LLVM license, with the following - additional copyrights and restrictions: - - 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. - -Please see the source files for additional copyrights. - diff --git a/projects/SmallExamples/ModuleMaker/autoconf/aclocal.m4 b/projects/SmallExamples/ModuleMaker/autoconf/aclocal.m4 deleted file mode 100644 index e9b9180df4..0000000000 --- a/projects/SmallExamples/ModuleMaker/autoconf/aclocal.m4 +++ /dev/null @@ -1,6168 +0,0 @@ -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -## Copyright 1996, 1997, 1998, 1999, 2000, 2001 -## Free Software Foundation, Inc. -## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -## -## As a special exception to the GNU General Public License, if you -## distribute this file as part of a program that contains a -## configuration script generated by Autoconf, you may include it under -## the same distribution terms that you use for the rest of that program. - -# serial 47 AC_PROG_LIBTOOL - - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -m4_ifdef([AC_PROVIDE_IFELSE], - [], - [m4_define([AC_PROVIDE_IFELSE], - [m4_ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) -dnl And a similar setup for Fortran 77 support - AC_PROVIDE_IFELSE([AC_PROG_F77], - [AC_LIBTOOL_F77], - [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], - defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -])])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/mklib' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.50)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] - -# Same as above, but do not quote variable references. -[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=mklib -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -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 <<EOF -[$]* -EOF - exit 0 -fi - -# 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 - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string="`eval $cmd`") 2>/dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - |