mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-10-10 21:04:56 +00:00
Merged in autoconf branch. This provides configuration via the autoconf
system. llvm-svn: 7014
This commit is contained in:
parent
53426e6526
commit
3ef61afb76
@ -30,14 +30,24 @@
|
||||
# are in, if they are not in the current directory. This should include a
|
||||
# trailing / character.
|
||||
#
|
||||
# 6. PROJ_COMPILE - If set to 1, then this makefile can also be used to
|
||||
# compile other projects using llvm. Note if this option is set then the
|
||||
# following *must* hold
|
||||
# PROJLEVEL should be set to the top of the source directory for the
|
||||
# project files
|
||||
# LEVEL should be set to the top of LLVM source tree
|
||||
# LLVM_LIB_DIR should be set to the top of the LLVM build tree
|
||||
# 6. LLVM_SRC_ROOT - If specified, points to the top of the LLVM source tree.
|
||||
#
|
||||
# 7. LLVM_OBJ_ROOT - If specified, points to the top directory where LLVM
|
||||
# object files are placed.
|
||||
#
|
||||
# 8. BUILD_SRC_DIR - The directory which contains the current set of Makefiles
|
||||
# and usually the source code too (unless SourceDir is set).
|
||||
#
|
||||
# 9. BUILD_SRC_ROOT - The root directory of the source code being compiled.
|
||||
#
|
||||
# 10. BUILD_OBJ_DIR - The directory where object code should be placed.
|
||||
#
|
||||
# 11. BUILD_OBJ_ROOT - The root directory for where object code should be
|
||||
# placed.
|
||||
#
|
||||
# For building,
|
||||
# LLVM, LLVM_SRC_ROOT = BUILD_SRC_ROOT, and
|
||||
# LLVM_OBJ_ROOT = BUILD_OBJ_ROOT.
|
||||
#===-----------------------------------------------------------------------====
|
||||
|
||||
#
|
||||
@ -75,15 +85,21 @@ ifndef BUILD_SRC_ROOT
|
||||
BUILD_SRC_ROOT = $(shell cd $(BUILD_SRC_DIR)/$(LEVEL); pwd)
|
||||
endif
|
||||
|
||||
#
|
||||
# Determine the path of the source tree relative from $HOME (the mythical
|
||||
# home directory).
|
||||
#
|
||||
HOME_OBJ_ROOT := $(OBJ_ROOT)/$(patsubst $(HOME)%,%,$(BUILD_SRC_ROOT))
|
||||
|
||||
#
|
||||
# Set the object build directory. Its location depends upon the source path
|
||||
# and where object files should go.
|
||||
#
|
||||
ifndef BUILD_OBJ_DIR
|
||||
ifeq ($(OBJ_ROOT),.)
|
||||
BUILD_OBJ_DIR = $(shell pwd)
|
||||
BUILD_OBJ_DIR = $(BUILD_SRC_DIR)
|
||||
else
|
||||
BUILD_OBJ_DIR := $(OBJ_ROOT)$(patsubst $(shell dirname $(BUILD_SRC_ROOT))%,%,$(shell cd $(BUILD_SRC_DIR); pwd))
|
||||
BUILD_OBJ_DIR := $(HOME_OBJ_ROOT)$(patsubst $(BUILD_SRC_ROOT)%,%,$(BUILD_SRC_DIR))
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -92,9 +108,9 @@ endif
|
||||
#
|
||||
ifndef BUILD_OBJ_ROOT
|
||||
ifeq ($(OBJ_ROOT),.)
|
||||
BUILD_OBJ_ROOT = $(shell cd $(LEVEL); pwd)
|
||||
BUILD_OBJ_ROOT = $(BUILD_SRC_ROOT)
|
||||
else
|
||||
BUILD_OBJ_ROOT := $(OBJ_ROOT)$(patsubst $(shell dirname $(BUILD_SRC_ROOT))%,%,$(shell cd $(BUILD_SRC_ROOT); pwd))
|
||||
BUILD_OBJ_ROOT := $(HOME_OBJ_ROOT)
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -113,16 +129,15 @@ ifndef LLVM_OBJ_ROOT
|
||||
LLVM_OBJ_ROOT = $(BUILD_OBJ_ROOT)
|
||||
endif
|
||||
|
||||
# Figure out how to do platform specific stuff on this platform. This is really
|
||||
# gross and should be autoconfiscated (automake actually), but should hopefully
|
||||
# work on Linux and solaris (SunOS).
|
||||
#
|
||||
UNAME := $(shell uname)
|
||||
include $(LLVM_SRC_ROOT)/Makefile.$(UNAME)
|
||||
###########################################################################
|
||||
# Default Targets:
|
||||
# The following targets are the standard top level targets for
|
||||
# building.
|
||||
###########################################################################
|
||||
|
||||
ifdef SHARED_LIBRARY
|
||||
# if SHARED_LIBRARY is specified, the default is to build the dynamic lib
|
||||
dynamic ::
|
||||
all:: dynamic
|
||||
endif
|
||||
|
||||
# Default Rule: Make sure it's also a :: rule
|
||||
@ -134,6 +149,22 @@ install ::
|
||||
# Default rule for test. It ensures everything has a test rule
|
||||
test::
|
||||
|
||||
# Print out the directories used for building
|
||||
prdirs::
|
||||
echo "Home Offset : " $(HOME_OBJ_ROOT);
|
||||
echo "Build Source Root: " $(BUILD_SRC_ROOT);
|
||||
echo "Build Source Dir : " $(BUILD_SRC_DIR);
|
||||
echo "Build Object Root: " $(BUILD_OBJ_ROOT);
|
||||
echo "Build Object Dir : " $(BUILD_OBJ_DIR);
|
||||
echo "LLVM Source Root: " $(LLVM_SRC_ROOT);
|
||||
echo "LLVM Object Root: " $(LLVM_OBJ_ROOT);
|
||||
|
||||
###########################################################################
|
||||
# Miscellaneous paths and commands:
|
||||
# This section defines various configuration macros, such as where
|
||||
# to find burg, tblgen, and libtool.
|
||||
###########################################################################
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Variables derived from configuration options...
|
||||
#--------------------------------------------------------------------
|
||||
@ -157,8 +188,21 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# Enable this for profiling support with 'gprof'
|
||||
# This automatically enables optimized builds.
|
||||
#
|
||||
ifdef ENABLE_PROFILING
|
||||
PROFILE = -pg
|
||||
endif
|
||||
|
||||
#
|
||||
# Suffixes for library compilation rules
|
||||
#
|
||||
.SUFFIXES: .so
|
||||
|
||||
###########################################################################
|
||||
# Library Locations
|
||||
# Library Locations:
|
||||
# These variables describe various library locations:
|
||||
#
|
||||
# DEST* = Location of where libraries that are built will be placed.
|
||||
@ -208,36 +252,45 @@ PROJTOOLRELEASE := $(BUILD_OBJ_ROOT)/tools/Release
|
||||
PROJTOOLPROFILE := $(BUILD_OBJ_ROOT)/tools/Profile
|
||||
PROJTOOLCURRENT := $(BUILD_OBJ_ROOT)/tools/$(CONFIGURATION)
|
||||
|
||||
#
|
||||
# Libtool is found in the current directory.
|
||||
#
|
||||
ifdef VERBOSE
|
||||
LIBTOOL=$(LLVM_SRC_ROOT)/libtool
|
||||
else
|
||||
LIBTOOL=$(LLVM_SRC_ROOT)/libtool --silent
|
||||
endif
|
||||
|
||||
#
|
||||
# Verbosity levels
|
||||
#
|
||||
ifndef VERBOSE
|
||||
VERB := @
|
||||
endif
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Compilation options...
|
||||
#---------------------------------------------------------
|
||||
###########################################################################
|
||||
# Miscellaneous paths and commands (part deux):
|
||||
# This section defines various configuration macros, such as where
|
||||
# to find burg, tblgen, and libtool.
|
||||
###########################################################################
|
||||
|
||||
###########################################################################
|
||||
# Special tools used while building the LLVM tree. Burg is built as part of the
|
||||
# utils directory.
|
||||
###########################################################################
|
||||
#--------------------------------------------------------------------------
|
||||
# Special tools used while building the LLVM tree. Burg is built as part
|
||||
# of the utils directory.
|
||||
#--------------------------------------------------------------------------
|
||||
BURG := $(LLVMTOOLCURRENT)/burg
|
||||
RunBurg := $(BURG) $(BURG_OPTS)
|
||||
|
||||
TBLGEN := $(LLVMTOOLCURRENT)/tblgen
|
||||
|
||||
# Enable this for profiling support with 'gprof'
|
||||
# This automatically enables optimized builds.
|
||||
ifdef ENABLE_PROFILING
|
||||
PROFILE = -pg
|
||||
endif
|
||||
|
||||
###########################################################################
|
||||
# Compile Time Flags
|
||||
###########################################################################
|
||||
|
||||
#
|
||||
# Include both the project headers and the LLVM headers for compilation
|
||||
# Include both the project headers and the LLVM headers for compilation and
|
||||
# dependency computation.
|
||||
#
|
||||
CPPFLAGS += -I$(BUILD_SRC_ROOT)/include -I$(LLVM_SRC_ROOT)/include
|
||||
|
||||
@ -254,47 +307,71 @@ CPPFLAGS += -D_GNU_SOURCE
|
||||
CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused -I$(LEVEL)/include
|
||||
CompileOptimizeOpts := -O3 -DNDEBUG -finline-functions -fshort-enums
|
||||
|
||||
#
|
||||
# Compile commands with libtool.
|
||||
#
|
||||
Compile := $(LIBTOOL) --mode=compile $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts)
|
||||
CompileC := $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CCFLAGS) $(CompileCommonOpts)
|
||||
|
||||
#
|
||||
# Add the LLVM specific "-only-static" option so that we only compile .o files
|
||||
# once when not building a shared library.
|
||||
#
|
||||
# For shared libraries, we will end up building twice, but that doesn't happen
|
||||
# very often, so we'll let it go.
|
||||
#
|
||||
ifndef SHARED_LIBRARY
|
||||
Compile := $(Compile) -only-static
|
||||
CompileC := $(CompileC) -only-static
|
||||
endif
|
||||
|
||||
# Compile a cpp file, don't link...
|
||||
Compile := $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts)
|
||||
CompileG := $(Compile) -g -D_DEBUG
|
||||
CompileO := $(Compile) $(CompileOptimizeOpts) -felide-constructors -fomit-frame-pointer
|
||||
CompileP := $(Compile) $(CompileOptimizeOpts) -felide-constructors $(PROFILE)
|
||||
|
||||
# Compile a c file, don't link...
|
||||
CompileC := $(CC) -c $(CPPFLAGS) $(CCFLAGS) $(CompileCommonOpts)
|
||||
CompileCG := $(CompileC) -g -D_DEBUG
|
||||
CompileCO := $(CompileC) $(CompileOptimizeOpts) -fomit-frame-pointer
|
||||
CompileCP := $(CompileC) $(CompileOptimizeOpts) $(PROFILE)
|
||||
|
||||
###########################################################################
|
||||
# Link Time Options
|
||||
###########################################################################
|
||||
|
||||
#
|
||||
# Link final executable
|
||||
|
||||
# (Note that we always link with the C++ compiler).
|
||||
#
|
||||
ifdef ENABLE_PURIFY # To enable purify, build with 'gmake ENABLE_PURIFY=1'
|
||||
Link := $(PURIFY) $(CXX) -static
|
||||
Link := $(PURIFY) $(LIBTOOL) --mode=link $(CXX) -static
|
||||
else
|
||||
Link := $(CXX)
|
||||
Link := $(LIBTOOL) --mode=link $(CXX)
|
||||
endif
|
||||
|
||||
ifdef PROJ_COMPILE
|
||||
# include both projlib source and llvmlib source
|
||||
# link both projlib and llvmlib libraries
|
||||
LinkG := $(Link) -g -L$(PROJLIBDEBUGSOURCE) -L$(LLVMLIBDEBUGSOURCE) $(STRIP)
|
||||
LinkO := $(Link) -O3 -L$(PROJLIBRELEASESOURCE) -L$(LLVMLIBRELEASESOURCE)
|
||||
LinkP := $(Link) -O3 -L$(PROJLIBPROFILESOURCE) -L$(LLVMLIBPROFILESOURCE) $(PROFILE)
|
||||
else
|
||||
LinkG := $(Link) -g -L$(LLVMLIBDEBUGSOURCE) $(STRIP)
|
||||
LinkO := $(Link) -O3 -L$(LLVMLIBRELEASESOURCE)
|
||||
LinkP := $(Link) -O3 -L$(LLVMLIBPROFILESOURCE) $(PROFILE)
|
||||
endif
|
||||
|
||||
|
||||
|
||||
# Create one .o file from a bunch of .o files...
|
||||
Relink = ${LD} -r
|
||||
Relink = ${LIBTOOL} --mode=link $(CXX)
|
||||
|
||||
# MakeSO - Create a .so file from a .o files...
|
||||
MakeSO := $(CXX) $(MakeSharedObjectOption)
|
||||
MakeSOO := $(MakeSO) -O3
|
||||
MakeSOP := $(MakeSOO) $(PROFILE)
|
||||
#MakeSO := $(LIBTOOL) --mode=link $(CXX) $(MakeSharedObjectOption)
|
||||
#MakeSOO := $(MakeSO) -O3
|
||||
#MakeSOP := $(MakeSOO) $(PROFILE)
|
||||
|
||||
#
|
||||
# Configure where the item being compiled should go.
|
||||
#
|
||||
ifdef SHARED_LIBRARY
|
||||
Link := $(Link) -rpath $(DESTLIBCURRENT)
|
||||
endif
|
||||
|
||||
ifdef TOOLNAME
|
||||
Link := $(Link) -rpath $(DESTTOOLCURRENT)
|
||||
endif
|
||||
|
||||
# Create dependancy file from CPP file, send to stdout.
|
||||
Depend := $(CXX) -MM -I$(LEVEL)/include $(CPPFLAGS)
|
||||
@ -313,11 +390,10 @@ ifndef Source
|
||||
Source := $(ExtraSource) $(wildcard *.cpp *.c *.y *.l)
|
||||
endif
|
||||
|
||||
Objs := $(sort $(patsubst Debug/%.o, %.o, $(addsuffix .o,$(notdir $(basename $(Source))))))
|
||||
ObjectsO := $(addprefix $(BUILD_OBJ_DIR)/Release/,$(Objs))
|
||||
ObjectsP := $(addprefix $(BUILD_OBJ_DIR)/Profile/,$(Objs))
|
||||
ObjectsG := $(addprefix $(BUILD_OBJ_DIR)/Debug/,$(Objs))
|
||||
|
||||
LObjs := $(sort $(patsubst Debug/%.lo, %.lo, $(addsuffix .lo,$(notdir $(basename $(Source))))))
|
||||
LObjectsO := $(addprefix $(BUILD_OBJ_DIR)/Release/,$(LObjs))
|
||||
LObjectsP := $(addprefix $(BUILD_OBJ_DIR)/Profile/,$(LObjs))
|
||||
LObjectsG := $(addprefix $(BUILD_OBJ_DIR)/Debug/,$(LObjs))
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Handle the DIRS and PARALLEL_DIRS options
|
||||
@ -341,6 +417,7 @@ test :: $(addsuffix /.maketest , $(PARALLEL_DIRS))
|
||||
$(VERB) cd $(@D); $(MAKE) $(subst $(@D)/.make,,$@)
|
||||
endif
|
||||
|
||||
# Handle directories that may or may not exist
|
||||
ifdef OPTIONAL_DIRS
|
||||
all install clean test ::
|
||||
$(VERB) for dir in ${OPTIONAL_DIRS}; do \
|
||||
@ -351,6 +428,9 @@ all install clean test ::
|
||||
done
|
||||
endif
|
||||
|
||||
###########################################################################
|
||||
# Library Build Rules:
|
||||
#
|
||||
#---------------------------------------------------------
|
||||
# Handle the LIBRARYNAME option - used when building libs...
|
||||
#---------------------------------------------------------
|
||||
@ -367,6 +447,7 @@ endif
|
||||
# it's built as a .o file, then all of the constituent .o files in it will be
|
||||
# linked into tools (for example gccas) even if they only use one of the parts
|
||||
# of it. For this reason, sometimes it's useful to use libraries as .a files.
|
||||
###########################################################################
|
||||
|
||||
ifdef LIBRARYNAME
|
||||
|
||||
@ -383,6 +464,11 @@ LIBNAME_OBJO := $(DESTLIBRELEASE)/$(LIBRARYNAME).o
|
||||
LIBNAME_OBJP := $(DESTLIBPROFILE)/$(LIBRARYNAME).o
|
||||
LIBNAME_OBJG := $(DESTLIBDEBUG)/$(LIBRARYNAME).o
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Library Targets
|
||||
# Modify the top level targets to build the desired libraries.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
# dynamic target builds a shared object version of the library...
|
||||
dynamic:: $(DESTLIBCURRENT)/lib$(LIBRARYNAME).so
|
||||
|
||||
@ -396,44 +482,60 @@ ifdef BUILD_ARCHIVE
|
||||
all:: $(DESTLIBCURRENT)/lib$(LIBRARYNAME).a
|
||||
endif
|
||||
|
||||
$(LIBNAME_O): $(ObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) release library =======
|
||||
$(VERB) $(MakeSOO) -o $@ $(ObjectsO) $(LibSubDirs) $(LibLinkOpts)
|
||||
#--------------------------------------------------------------------
|
||||
# Rules for building libraries
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
$(LIBNAME_P): $(ObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) profile library =======
|
||||
$(VERB) $(MakeSOP) -o $@ $(ObjectsP) $(LibSubDirs) $(LibLinkOpts)
|
||||
#
|
||||
# Rules for building dynamically linked libraries.
|
||||
#
|
||||
$(LIBNAME_O): $(LObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) dynamic release library =======
|
||||
$(VERB) $(Link) -o $*.la $(LObjectsO) $(LibSubDirs) $(LibLinkOpts);
|
||||
$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $*.la $(DESTLIBCURRENT);
|
||||
|
||||
$(LIBNAME_G): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) debug library =======
|
||||
$(VERB) $(MakeSO) -g -o $@ $(ObjectsG) $(LibSubDirs) $(LibLinkOpts)
|
||||
$(LIBNAME_P): $(LObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) dynamic profile library =======
|
||||
$(VERB) $(Link) -o $*.la $(LObjectsP) $(LibSubDirs) $(LibLinkOpts);
|
||||
$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $*.la $(DESTLIBCURRENT);
|
||||
|
||||
$(LIBNAME_AO): $(ObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) release library =======
|
||||
@rm -f $@
|
||||
$(VERB) $(AR) $@ $(ObjectsO) $(LibSubDirs)
|
||||
$(LIBNAME_G): $(LObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) dynamic debug library =======
|
||||
$(VERB) $(Link) -o $*.la $(LObjectsG) $(LibSubDirs) $(LibLinkOpts);
|
||||
$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $*.la $(DESTLIBCURRENT);
|
||||
|
||||
$(LIBNAME_AP): $(ObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) profile library =======
|
||||
@rm -f $@
|
||||
$(VERB) $(AR) $@ $(ObjectsP) $(LibSubDirs)
|
||||
#
|
||||
# Rules for building static archive libraries.
|
||||
#
|
||||
$(LIBNAME_AO): $(LObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) archive release library =======
|
||||
@$(RM) -f $@
|
||||
$(VERB) $(Link) -03 -o $@ $(LObjectsO) $(LibSubDirs) -static
|
||||
|
||||
$(LIBNAME_AG): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) debug library =======
|
||||
@rm -f $@
|
||||
$(VERB) $(AR) $@ $(ObjectsG) $(LibSubDirs)
|
||||
$(LIBNAME_AP): $(LObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) archive profile library =======
|
||||
@$(RM) -f $@
|
||||
$(VERB) $(Link) -03 $(PROFILE) -o $@ $(LObjectsP) $(LibSubDirs) -static
|
||||
|
||||
$(LIBNAME_OBJO): $(ObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
|
||||
$(LIBNAME_AG): $(LObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) archive debug library =======
|
||||
@$(RM) -f $@
|
||||
$(VERB) $(Link) -g $(STRIP) -o $@ $(LObjectsG) $(LibSubDirs) -static
|
||||
|
||||
#
|
||||
# Rules for building .o libraries.
|
||||
#
|
||||
$(LIBNAME_OBJO): $(LObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
|
||||
@echo "Linking $@"
|
||||
$(VERB) $(Relink) -o $@ $(ObjectsO) $(LibSubDirs)
|
||||
$(VERB) $(Relink) -o $@ $(LObjectsO) $(LibSubDirs)
|
||||
|
||||
$(LIBNAME_OBJP): $(ObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
|
||||
$(LIBNAME_OBJP): $(LObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
|
||||
@echo "Linking $@"
|
||||
$(VERB) $(Relink) -o $@ $(ObjectsP) $(LibSubDirs)
|
||||
$(VERB) $(Relink) -o $@ $(LObjectsP) $(LibSubDirs)
|
||||
|
||||
$(LIBNAME_OBJG): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
|
||||
$(LIBNAME_OBJG): $(LObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
|
||||
@echo "Linking $@"
|
||||
$(VERB) $(Relink) -o $@ $(ObjectsG) $(LibSubDirs)
|
||||
$(VERB) $(Relink) -o $@ $(LObjectsG) $(LibSubDirs)
|
||||
|
||||
endif
|
||||
|
||||
@ -441,11 +543,16 @@ endif
|
||||
# Create a TAGS database for emacs
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
ifdef ETAGS
|
||||
ifeq ($(LEVEL), .)
|
||||
tags:
|
||||
etags -l c++ `find include lib tools -name '*.cpp' -o -name '*.h'`
|
||||
$(ETAGS) -l c++ `find include lib tools -name '*.cpp' -o -name '*.h'`
|
||||
all:: tags
|
||||
endif
|
||||
else
|
||||
tags:
|
||||
${ECHO} "Cannot build $@: The program etags is not installed"
|
||||
endif
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Handle the TOOLNAME option - used when building tool executables...
|
||||
@ -487,8 +594,14 @@ STATICUSEDLIBS := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
|
||||
USED_LIB_PATHS_G := $(addprefix $(DESTLIBDEBUG)/, $(STATICUSEDLIBS))
|
||||
USED_LIB_PATHS_O := $(addprefix $(DESTLIBRELEASE)/, $(STATICUSEDLIBS))
|
||||
USED_LIB_PATHS_P := $(addprefix $(DESTLIBPROFILE)/, $(STATICUSEDLIBS))
|
||||
LINK_OPTS := $(TOOLLINKOPTS) $(PLATFORMLINKOPTS)
|
||||
#LINK_OPTS := $(TOOLLINKOPTS) $(PLATFORMLINKOPTS)
|
||||
|
||||
#
|
||||
# Libtool link options:
|
||||
# Ensure that all binaries have their symbols exported so that they can
|
||||
# by dlsym'ed.
|
||||
#
|
||||
LINK_OPTS := -export-dynamic $(TOOLLINKOPTS)
|
||||
|
||||
|
||||
|
||||
@ -502,19 +615,19 @@ $(USED_LIB_PATHS_G) $(USED_LIB_PATHS_O) $(USED_LIB_PATHS_P): \
|
||||
all:: $(TOOLEXENAMES)
|
||||
|
||||
clean::
|
||||
$(VERB) rm -f $(TOOLEXENAMES)
|
||||
$(VERB) $(RM) -f $(TOOLEXENAMES)
|
||||
|
||||
$(TOOLEXENAME_G): $(ObjectsG) $(USED_LIB_PATHS_G) $(DESTTOOLDEBUG)/.dir
|
||||
$(TOOLEXENAME_G): $(LObjectsG) $(USED_LIB_PATHS_G) $(DESTTOOLDEBUG)/.dir
|
||||
@echo ======= Linking $(TOOLNAME) debug executable $(STRIP_WARN_MSG)=======
|
||||
$(VERB) $(LinkG) -o $@ $(ObjectsG) $(LIB_OPTS_G) $(LINK_OPTS)
|
||||
$(VERB) $(LinkG) -o $@ $(LObjectsG) $(LIB_OPTS_G) $(LINK_OPTS) $(LIBS)
|
||||
|
||||
$(TOOLEXENAME_O): $(ObjectsO) $(USED_LIB_PATHS_O) $(DESTTOOLRELEASE)/.dir
|
||||
$(TOOLEXENAME_O): $(LObjectsO) $(USED_LIB_PATHS_O) $(DESTTOOLRELEASE)/.dir
|
||||
@echo ======= Linking $(TOOLNAME) release executable =======
|
||||
$(VERB) $(LinkO) -o $@ $(ObjectsO) $(LIB_OPTS_O) $(LINK_OPTS)
|
||||
$(VERB) $(LinkO) -o $@ $(LObjectsO) $(LIB_OPTS_O) $(LINK_OPTS) $(LIBS)
|
||||
|
||||
$(TOOLEXENAME_P): $(ObjectsP) $(USED_LIB_PATHS_P) $(DESTTOOLPROFILE)/.dir
|
||||
$(TOOLEXENAME_P): $(LObjectsP) $(USED_LIB_PATHS_P) $(DESTTOOLPROFILE)/.dir
|
||||
@echo ======= Linking $(TOOLNAME) profile executable =======
|
||||
$(VERB) $(LinkP) -o $@ $(ObjectsP) $(LIB_OPTS_P) $(LINK_OPTS)
|
||||
$(VERB) $(LinkP) -o $@ $(LObjectsP) $(LIB_OPTS_P) $(LINK_OPTS) $(LIBS)
|
||||
|
||||
endif
|
||||
|
||||
@ -525,26 +638,74 @@ endif
|
||||
.PRECIOUS: $(BUILD_OBJ_DIR)/Debug/.dir $(BUILD_OBJ_DIR)/Release/.dir
|
||||
|
||||
# Create .o files in the ObjectFiles directory from the .cpp and .c files...
|
||||
$(BUILD_OBJ_DIR)/Release/%.o: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Release/.dir
|
||||
#$(BUILD_OBJ_DIR)/Release/%.o: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Release/.dir
|
||||
#@echo "Compiling $<"
|
||||
#$(VERB) $(CompileO) $< -o $@
|
||||
|
||||
#$(BUILD_OBJ_DIR)/Release/%.o: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Release/.dir
|
||||
#$(VERB) $(CompileCO) $< -o $@
|
||||
|
||||
#$(BUILD_OBJ_DIR)/Profile/%.o: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Profile/.dir
|
||||
#@echo "Compiling $<"
|
||||
#$(VERB) $(CompileP) $< -o $@
|
||||
|
||||
#$(BUILD_OBJ_DIR)/Profile/%.o: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Profile/.dir
|
||||
#@echo "Compiling $<"
|
||||
#$(VERB) $(CompileCP) $< -o $@
|
||||
|
||||
#$(BUILD_OBJ_DIR)/Debug/%.o: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Debug/.dir
|
||||
#@echo "Compiling $<"
|
||||
#$(VERB) $(CompileG) $< -o $@
|
||||
|
||||
#$(BUILD_OBJ_DIR)/Debug/%.o: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Debug/.dir
|
||||
#$(VERB) $(CompileCG) $< -o $@
|
||||
|
||||
# Create .lo files in the ObjectFiles directory from the .cpp and .c files...
|
||||
$(BUILD_OBJ_DIR)/Release/%.lo: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Release/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileO) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Release/%.o: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Release/.dir
|
||||
$(BUILD_OBJ_DIR)/Release/%.lo: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Release/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileCO) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Profile/%.o: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Profile/.dir
|
||||
$(BUILD_OBJ_DIR)/Profile/%.lo: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Profile/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileP) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Profile/%.o: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Profile/.dir
|
||||
$(BUILD_OBJ_DIR)/Profile/%.lo: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Profile/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileCP) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Debug/%.o: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Debug/.dir
|
||||
$(BUILD_OBJ_DIR)/Debug/%.lo: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Debug/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileG) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Debug/%.o: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Debug/.dir
|
||||
$(BUILD_OBJ_DIR)/Debug/%.lo: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Debug/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileCG) $< -o $@
|
||||
|
||||
# Create .lo files in the ObjectFiles directory from the .cpp and .c files...
|
||||
$(BUILD_OBJ_DIR)/Release/%.lo: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Release/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileO) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Release/%.lo: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Release/.dir
|
||||
$(VERB) $(CompileCO) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Profile/%.lo: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Profile/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileP) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Profile/%.lo: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Profile/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileCP) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Debug/%.lo: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Debug/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileG) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Debug/%.lo: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Debug/.dir
|
||||
$(VERB) $(CompileCG) $< -o $@
|
||||
|
||||
#
|
||||
@ -565,10 +726,10 @@ YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output)
|
||||
# FIXME. (f.e. char Buffer[10000]; )
|
||||
#
|
||||
%.cpp: %.l
|
||||
$(FLEX) -t $< | sed '/^find_rule/d' | \
|
||||
sed 's/void yyunput/inline void yyunput/' | \
|
||||
sed 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
|
||||
sed 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' > $@
|
||||
$(FLEX) -t $< | $(SED) '/^find_rule/d' | \
|
||||
$(SED) 's/void yyunput/inline void yyunput/' | \
|
||||
$(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
|
||||
$(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' > $@
|
||||
|
||||
# Rule for building the bison parsers...
|
||||
%.c: %.y # Cancel built-in rules for yacc
|
||||
@ -576,23 +737,40 @@ YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output)
|
||||
%.cpp %.h : %.y
|
||||
@echo Bison\'ing $<...
|
||||
$(VERB) $(BISON) -v -d -p $(<:%Parser.y=%) $*.y
|
||||
$(VERB) mv -f $*.tab.c $*.cpp
|
||||
$(VERB) mv -f $*.tab.h $*.h
|
||||
$(VERB) ${MV} -f $*.tab.c $*.cpp
|
||||
$(VERB) ${MV} -f $*.tab.h $*.h
|
||||
|
||||
# To create the directories...
|
||||
%/.dir:
|
||||
$(VERB) mkdir -p $*
|
||||
@date > $@
|
||||
$(VERB) ${MKDIR} $* > /dev/null
|
||||
@$(DATE) > $@
|
||||
|
||||
# To create postscript files from dot files...
|
||||
ifdef DOT
|
||||
%.ps: %.dot
|
||||
dot -Tps < $< > $@
|
||||
${DOT} -Tps < $< > $@
|
||||
else
|
||||
%.ps: %.dot
|
||||
${ECHO} "Cannot build $@: The program dot is not installed"
|
||||
endif
|
||||
|
||||
# 'make clean' nukes the tree
|
||||
clean::
|
||||
$(VERB) rm -rf $(BUILD_OBJ_DIR)/Debug $(BUILD_OBJ_DIR)/Release $(BUILD_OBJ_DIR)/Profile $(BUILD_OBJ_DIR)/Depend
|
||||
$(VERB) rm -f core core.[0-9][0-9]* *.o *.d *.so *~ *.flc
|
||||
$(VERB) rm -f $(LEX_OUTPUT) $(YACC_OUTPUT)
|
||||
$(VERB) $(RM) -rf $(BUILD_OBJ_DIR)/Debug $(BUILD_OBJ_DIR)/Release $(BUILD_OBJ_DIR)/Profile $(BUILD_OBJ_DIR)/Depend
|
||||
$(VERB) $(RM) -f core core.[0-9][0-9]* *.o *.d *.so *~ *.flc
|
||||
$(VERB) $(RM) -f $(LEX_OUTPUT) $(YACC_OUTPUT)
|
||||
|
||||
distclean:: clean
|
||||
$(VERB) (cd $(LLVM_SRC_ROOT); $(RM) -rf $(LEVEL)/Makefile.config \
|
||||
$(LEVEL)/include/Config/config.h \
|
||||
$(LEVEL)/autom4te.cache \
|
||||
$(LEVEL)/config.log)
|
||||
|
||||
###########################################################################
|
||||
# C/C++ Dependencies
|
||||
# Define variables and rules that generate header file dependencies
|
||||
# from C/C++ source files.
|
||||
###########################################################################
|
||||
|
||||
# If dependencies were generated for the file that included this file,
|
||||
# include the dependancies now...
|
||||
@ -600,16 +778,29 @@ clean::
|
||||
SourceBaseNames := $(basename $(notdir $(filter-out Debug/%, $(Source))))
|
||||
SourceDepend := $(SourceBaseNames:%=$(BUILD_OBJ_DIR)/Depend/%.d)
|
||||
|
||||
#
|
||||
# Depend target:
|
||||
# This allows a user to manually ask for an update in the dependencies
|
||||
#
|
||||
depend: $(SourceDepend)
|
||||
|
||||
|
||||
# Create dependencies for the *.cpp files...
|
||||
#$(SourceDepend): \x
|
||||
$(BUILD_OBJ_DIR)/Depend/%.d: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Depend/.dir
|
||||
$(VERB) $(Depend) $< | sed 's|$*\.o *|$(BUILD_OBJ_DIR)/Release/& $(BUILD_OBJ_DIR)/Profile/& $(BUILD_OBJ_DIR)/Debug/& $(BUILD_OBJ_DIR)/Depend/$(@F)|g' > $@
|
||||
$(VERB) $(Depend) $< | $(SED) 's|\.o|\.lo|' | $(SED) 's|$*\.lo *|$(BUILD_OBJ_DIR)/Release/& $(BUILD_OBJ_DIR)/Profile/& $(BUILD_OBJ_DIR)/Debug/& $(BUILD_OBJ_DIR)/Depend/$(@F)|g' > $@
|
||||
|
||||
# Create dependencies for the *.c files...
|
||||
#$(SourceDepend): \x
|
||||
$(BUILD_OBJ_DIR)/Depend/%.d: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Depend/.dir
|
||||
$(VERB) $(DependC) $< | sed 's|$*\.o *|Release/& Profile/& Debug/& Depend/$(@F)|g' > $@
|
||||
$(VERB) $(DependC) -o $@ $< | $(SED) 's|\.o|\.lo|' | $(SED) 's|$*\.lo *|$(BUILD_OBJ_DIR)/Release/& $(BUILD_OBJ_DIR)/Profile/& $(BUILD_OBJ_DIR)/Debug/& $(BUILD_OBJ_DIR)/Depend/$(@F)|g' > $@
|
||||
|
||||
#
|
||||
# Include dependencies generated from C/C++ source files, but not if we
|
||||
# are cleaning (this example taken from the GNU Make Manual).
|
||||
#
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
ifneq ($(SourceDepend),)
|
||||
-include $(SourceDepend)
|
||||
endif
|
||||
endif
|
||||
|
@ -4,6 +4,11 @@
|
||||
# values specific to a particular installation of LLVM.
|
||||
#===-----------------------------------------------------------------------====
|
||||
|
||||
#
|
||||
# Target operating system for which LLVM will be compiled.
|
||||
#
|
||||
OS=Linux
|
||||
|
||||
# Path to the C++ compiler to use. This is an optional setting, which defaults
|
||||
# to whatever your gmake defaults to.
|
||||
#
|
||||
@ -11,22 +16,30 @@
|
||||
# find the system assembler, which breaks if the LLVM assembler is in our path.
|
||||
# Hack it to use the assembler in /usr/bin directly.
|
||||
#
|
||||
CXX = PATH=/usr/bin /usr/dcs/software/evaluation/bin/g++
|
||||
CXX = /home/vadve/criswell/local/Linux/bin/g++
|
||||
|
||||
# We have the same problem with the CC binary, which use used by testcases for
|
||||
# native builds.
|
||||
#
|
||||
CC := PATH=/usr/bin /usr/dcs/software/evaluation/bin/gcc
|
||||
CC := /home/vadve/criswell/local/Linux/bin/gcc
|
||||
|
||||
#
|
||||
# Path to the linker.
|
||||
# Compilation flags for the C and C++ compilers.
|
||||
#
|
||||
LD = ld
|
||||
CPPFLAGS=-DHAVE_CONFIG_H
|
||||
CCFLAGS=-DHAVE_CONFIG_H
|
||||
LDFLAGS=
|
||||
LIBS=-ldl
|
||||
|
||||
#
|
||||
# Libraries needed by tools
|
||||
#
|
||||
TOOLLINKOPTS=-ldl
|
||||
|
||||
#
|
||||
# Path to the archiver program.
|
||||
#
|
||||
AR_PATH = ar
|
||||
AR_PATH = /usr/bin/ar
|
||||
|
||||
#
|
||||
# The pathnames of the Flex and Bison programs, respectively.
|
||||
@ -35,17 +48,34 @@ BISON = bison
|
||||
FLEX = flex
|
||||
|
||||
#
|
||||
# Path OBJ_ROOT to the directory where object files should be stored during a
|
||||
# build. Set to "." if you do not want to use a separate place for object
|
||||
# files.
|
||||
# Paths to miscellaneous programs.
|
||||
#
|
||||
SED = /bin/sed
|
||||
RM = /bin/rm
|
||||
ECHO = /bin/echo
|
||||
MKDIR = /home/vadve/criswell/box/mainline/llvm/mkinstalldirs
|
||||
DATE = /bin/date
|
||||
MV = /bin/mv
|
||||
INSTALL = /usr/dcs/software/supported/bin/ginstall -c
|
||||
DOT = /home/vadve/lattner/local/x86/bin/dot
|
||||
ETAGS = /usr/dcs/software/supported/bin/etags
|
||||
|
||||
#
|
||||
# Determine the target for which LLVM should generate code.
|
||||
#
|
||||
LLVMGCCARCH := i686-pc-linux-gnu/3.4-llvm
|
||||
|
||||
# Path to directory where object files should be stored during a build.
|
||||
# Set OBJ_ROOT to "." if you do not want to use a separate place for
|
||||
# object files.
|
||||
#
|
||||
#OBJ_ROOT = .
|
||||
OBJ_ROOT := /localhome/$(USER)
|
||||
OBJ_ROOT := /localhome/criswell
|
||||
|
||||
# Path to location for LLVM front-end this should only be specified here if you
|
||||
# want to override the value set in Makefile.$(uname)
|
||||
#
|
||||
#LLVMGCCDIR := /home/vadve/lattner/local/x86/llvm-gcc/
|
||||
LLVMGCCDIR := /home/vadve/lattner/local/x86/llvm-gcc/
|
||||
|
||||
# When this setting is set to true, programs in the llvm/test/Programs hierarchy
|
||||
# are not recompiled from source code. Instead, the bytecode for the file is
|
||||
@ -55,6 +85,7 @@ OBJ_ROOT := /localhome/$(USER)
|
||||
#
|
||||
#USE_PRECOMPILED_BYTECODE := 1
|
||||
|
||||
|
||||
# This path specifies the cannonical location of bytecode files for compiled
|
||||
# versions of the test/Programs/* programs. This is used as the bytecode source
|
||||
# when USE_PRECOMPILED_BYTECODE is specified or when source code is not
|
||||
@ -65,24 +96,26 @@ BYTECODE_REPOSITORY := /home/vadve/lattner/LLVMPrograms
|
||||
# Path to location for purify, this is only needed if you build with
|
||||
# ENABLE_PURIFY=1
|
||||
#
|
||||
PURIFY = /usr/dcs/applications/purify/bin/purify
|
||||
PURIFY =
|
||||
|
||||
#
|
||||
# SPEC benchmarks:
|
||||
# Set this variable to enable the use of the SPEC benchmarks. You must
|
||||
# provide the SPEC benchmarks on your own.
|
||||
# Set the USE_SPEC variable to enable the use of the SPEC benchmarks.
|
||||
# You must provide the SPEC benchmarks on your own.
|
||||
#
|
||||
USE_SPEC := 1
|
||||
|
||||
|
||||
#
|
||||
# Path to the SPEC benchmarks. If you have the SPEC benchmarks, place the
|
||||
# path here.
|
||||
#
|
||||
#SPEC_ROOT := /home/vadve/shared/benchmarks/speccpu2000/benchspec
|
||||
SPEC_ROOT := /home/vadve/shared/benchmarks/speccpu2000/benchspec
|
||||
|
||||
#
|
||||
# Path to the PAPI code. This is used by the reoptimizer only.
|
||||
#
|
||||
#PAPIDIR := /home/vadve/shared/papi-2.3.4.1
|
||||
PAPIDIR := /home/vadve/shared/papi-2.3.4.1
|
||||
|
||||
# These are options that can either be enabled here, or can be enabled on the
|
||||
@ -94,19 +127,33 @@ PAPIDIR := /home/vadve/shared/papi-2.3.4.1
|
||||
#
|
||||
#ENABLE_OPTIMIZED = 1
|
||||
|
||||
|
||||
# When ENABLE_PROFILING is enabled, the llvm source base is built with profile
|
||||
# information to allow gprof to be used to get execution frequencies.
|
||||
#
|
||||
#ENABLE_PROFILING = 1
|
||||
|
||||
|
||||
#
|
||||
# This open tells the Makefiles to produce verbose output.
|
||||
# It essentially prints the commands that make is executing
|
||||
#
|
||||
#VERBOSE = 1
|
||||
|
||||
# When ENABLE_PURIFY is enabled, the LLVM tools are linked with purify (which
|
||||
|
||||
# When ENABLE_PURIFY is set to 1, the LLVM tools are linked with purify (which
|
||||
# must be locally installed) to allow for some automated memory error debugging.
|
||||
#
|
||||
#ENABLE_PURIFY = 1
|
||||
#ENABLE_PURIFY = 1
|
||||
|
||||
|
||||
#
|
||||
# Enable JIT for this platform
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# Disable LLC diffs for testing.
|
||||
#
|
||||
DISABLE_LLC_DIFFS:=1
|
||||
|
||||
|
159
llvm/Makefile.config.in
Normal file
159
llvm/Makefile.config.in
Normal file
@ -0,0 +1,159 @@
|
||||
#===-- Makefile.config - Local configuration for LLVM ------*- makefile -*--====
|
||||
#
|
||||
# This file is included by Makefile.common. It defines paths and other
|
||||
# values specific to a particular installation of LLVM.
|
||||
#===-----------------------------------------------------------------------====
|
||||
|
||||
#
|
||||
# Target operating system for which LLVM will be compiled.
|
||||
#
|
||||
OS=@OS@
|
||||
|
||||
# Path to the C++ compiler to use. This is an optional setting, which defaults
|
||||
# to whatever your gmake defaults to.
|
||||
#
|
||||
# Under Linux, for some reason the compiler driver wants to search the PATH to
|
||||
# find the system assembler, which breaks if the LLVM assembler is in our path.
|
||||
# Hack it to use the assembler in /usr/bin directly.
|
||||
#
|
||||
CXX = @CXX@
|
||||
|
||||
# We have the same problem with the CC binary, which use used by testcases for
|
||||
# native builds.
|
||||
#
|
||||
CC := @CC@
|
||||
|
||||
#
|
||||
# Compilation flags for the C and C++ compilers.
|
||||
#
|
||||
CPPFLAGS=@DEFS@
|
||||
CCFLAGS=@DEFS@
|
||||
LDFLAGS=@LDFLAGS@
|
||||
LIBS=@LIBS@
|
||||
|
||||
#
|
||||
# Libraries needed by tools
|
||||
#
|
||||
TOOLLINKOPTS=@LIBS@
|
||||
|
||||
#
|
||||
# Path to the archiver program.
|
||||
#
|
||||
AR_PATH = @AR@
|
||||
|
||||
#
|
||||
# The pathnames of the Flex and Bison programs, respectively.
|
||||
#
|
||||
BISON = @YACC@
|
||||
FLEX = @LEX@
|
||||
|
||||
#
|
||||
# Paths to miscellaneous programs.
|
||||
#
|
||||
SED = @SED@
|
||||
RM = @RM@
|
||||
ECHO = @ECHO@
|
||||
MKDIR = @abs_top_srcdir@/mkinstalldirs
|
||||
DATE = @DATE@
|
||||
MV = @MV@
|
||||
INSTALL = @INSTALL@
|
||||
DOT = @DOT@
|
||||
ETAGS = @ETAGS@
|
||||
|
||||
#
|
||||
# Determine the target for which LLVM should generate code.
|
||||
#
|
||||
LLVMGCCARCH := @target@/3.4-llvm
|
||||
|
||||
# Path to directory where object files should be stored during a build.
|
||||
# Set OBJ_ROOT to "." if you do not want to use a separate place for
|
||||
# object files.
|
||||
#
|
||||
#OBJ_ROOT = .
|
||||
OBJ_ROOT := @OBJROOT@
|
||||
|
||||
# Path to location for LLVM front-end this should only be specified here if you
|
||||
# want to override the value set in Makefile.$(uname)
|
||||
#
|
||||
LLVMGCCDIR := @LLVMGCCDIR@
|
||||
|
||||
# When this setting is set to true, programs in the llvm/test/Programs hierarchy
|
||||
# are not recompiled from source code. Instead, the bytecode for the file is
|
||||
# pulled from the BYTECODE_REPOSITORY directory. This can be useful when disk
|
||||
# space is limited or when you just don't want to spend time running the C
|
||||
# frontend.
|
||||
#
|
||||
#USE_PRECOMPILED_BYTECODE := 1
|
||||
@UPB@
|
||||
|
||||
# This path specifies the cannonical location of bytecode files for compiled
|
||||
# versions of the test/Programs/* programs. This is used as the bytecode source
|
||||
# when USE_PRECOMPILED_BYTECODE is specified or when source code is not
|
||||
# available for the program (such as SPEC).
|
||||
#
|
||||
BYTECODE_REPOSITORY := @BCR@
|
||||
|
||||
# Path to location for purify, this is only needed if you build with
|
||||
# ENABLE_PURIFY=1
|
||||
#
|
||||
PURIFY = @PURIFY@
|
||||
|
||||
#
|
||||
# SPEC benchmarks:
|
||||
# Set the USE_SPEC variable to enable the use of the SPEC benchmarks.
|
||||
# You must provide the SPEC benchmarks on your own.
|
||||
#
|
||||
@USE_SPEC@
|
||||
|
||||
#
|
||||
# Path to the SPEC benchmarks. If you have the SPEC benchmarks, place the
|
||||
# path here.
|
||||
#
|
||||
#SPEC_ROOT := /home/vadve/shared/benchmarks/speccpu2000/benchspec
|
||||
SPEC_ROOT := @SPEC_ROOT@
|
||||
|
||||
#
|
||||
# Path to the PAPI code. This is used by the reoptimizer only.
|
||||
#
|
||||
#PAPIDIR := /home/vadve/shared/papi-2.3.4.1
|
||||
PAPIDIR := @PAPIDIR@
|
||||
|
||||
# These are options that can either be enabled here, or can be enabled on the
|
||||
# make command line (ie, make ENABLE_PROFILING=1)
|
||||
#
|
||||
|
||||
# When ENABLE_OPTIMIZED is enabled, Release builds of all of the LLVM code are
|
||||
# turned on, and Debug builds are turned off.
|
||||
#
|
||||
#ENABLE_OPTIMIZED = 1
|
||||
@ENABLE_OPTIMIZED@
|
||||
|
||||
# When ENABLE_PROFILING is enabled, the llvm source base is built with profile
|
||||
# information to allow gprof to be used to get execution frequencies.
|
||||
#
|
||||
#ENABLE_PROFILING = 1
|
||||
@ENABLE_PROFILING@
|
||||
|
||||
#
|
||||
# This open tells the Makefiles to produce verbose output.
|
||||
# It essentially prints the commands that make is executing
|
||||
#
|
||||
#VERBOSE = 1
|
||||
@ENABLE_VERBOSE@
|
||||
|
||||
# When ENABLE_PURIFY is set to 1, the LLVM tools are linked with purify (which
|
||||
# must be locally installed) to allow for some automated memory error debugging.
|
||||
#
|
||||
#ENABLE_PURIFY = 1
|
||||
@ENABLE_PURIFY@
|
||||
|
||||
#
|
||||
# Enable JIT for this platform
|
||||
#
|
||||
@JIT@
|
||||
|
||||
#
|
||||
# Disable LLC diffs for testing.
|
||||
#
|
||||
@DISABLE_LLC_DIFFS@
|
||||
|
@ -30,14 +30,24 @@
|
||||
# are in, if they are not in the current directory. This should include a
|
||||
# trailing / character.
|
||||
#
|
||||
# 6. PROJ_COMPILE - If set to 1, then this makefile can also be used to
|
||||
# compile other projects using llvm. Note if this option is set then the
|
||||
# following *must* hold
|
||||
# PROJLEVEL should be set to the top of the source directory for the
|
||||
# project files
|
||||
# LEVEL should be set to the top of LLVM source tree
|
||||
# LLVM_LIB_DIR should be set to the top of the LLVM build tree
|
||||
# 6. LLVM_SRC_ROOT - If specified, points to the top of the LLVM source tree.
|
||||
#
|
||||
# 7. LLVM_OBJ_ROOT - If specified, points to the top directory where LLVM
|
||||
# object files are placed.
|
||||
#
|
||||
# 8. BUILD_SRC_DIR - The directory which contains the current set of Makefiles
|
||||
# and usually the source code too (unless SourceDir is set).
|
||||
#
|
||||
# 9. BUILD_SRC_ROOT - The root directory of the source code being compiled.
|
||||
#
|
||||
# 10. BUILD_OBJ_DIR - The directory where object code should be placed.
|
||||
#
|
||||
# 11. BUILD_OBJ_ROOT - The root directory for where object code should be
|
||||
# placed.
|
||||
#
|
||||
# For building,
|
||||
# LLVM, LLVM_SRC_ROOT = BUILD_SRC_ROOT, and
|
||||
# LLVM_OBJ_ROOT = BUILD_OBJ_ROOT.
|
||||
#===-----------------------------------------------------------------------====
|
||||
|
||||
#
|
||||
@ -75,15 +85,21 @@ ifndef BUILD_SRC_ROOT
|
||||
BUILD_SRC_ROOT = $(shell cd $(BUILD_SRC_DIR)/$(LEVEL); pwd)
|
||||
endif
|
||||
|
||||
#
|
||||
# Determine the path of the source tree relative from $HOME (the mythical
|
||||
# home directory).
|
||||
#
|
||||
HOME_OBJ_ROOT := $(OBJ_ROOT)/$(patsubst $(HOME)%,%,$(BUILD_SRC_ROOT))
|
||||
|
||||
#
|
||||
# Set the object build directory. Its location depends upon the source path
|
||||
# and where object files should go.
|
||||
#
|
||||
ifndef BUILD_OBJ_DIR
|
||||
ifeq ($(OBJ_ROOT),.)
|
||||
BUILD_OBJ_DIR = $(shell pwd)
|
||||
BUILD_OBJ_DIR = $(BUILD_SRC_DIR)
|
||||
else
|
||||
BUILD_OBJ_DIR := $(OBJ_ROOT)$(patsubst $(shell dirname $(BUILD_SRC_ROOT))%,%,$(shell cd $(BUILD_SRC_DIR); pwd))
|
||||
BUILD_OBJ_DIR := $(HOME_OBJ_ROOT)$(patsubst $(BUILD_SRC_ROOT)%,%,$(BUILD_SRC_DIR))
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -92,9 +108,9 @@ endif
|
||||
#
|
||||
ifndef BUILD_OBJ_ROOT
|
||||
ifeq ($(OBJ_ROOT),.)
|
||||
BUILD_OBJ_ROOT = $(shell cd $(LEVEL); pwd)
|
||||
BUILD_OBJ_ROOT = $(BUILD_SRC_ROOT)
|
||||
else
|
||||
BUILD_OBJ_ROOT := $(OBJ_ROOT)$(patsubst $(shell dirname $(BUILD_SRC_ROOT))%,%,$(shell cd $(BUILD_SRC_ROOT); pwd))
|
||||
BUILD_OBJ_ROOT := $(HOME_OBJ_ROOT)
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -113,16 +129,15 @@ ifndef LLVM_OBJ_ROOT
|
||||
LLVM_OBJ_ROOT = $(BUILD_OBJ_ROOT)
|
||||
endif
|
||||
|
||||
# Figure out how to do platform specific stuff on this platform. This is really
|
||||
# gross and should be autoconfiscated (automake actually), but should hopefully
|
||||
# work on Linux and solaris (SunOS).
|
||||
#
|
||||
UNAME := $(shell uname)
|
||||
include $(LLVM_SRC_ROOT)/Makefile.$(UNAME)
|
||||
###########################################################################
|
||||
# Default Targets:
|
||||
# The following targets are the standard top level targets for
|
||||
# building.
|
||||
###########################################################################
|
||||
|
||||
ifdef SHARED_LIBRARY
|
||||
# if SHARED_LIBRARY is specified, the default is to build the dynamic lib
|
||||
dynamic ::
|
||||
all:: dynamic
|
||||
endif
|
||||
|
||||
# Default Rule: Make sure it's also a :: rule
|
||||
@ -134,6 +149,22 @@ install ::
|
||||
# Default rule for test. It ensures everything has a test rule
|
||||
test::
|
||||
|
||||
# Print out the directories used for building
|
||||
prdirs::
|
||||
echo "Home Offset : " $(HOME_OBJ_ROOT);
|
||||
echo "Build Source Root: " $(BUILD_SRC_ROOT);
|
||||
echo "Build Source Dir : " $(BUILD_SRC_DIR);
|
||||
echo "Build Object Root: " $(BUILD_OBJ_ROOT);
|
||||
echo "Build Object Dir : " $(BUILD_OBJ_DIR);
|
||||
echo "LLVM Source Root: " $(LLVM_SRC_ROOT);
|
||||
echo "LLVM Object Root: " $(LLVM_OBJ_ROOT);
|
||||
|
||||
###########################################################################
|
||||
# Miscellaneous paths and commands:
|
||||
# This section defines various configuration macros, such as where
|
||||
# to find burg, tblgen, and libtool.
|
||||
###########################################################################
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Variables derived from configuration options...
|
||||
#--------------------------------------------------------------------
|
||||
@ -157,8 +188,21 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# Enable this for profiling support with 'gprof'
|
||||
# This automatically enables optimized builds.
|
||||
#
|
||||
ifdef ENABLE_PROFILING
|
||||
PROFILE = -pg
|
||||
endif
|
||||
|
||||
#
|
||||
# Suffixes for library compilation rules
|
||||
#
|
||||
.SUFFIXES: .so
|
||||
|
||||
###########################################################################
|
||||
# Library Locations
|
||||
# Library Locations:
|
||||
# These variables describe various library locations:
|
||||
#
|
||||
# DEST* = Location of where libraries that are built will be placed.
|
||||
@ -208,36 +252,45 @@ PROJTOOLRELEASE := $(BUILD_OBJ_ROOT)/tools/Release
|
||||
PROJTOOLPROFILE := $(BUILD_OBJ_ROOT)/tools/Profile
|
||||
PROJTOOLCURRENT := $(BUILD_OBJ_ROOT)/tools/$(CONFIGURATION)
|
||||
|
||||
#
|
||||
# Libtool is found in the current directory.
|
||||
#
|
||||
ifdef VERBOSE
|
||||
LIBTOOL=$(LLVM_SRC_ROOT)/libtool
|
||||
else
|
||||
LIBTOOL=$(LLVM_SRC_ROOT)/libtool --silent
|
||||
endif
|
||||
|
||||
#
|
||||
# Verbosity levels
|
||||
#
|
||||
ifndef VERBOSE
|
||||
VERB := @
|
||||
endif
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Compilation options...
|
||||
#---------------------------------------------------------
|
||||
###########################################################################
|
||||
# Miscellaneous paths and commands (part deux):
|
||||
# This section defines various configuration macros, such as where
|
||||
# to find burg, tblgen, and libtool.
|
||||
###########################################################################
|
||||
|
||||
###########################################################################
|
||||
# Special tools used while building the LLVM tree. Burg is built as part of the
|
||||
# utils directory.
|
||||
###########################################################################
|
||||
#--------------------------------------------------------------------------
|
||||
# Special tools used while building the LLVM tree. Burg is built as part
|
||||
# of the utils directory.
|
||||
#--------------------------------------------------------------------------
|
||||
BURG := $(LLVMTOOLCURRENT)/burg
|
||||
RunBurg := $(BURG) $(BURG_OPTS)
|
||||
|
||||
TBLGEN := $(LLVMTOOLCURRENT)/tblgen
|
||||
|
||||
# Enable this for profiling support with 'gprof'
|
||||
# This automatically enables optimized builds.
|
||||
ifdef ENABLE_PROFILING
|
||||
PROFILE = -pg
|
||||
endif
|
||||
|
||||
###########################################################################
|
||||
# Compile Time Flags
|
||||
###########################################################################
|
||||
|
||||
#
|
||||
# Include both the project headers and the LLVM headers for compilation
|
||||
# Include both the project headers and the LLVM headers for compilation and
|
||||
# dependency computation.
|
||||
#
|
||||
CPPFLAGS += -I$(BUILD_SRC_ROOT)/include -I$(LLVM_SRC_ROOT)/include
|
||||
|
||||
@ -254,47 +307,71 @@ CPPFLAGS += -D_GNU_SOURCE
|
||||
CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused -I$(LEVEL)/include
|
||||
CompileOptimizeOpts := -O3 -DNDEBUG -finline-functions -fshort-enums
|
||||
|
||||
#
|
||||
# Compile commands with libtool.
|
||||
#
|
||||
Compile := $(LIBTOOL) --mode=compile $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts)
|
||||
CompileC := $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CCFLAGS) $(CompileCommonOpts)
|
||||
|
||||
#
|
||||
# Add the LLVM specific "-only-static" option so that we only compile .o files
|
||||
# once when not building a shared library.
|
||||
#
|
||||
# For shared libraries, we will end up building twice, but that doesn't happen
|
||||
# very often, so we'll let it go.
|
||||
#
|
||||
ifndef SHARED_LIBRARY
|
||||
Compile := $(Compile) -only-static
|
||||
CompileC := $(CompileC) -only-static
|
||||
endif
|
||||
|
||||
# Compile a cpp file, don't link...
|
||||
Compile := $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts)
|
||||
CompileG := $(Compile) -g -D_DEBUG
|
||||
CompileO := $(Compile) $(CompileOptimizeOpts) -felide-constructors -fomit-frame-pointer
|
||||
CompileP := $(Compile) $(CompileOptimizeOpts) -felide-constructors $(PROFILE)
|
||||
|
||||
# Compile a c file, don't link...
|
||||
CompileC := $(CC) -c $(CPPFLAGS) $(CCFLAGS) $(CompileCommonOpts)
|
||||
CompileCG := $(CompileC) -g -D_DEBUG
|
||||
CompileCO := $(CompileC) $(CompileOptimizeOpts) -fomit-frame-pointer
|
||||
CompileCP := $(CompileC) $(CompileOptimizeOpts) $(PROFILE)
|
||||
|
||||
###########################################################################
|
||||
# Link Time Options
|
||||
###########################################################################
|
||||
|
||||
#
|
||||
# Link final executable
|
||||
|
||||
# (Note that we always link with the C++ compiler).
|
||||
#
|
||||
ifdef ENABLE_PURIFY # To enable purify, build with 'gmake ENABLE_PURIFY=1'
|
||||
Link := $(PURIFY) $(CXX) -static
|
||||
Link := $(PURIFY) $(LIBTOOL) --mode=link $(CXX) -static
|
||||
else
|
||||
Link := $(CXX)
|
||||
Link := $(LIBTOOL) --mode=link $(CXX)
|
||||
endif
|
||||
|
||||
ifdef PROJ_COMPILE
|
||||
# include both projlib source and llvmlib source
|
||||
# link both projlib and llvmlib libraries
|
||||
LinkG := $(Link) -g -L$(PROJLIBDEBUGSOURCE) -L$(LLVMLIBDEBUGSOURCE) $(STRIP)
|
||||
LinkO := $(Link) -O3 -L$(PROJLIBRELEASESOURCE) -L$(LLVMLIBRELEASESOURCE)
|
||||
LinkP := $(Link) -O3 -L$(PROJLIBPROFILESOURCE) -L$(LLVMLIBPROFILESOURCE) $(PROFILE)
|
||||
else
|
||||
LinkG := $(Link) -g -L$(LLVMLIBDEBUGSOURCE) $(STRIP)
|
||||
LinkO := $(Link) -O3 -L$(LLVMLIBRELEASESOURCE)
|
||||
LinkP := $(Link) -O3 -L$(LLVMLIBPROFILESOURCE) $(PROFILE)
|
||||
endif
|
||||
|
||||
|
||||
|
||||
# Create one .o file from a bunch of .o files...
|
||||
Relink = ${LD} -r
|
||||
Relink = ${LIBTOOL} --mode=link $(CXX)
|
||||
|
||||
# MakeSO - Create a .so file from a .o files...
|
||||
MakeSO := $(CXX) $(MakeSharedObjectOption)
|
||||
MakeSOO := $(MakeSO) -O3
|
||||
MakeSOP := $(MakeSOO) $(PROFILE)
|
||||
#MakeSO := $(LIBTOOL) --mode=link $(CXX) $(MakeSharedObjectOption)
|
||||
#MakeSOO := $(MakeSO) -O3
|
||||
#MakeSOP := $(MakeSOO) $(PROFILE)
|
||||
|
||||
#
|
||||
# Configure where the item being compiled should go.
|
||||
#
|
||||
ifdef SHARED_LIBRARY
|
||||
Link := $(Link) -rpath $(DESTLIBCURRENT)
|
||||
endif
|
||||
|
||||
ifdef TOOLNAME
|
||||
Link := $(Link) -rpath $(DESTTOOLCURRENT)
|
||||
endif
|
||||
|
||||
# Create dependancy file from CPP file, send to stdout.
|
||||
Depend := $(CXX) -MM -I$(LEVEL)/include $(CPPFLAGS)
|
||||
@ -313,11 +390,10 @@ ifndef Source
|
||||
Source := $(ExtraSource) $(wildcard *.cpp *.c *.y *.l)
|
||||
endif
|
||||
|
||||
Objs := $(sort $(patsubst Debug/%.o, %.o, $(addsuffix .o,$(notdir $(basename $(Source))))))
|
||||
ObjectsO := $(addprefix $(BUILD_OBJ_DIR)/Release/,$(Objs))
|
||||
ObjectsP := $(addprefix $(BUILD_OBJ_DIR)/Profile/,$(Objs))
|
||||
ObjectsG := $(addprefix $(BUILD_OBJ_DIR)/Debug/,$(Objs))
|
||||
|
||||
LObjs := $(sort $(patsubst Debug/%.lo, %.lo, $(addsuffix .lo,$(notdir $(basename $(Source))))))
|
||||
LObjectsO := $(addprefix $(BUILD_OBJ_DIR)/Release/,$(LObjs))
|
||||
LObjectsP := $(addprefix $(BUILD_OBJ_DIR)/Profile/,$(LObjs))
|
||||
LObjectsG := $(addprefix $(BUILD_OBJ_DIR)/Debug/,$(LObjs))
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Handle the DIRS and PARALLEL_DIRS options
|
||||
@ -341,6 +417,7 @@ test :: $(addsuffix /.maketest , $(PARALLEL_DIRS))
|
||||
$(VERB) cd $(@D); $(MAKE) $(subst $(@D)/.make,,$@)
|
||||
endif
|
||||
|
||||
# Handle directories that may or may not exist
|
||||
ifdef OPTIONAL_DIRS
|
||||
all install clean test ::
|
||||
$(VERB) for dir in ${OPTIONAL_DIRS}; do \
|
||||
@ -351,6 +428,9 @@ all install clean test ::
|
||||
done
|
||||
endif
|
||||
|
||||
###########################################################################
|
||||
# Library Build Rules:
|
||||
#
|
||||
#---------------------------------------------------------
|
||||
# Handle the LIBRARYNAME option - used when building libs...
|
||||
#---------------------------------------------------------
|
||||
@ -367,6 +447,7 @@ endif
|
||||
# it's built as a .o file, then all of the constituent .o files in it will be
|
||||
# linked into tools (for example gccas) even if they only use one of the parts
|
||||
# of it. For this reason, sometimes it's useful to use libraries as .a files.
|
||||
###########################################################################
|
||||
|
||||
ifdef LIBRARYNAME
|
||||
|
||||
@ -383,6 +464,11 @@ LIBNAME_OBJO := $(DESTLIBRELEASE)/$(LIBRARYNAME).o
|
||||
LIBNAME_OBJP := $(DESTLIBPROFILE)/$(LIBRARYNAME).o
|
||||
LIBNAME_OBJG := $(DESTLIBDEBUG)/$(LIBRARYNAME).o
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Library Targets
|
||||
# Modify the top level targets to build the desired libraries.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
# dynamic target builds a shared object version of the library...
|
||||
dynamic:: $(DESTLIBCURRENT)/lib$(LIBRARYNAME).so
|
||||
|
||||
@ -396,44 +482,60 @@ ifdef BUILD_ARCHIVE
|
||||
all:: $(DESTLIBCURRENT)/lib$(LIBRARYNAME).a
|
||||
endif
|
||||
|
||||
$(LIBNAME_O): $(ObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) release library =======
|
||||
$(VERB) $(MakeSOO) -o $@ $(ObjectsO) $(LibSubDirs) $(LibLinkOpts)
|
||||
#--------------------------------------------------------------------
|
||||
# Rules for building libraries
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
$(LIBNAME_P): $(ObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) profile library =======
|
||||
$(VERB) $(MakeSOP) -o $@ $(ObjectsP) $(LibSubDirs) $(LibLinkOpts)
|
||||
#
|
||||
# Rules for building dynamically linked libraries.
|
||||
#
|
||||
$(LIBNAME_O): $(LObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) dynamic release library =======
|
||||
$(VERB) $(Link) -o $*.la $(LObjectsO) $(LibSubDirs) $(LibLinkOpts);
|
||||
$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $*.la $(DESTLIBCURRENT);
|
||||
|
||||
$(LIBNAME_G): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) debug library =======
|
||||
$(VERB) $(MakeSO) -g -o $@ $(ObjectsG) $(LibSubDirs) $(LibLinkOpts)
|
||||
$(LIBNAME_P): $(LObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) dynamic profile library =======
|
||||
$(VERB) $(Link) -o $*.la $(LObjectsP) $(LibSubDirs) $(LibLinkOpts);
|
||||
$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $*.la $(DESTLIBCURRENT);
|
||||
|
||||
$(LIBNAME_AO): $(ObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) release library =======
|
||||
@rm -f $@
|
||||
$(VERB) $(AR) $@ $(ObjectsO) $(LibSubDirs)
|
||||
$(LIBNAME_G): $(LObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) dynamic debug library =======
|
||||
$(VERB) $(Link) -o $*.la $(LObjectsG) $(LibSubDirs) $(LibLinkOpts);
|
||||
$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $*.la $(DESTLIBCURRENT);
|
||||
|
||||
$(LIBNAME_AP): $(ObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) profile library =======
|
||||
@rm -f $@
|
||||
$(VERB) $(AR) $@ $(ObjectsP) $(LibSubDirs)
|
||||
#
|
||||
# Rules for building static archive libraries.
|
||||
#
|
||||
$(LIBNAME_AO): $(LObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) archive release library =======
|
||||
@$(RM) -f $@
|
||||
$(VERB) $(Link) -03 -o $@ $(LObjectsO) $(LibSubDirs) -static
|
||||
|
||||
$(LIBNAME_AG): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) debug library =======
|
||||
@rm -f $@
|
||||
$(VERB) $(AR) $@ $(ObjectsG) $(LibSubDirs)
|
||||
$(LIBNAME_AP): $(LObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) archive profile library =======
|
||||
@$(RM) -f $@
|
||||
$(VERB) $(Link) -03 $(PROFILE) -o $@ $(LObjectsP) $(LibSubDirs) -static
|
||||
|
||||
$(LIBNAME_OBJO): $(ObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
|
||||
$(LIBNAME_AG): $(LObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
|
||||
@echo ======= Linking $(LIBRARYNAME) archive debug library =======
|
||||
@$(RM) -f $@
|
||||
$(VERB) $(Link) -g $(STRIP) -o $@ $(LObjectsG) $(LibSubDirs) -static
|
||||
|
||||
#
|
||||
# Rules for building .o libraries.
|
||||
#
|
||||
$(LIBNAME_OBJO): $(LObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
|
||||
@echo "Linking $@"
|
||||
$(VERB) $(Relink) -o $@ $(ObjectsO) $(LibSubDirs)
|
||||
$(VERB) $(Relink) -o $@ $(LObjectsO) $(LibSubDirs)
|
||||
|
||||
$(LIBNAME_OBJP): $(ObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
|
||||
$(LIBNAME_OBJP): $(LObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
|
||||
@echo "Linking $@"
|
||||
$(VERB) $(Relink) -o $@ $(ObjectsP) $(LibSubDirs)
|
||||
$(VERB) $(Relink) -o $@ $(LObjectsP) $(LibSubDirs)
|
||||
|
||||
$(LIBNAME_OBJG): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
|
||||
$(LIBNAME_OBJG): $(LObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
|
||||
@echo "Linking $@"
|
||||
$(VERB) $(Relink) -o $@ $(ObjectsG) $(LibSubDirs)
|
||||
$(VERB) $(Relink) -o $@ $(LObjectsG) $(LibSubDirs)
|
||||
|
||||
endif
|
||||
|
||||
@ -441,11 +543,16 @@ endif
|
||||
# Create a TAGS database for emacs
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
ifdef ETAGS
|
||||
ifeq ($(LEVEL), .)
|
||||
tags:
|
||||
etags -l c++ `find include lib tools -name '*.cpp' -o -name '*.h'`
|
||||
$(ETAGS) -l c++ `find include lib tools -name '*.cpp' -o -name '*.h'`
|
||||
all:: tags
|
||||
endif
|
||||
else
|
||||
tags:
|
||||
${ECHO} "Cannot build $@: The program etags is not installed"
|
||||
endif
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Handle the TOOLNAME option - used when building tool executables...
|
||||
@ -487,8 +594,14 @@ STATICUSEDLIBS := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
|
||||
USED_LIB_PATHS_G := $(addprefix $(DESTLIBDEBUG)/, $(STATICUSEDLIBS))
|
||||
USED_LIB_PATHS_O := $(addprefix $(DESTLIBRELEASE)/, $(STATICUSEDLIBS))
|
||||
USED_LIB_PATHS_P := $(addprefix $(DESTLIBPROFILE)/, $(STATICUSEDLIBS))
|
||||
LINK_OPTS := $(TOOLLINKOPTS) $(PLATFORMLINKOPTS)
|
||||
#LINK_OPTS := $(TOOLLINKOPTS) $(PLATFORMLINKOPTS)
|
||||
|
||||
#
|
||||
# Libtool link options:
|
||||
# Ensure that all binaries have their symbols exported so that they can
|
||||
# by dlsym'ed.
|
||||
#
|
||||
LINK_OPTS := -export-dynamic $(TOOLLINKOPTS)
|
||||
|
||||
|
||||
|
||||
@ -502,19 +615,19 @@ $(USED_LIB_PATHS_G) $(USED_LIB_PATHS_O) $(USED_LIB_PATHS_P): \
|
||||
all:: $(TOOLEXENAMES)
|
||||
|
||||
clean::
|
||||
$(VERB) rm -f $(TOOLEXENAMES)
|
||||
$(VERB) $(RM) -f $(TOOLEXENAMES)
|
||||
|
||||
$(TOOLEXENAME_G): $(ObjectsG) $(USED_LIB_PATHS_G) $(DESTTOOLDEBUG)/.dir
|
||||
$(TOOLEXENAME_G): $(LObjectsG) $(USED_LIB_PATHS_G) $(DESTTOOLDEBUG)/.dir
|
||||
@echo ======= Linking $(TOOLNAME) debug executable $(STRIP_WARN_MSG)=======
|
||||
$(VERB) $(LinkG) -o $@ $(ObjectsG) $(LIB_OPTS_G) $(LINK_OPTS)
|
||||
$(VERB) $(LinkG) -o $@ $(LObjectsG) $(LIB_OPTS_G) $(LINK_OPTS) $(LIBS)
|
||||
|
||||
$(TOOLEXENAME_O): $(ObjectsO) $(USED_LIB_PATHS_O) $(DESTTOOLRELEASE)/.dir
|
||||
$(TOOLEXENAME_O): $(LObjectsO) $(USED_LIB_PATHS_O) $(DESTTOOLRELEASE)/.dir
|
||||
@echo ======= Linking $(TOOLNAME) release executable =======
|
||||
$(VERB) $(LinkO) -o $@ $(ObjectsO) $(LIB_OPTS_O) $(LINK_OPTS)
|
||||
$(VERB) $(LinkO) -o $@ $(LObjectsO) $(LIB_OPTS_O) $(LINK_OPTS) $(LIBS)
|
||||
|
||||
$(TOOLEXENAME_P): $(ObjectsP) $(USED_LIB_PATHS_P) $(DESTTOOLPROFILE)/.dir
|
||||
$(TOOLEXENAME_P): $(LObjectsP) $(USED_LIB_PATHS_P) $(DESTTOOLPROFILE)/.dir
|
||||
@echo ======= Linking $(TOOLNAME) profile executable =======
|
||||
$(VERB) $(LinkP) -o $@ $(ObjectsP) $(LIB_OPTS_P) $(LINK_OPTS)
|
||||
$(VERB) $(LinkP) -o $@ $(LObjectsP) $(LIB_OPTS_P) $(LINK_OPTS) $(LIBS)
|
||||
|
||||
endif
|
||||
|
||||
@ -525,26 +638,74 @@ endif
|
||||
.PRECIOUS: $(BUILD_OBJ_DIR)/Debug/.dir $(BUILD_OBJ_DIR)/Release/.dir
|
||||
|
||||
# Create .o files in the ObjectFiles directory from the .cpp and .c files...
|
||||
$(BUILD_OBJ_DIR)/Release/%.o: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Release/.dir
|
||||
#$(BUILD_OBJ_DIR)/Release/%.o: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Release/.dir
|
||||
#@echo "Compiling $<"
|
||||
#$(VERB) $(CompileO) $< -o $@
|
||||
|
||||
#$(BUILD_OBJ_DIR)/Release/%.o: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Release/.dir
|
||||
#$(VERB) $(CompileCO) $< -o $@
|
||||
|
||||
#$(BUILD_OBJ_DIR)/Profile/%.o: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Profile/.dir
|
||||
#@echo "Compiling $<"
|
||||
#$(VERB) $(CompileP) $< -o $@
|
||||
|
||||
#$(BUILD_OBJ_DIR)/Profile/%.o: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Profile/.dir
|
||||
#@echo "Compiling $<"
|
||||
#$(VERB) $(CompileCP) $< -o $@
|
||||
|
||||
#$(BUILD_OBJ_DIR)/Debug/%.o: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Debug/.dir
|
||||
#@echo "Compiling $<"
|
||||
#$(VERB) $(CompileG) $< -o $@
|
||||
|
||||
#$(BUILD_OBJ_DIR)/Debug/%.o: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Debug/.dir
|
||||
#$(VERB) $(CompileCG) $< -o $@
|
||||
|
||||
# Create .lo files in the ObjectFiles directory from the .cpp and .c files...
|
||||
$(BUILD_OBJ_DIR)/Release/%.lo: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Release/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileO) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Release/%.o: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Release/.dir
|
||||
$(BUILD_OBJ_DIR)/Release/%.lo: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Release/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileCO) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Profile/%.o: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Profile/.dir
|
||||
$(BUILD_OBJ_DIR)/Profile/%.lo: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Profile/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileP) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Profile/%.o: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Profile/.dir
|
||||
$(BUILD_OBJ_DIR)/Profile/%.lo: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Profile/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileCP) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Debug/%.o: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Debug/.dir
|
||||
$(BUILD_OBJ_DIR)/Debug/%.lo: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Debug/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileG) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Debug/%.o: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Debug/.dir
|
||||
$(BUILD_OBJ_DIR)/Debug/%.lo: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Debug/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileCG) $< -o $@
|
||||
|
||||
# Create .lo files in the ObjectFiles directory from the .cpp and .c files...
|
||||
$(BUILD_OBJ_DIR)/Release/%.lo: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Release/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileO) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Release/%.lo: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Release/.dir
|
||||
$(VERB) $(CompileCO) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Profile/%.lo: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Profile/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileP) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Profile/%.lo: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Profile/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileCP) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Debug/%.lo: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Debug/.dir
|
||||
@echo "Compiling $<"
|
||||
$(VERB) $(CompileG) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Debug/%.lo: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Debug/.dir
|
||||
$(VERB) $(CompileCG) $< -o $@
|
||||
|
||||
#
|
||||
@ -565,10 +726,10 @@ YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output)
|
||||
# FIXME. (f.e. char Buffer[10000]; )
|
||||
#
|
||||
%.cpp: %.l
|
||||
$(FLEX) -t $< | sed '/^find_rule/d' | \
|
||||
sed 's/void yyunput/inline void yyunput/' | \
|
||||
sed 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
|
||||
sed 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' > $@
|
||||
$(FLEX) -t $< | $(SED) '/^find_rule/d' | \
|
||||
$(SED) 's/void yyunput/inline void yyunput/' | \
|
||||
$(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
|
||||
$(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' > $@
|
||||
|
||||
# Rule for building the bison parsers...
|
||||
%.c: %.y # Cancel built-in rules for yacc
|
||||
@ -576,23 +737,40 @@ YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output)
|
||||
%.cpp %.h : %.y
|
||||
@echo Bison\'ing $<...
|
||||
$(VERB) $(BISON) -v -d -p $(<:%Parser.y=%) $*.y
|
||||
$(VERB) mv -f $*.tab.c $*.cpp
|
||||
$(VERB) mv -f $*.tab.h $*.h
|
||||
$(VERB) ${MV} -f $*.tab.c $*.cpp
|
||||
$(VERB) ${MV} -f $*.tab.h $*.h
|
||||
|
||||
# To create the directories...
|
||||
%/.dir:
|
||||
$(VERB) mkdir -p $*
|
||||
@date > $@
|
||||
$(VERB) ${MKDIR} $* > /dev/null
|
||||
@$(DATE) > $@
|
||||
|
||||
# To create postscript files from dot files...
|
||||
ifdef DOT
|
||||
%.ps: %.dot
|
||||
dot -Tps < $< > $@
|
||||
${DOT} -Tps < $< > $@
|
||||
else
|
||||
%.ps: %.dot
|
||||
${ECHO} "Cannot build $@: The program dot is not installed"
|
||||
endif
|
||||
|
||||
# 'make clean' nukes the tree
|
||||
clean::
|
||||
$(VERB) rm -rf $(BUILD_OBJ_DIR)/Debug $(BUILD_OBJ_DIR)/Release $(BUILD_OBJ_DIR)/Profile $(BUILD_OBJ_DIR)/Depend
|
||||
$(VERB) rm -f core core.[0-9][0-9]* *.o *.d *.so *~ *.flc
|
||||
$(VERB) rm -f $(LEX_OUTPUT) $(YACC_OUTPUT)
|
||||
$(VERB) $(RM) -rf $(BUILD_OBJ_DIR)/Debug $(BUILD_OBJ_DIR)/Release $(BUILD_OBJ_DIR)/Profile $(BUILD_OBJ_DIR)/Depend
|
||||
$(VERB) $(RM) -f core core.[0-9][0-9]* *.o *.d *.so *~ *.flc
|
||||
$(VERB) $(RM) -f $(LEX_OUTPUT) $(YACC_OUTPUT)
|
||||
|
||||
distclean:: clean
|
||||
$(VERB) (cd $(LLVM_SRC_ROOT); $(RM) -rf $(LEVEL)/Makefile.config \
|
||||
$(LEVEL)/include/Config/config.h \
|
||||
$(LEVEL)/autom4te.cache \
|
||||
$(LEVEL)/config.log)
|
||||
|
||||
###########################################################################
|
||||
# C/C++ Dependencies
|
||||
# Define variables and rules that generate header file dependencies
|
||||
# from C/C++ source files.
|
||||
###########################################################################
|
||||
|
||||
# If dependencies were generated for the file that included this file,
|
||||
# include the dependancies now...
|
||||
@ -600,16 +778,29 @@ clean::
|
||||
SourceBaseNames := $(basename $(notdir $(filter-out Debug/%, $(Source))))
|
||||
SourceDepend := $(SourceBaseNames:%=$(BUILD_OBJ_DIR)/Depend/%.d)
|
||||
|
||||
#
|
||||
# Depend target:
|
||||
# This allows a user to manually ask for an update in the dependencies
|
||||
#
|
||||
depend: $(SourceDepend)
|
||||
|
||||
|
||||
# Create dependencies for the *.cpp files...
|
||||
#$(SourceDepend): \x
|
||||
$(BUILD_OBJ_DIR)/Depend/%.d: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Depend/.dir
|
||||
$(VERB) $(Depend) $< | sed 's|$*\.o *|$(BUILD_OBJ_DIR)/Release/& $(BUILD_OBJ_DIR)/Profile/& $(BUILD_OBJ_DIR)/Debug/& $(BUILD_OBJ_DIR)/Depend/$(@F)|g' > $@
|
||||
$(VERB) $(Depend) $< | $(SED) 's|\.o|\.lo|' | $(SED) 's|$*\.lo *|$(BUILD_OBJ_DIR)/Release/& $(BUILD_OBJ_DIR)/Profile/& $(BUILD_OBJ_DIR)/Debug/& $(BUILD_OBJ_DIR)/Depend/$(@F)|g' > $@
|
||||
|
||||
# Create dependencies for the *.c files...
|
||||
#$(SourceDepend): \x
|
||||
$(BUILD_OBJ_DIR)/Depend/%.d: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Depend/.dir
|
||||
$(VERB) $(DependC) $< | sed 's|$*\.o *|Release/& Profile/& Debug/& Depend/$(@F)|g' > $@
|
||||
$(VERB) $(DependC) -o $@ $< | $(SED) 's|\.o|\.lo|' | $(SED) 's|$*\.lo *|$(BUILD_OBJ_DIR)/Release/& $(BUILD_OBJ_DIR)/Profile/& $(BUILD_OBJ_DIR)/Debug/& $(BUILD_OBJ_DIR)/Depend/$(@F)|g' > $@
|
||||
|
||||
#
|
||||
# Include dependencies generated from C/C++ source files, but not if we
|
||||
# are cleaning (this example taken from the GNU Make Manual).
|
||||
#
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
ifneq ($(SourceDepend),)
|
||||
-include $(SourceDepend)
|
||||
endif
|
||||
endif
|
||||
|
3865
llvm/aclocal.m4
vendored
Normal file
3865
llvm/aclocal.m4
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1317
llvm/config.guess
vendored
Executable file
1317
llvm/config.guess
vendored
Executable file
File diff suppressed because it is too large
Load Diff
1411
llvm/config.sub
vendored
Executable file
1411
llvm/config.sub
vendored
Executable file
File diff suppressed because it is too large
Load Diff
12628
llvm/configure
vendored
Executable file
12628
llvm/configure
vendored
Executable file
File diff suppressed because it is too large
Load Diff
236
llvm/configure.ac
Normal file
236
llvm/configure.ac
Normal file
@ -0,0 +1,236 @@
|
||||
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@cs.uiuc.edu])
|
||||
|
||||
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])
|
||||
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 on a Solaris machine, pretend that it is V9, since that is all
|
||||
dnl that we support at the moment, and autoconf will only tell us we're a
|
||||
dnl sparc.
|
||||
dnl
|
||||
case $target in
|
||||
*sparc*solaris*) AC_SUBST(target,[[sparcv9-sun-solaris2.8]])
|
||||
;;
|
||||
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(verbose,AC_HELP_STRING([--enable-verbose],[Enable verbose compilation messages (default is NO)]), AC_SUBST(ENABLE_VERBOSE,[[VERBOSE=1]]), AC_SUBST(ENABLE_VERBOSE,[[]]))
|
||||
AC_ARG_ENABLE(profiling,AC_HELP_STRING([--enable-profiling],[Compile with profiling information (default is NO)]), AC_SUBST(ENABLE_PROFILING,[[ENABLE_PROFILING=1]]), AC_SUBST(ENABLE_PROFILING,[[]]))
|
||||
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)
|
@ -19,6 +19,11 @@
|
||||
<li><a href="#overview">Overview</a>
|
||||
<li><a href="#starting">Getting started with LLVM</a>
|
||||
<ol>
|
||||
<li><a href="#requirements">Requirements</a>
|
||||
<ol>
|
||||
<li><a href="#hardware">Hardware</a>
|
||||
<li><a href="#software">Software</a>
|
||||
</ol>
|
||||
<li><a href="#quickstart">Getting started quickly (a summary)</a>
|
||||
<li><a href="#checkout">Checkout LLVM from CVS</a>
|
||||
<li><a href="#terminology">Terminology and Notation</tt></a>
|
||||
@ -66,6 +71,82 @@
|
||||
</center>
|
||||
<!--=====================================================================-->
|
||||
|
||||
<!--=====================================================================-->
|
||||
<h3><a name="requirements"><b>Requirements</b></a></h3>
|
||||
<!--=====================================================================-->
|
||||
|
||||
<!--=====================================================================-->
|
||||
<h4><a name="hardware"><b>Hardware</b></a></h4>
|
||||
<!--=====================================================================-->
|
||||
LLVM is known to work on the following platforms:
|
||||
<ul>
|
||||
<li> Linux on x86
|
||||
<ul>
|
||||
<li> Approximately 700 MB of Free Disk Space
|
||||
<ul>
|
||||
<li>Source code: 30 MB
|
||||
<li>Object code: 670 MB
|
||||
</ul>
|
||||
</ul>
|
||||
<li> Solaris on Sparc
|
||||
<ul>
|
||||
<li> Approximately 1.03 GB of Free Disk Space
|
||||
<ul>
|
||||
<li>Source code: 30 MB
|
||||
<li>Object code: 1000 MB
|
||||
</ul>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
LLVM may compile on other platforms. While the LLVM utilities should work,
|
||||
they will only generate Sparc or x86 machine code.
|
||||
|
||||
<!--=====================================================================-->
|
||||
<h4><a name="software"><b>Software</b></a></h4>
|
||||
<!--=====================================================================-->
|
||||
<p>
|
||||
Compiling LLVM requires that you have several different software packages
|
||||
installed:
|
||||
|
||||
<ul>
|
||||
<li> GCC
|
||||
<p>
|
||||
The GNU Compiler Collection must be installed with C and C++ language
|
||||
support. GCC 3.x is supported, although some effort has been made to
|
||||
support GCC 2.96.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note that we currently do not support any other C++ compiler.
|
||||
</p>
|
||||
|
||||
<li> GNU Make
|
||||
<p>
|
||||
The LLVM build system relies upon GNU Make extensions. Therefore, you
|
||||
will need GNU Make (sometimes known as gmake) to build LLVM.
|
||||
</p>
|
||||
|
||||
<li> Flex and Bison
|
||||
<p>
|
||||
The LLVM source code is built using flex and bison. You will not be
|
||||
able to configure and compile LLVM without them.
|
||||
</p>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
There are some additional tools that you may want to have when working with
|
||||
LLVM:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li> GNU Autoconf and GNU M4
|
||||
<p>
|
||||
If you want to make changes to the autoconf scripts which configure LLVM
|
||||
for compilation, you will need GNU autoconf, and consequently, GNU M4.
|
||||
LLVM was built with autoconf 2.53, so that release and any later
|
||||
release should work.
|
||||
</p>
|
||||
</ul>
|
||||
|
||||
<!--=====================================================================-->
|
||||
<h3><a name="quickstart"><b>Getting Started Quickly (A Summary)</b></a></h3>
|
||||
@ -77,9 +158,17 @@
|
||||
<li><tt>cd <i>where-you-want-llvm-to-live</i></tt>
|
||||
<li><tt>cvs -d <i>CVSROOTDIR</i> checkout llvm</tt>
|
||||
<li><tt>cd llvm</tt>
|
||||
<li>Edit <tt>Makefile.config</tt> to set local paths. This includes
|
||||
setting the install location of the C frontend and the various paths
|
||||
to the C and C++ compilers used to build LLVM itself.
|
||||
<li>Run <tt>configure</tt> to configure the Makefiles and header files.
|
||||
Useful options include:
|
||||
<ul>
|
||||
<li><tt>--with-objroot=<i>directory</i></tt>
|
||||
<br>
|
||||
Specifiy where object files should be placed during the build.
|
||||
|
||||
<li><tt>--with-llvmgccdir=<i>directory</i></tt>
|
||||
<br>
|
||||
Specifiy where the LLVM C frontend has been installed.
|
||||
</ul>
|
||||
<li>Set your LLVM_LIB_SEARCH_PATH environment variable.
|
||||
<li><tt>gmake -k |& tee gnumake.out
|
||||
# this is csh or tcsh syntax</tt>
|
||||
@ -97,8 +186,8 @@
|
||||
|
||||
<p>Throughout this manual, the following names are used to denote paths
|
||||
specific to the local system and working environment. <i>These are not
|
||||
environment variables you need to set, but just strings used in the rest
|
||||
of this document below.</i>. In any of the examples below, simply replace
|
||||
environment variables you need to set but just strings used in the rest
|
||||
of this document below</i>. In any of the examples below, simply replace
|
||||
each of these names with the appropriate pathname on your local system.
|
||||
All these paths are absolute:</p>
|
||||
<ul>
|
||||
@ -109,7 +198,7 @@
|
||||
<!------------------------------------------------------------------------->
|
||||
|
||||
<p>Before checking out the source code, you will need to know the path to
|
||||
the CVS repository containing LLVM source code (we'll call this
|
||||
the CVS repository containing the LLVM source code (we'll call this
|
||||
<i>CVSROOTDIR</i> below). Ask the person responsible for your local LLVM
|
||||
installation to give you this path.
|
||||
|
||||
@ -128,30 +217,52 @@
|
||||
<h3><a name="config">Local Configuration Options</a></h3>
|
||||
<!------------------------------------------------------------------------->
|
||||
|
||||
<p>The file <tt>llvm/Makefile.config</tt>
|
||||
defines the following path variables
|
||||
which are specific to a particular installation of LLVM.
|
||||
These need to be modified only once after checking out a copy
|
||||
of LLVM (if the default values do not already match your system):
|
||||
<p>Once checked out from the CVS repository, options and pathnames specific
|
||||
to an installation of LLVM can be set via the <tt>configure</tt> script.
|
||||
This script sets variables in <tt>llvm/Makefile.config</tt> and
|
||||
<tt>llvm/include/Config/config.h</tt>.
|
||||
|
||||
<p>
|
||||
The following environment variables are used by <tt>configure</tt> to
|
||||
configure Makefile.config:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<p><li><i>CXX</i> = Path to C++ compiler to use.
|
||||
<p><li><i>OBJ_ROOT</i> = Path to the llvm directory where
|
||||
object files should be placed.
|
||||
(See the Section on <a href=#objfiles>
|
||||
The location for LLVM object files</a>
|
||||
for more information.)
|
||||
<p><li><i>LLVMGCCDIR</i> = Path to the location of the LLVM front-end
|
||||
binaries and associated libraries.
|
||||
<p><li><i>PURIFY</i> = Path to the purify program.
|
||||
<p><li><i>CXX</i> = Pathname of the C++ compiler to use.
|
||||
<p><li><i>CC</i> = Pathname of the C compiler to use.
|
||||
</ul>
|
||||
|
||||
In addition to settings in this file, you must set a
|
||||
The following options can be used to set or enable LLVM specific options:
|
||||
|
||||
<ul>
|
||||
<p><li><i>--with-objroot=LLVM_OBJ_ROOT</i> =
|
||||
Path to the directory where
|
||||
object files, libraries, and executables should be placed.
|
||||
(See the Section on <a href=#objfiles>
|
||||
The location for LLVM object files</a>
|
||||
for more information.)
|
||||
<p><li><i>--with-llvmgccdir=LLVMGCCDIR</i> =
|
||||
Path to the location of the LLVM front-end
|
||||
binaries and associated libraries.
|
||||
<p><li><i>--enable-optimized</i> =
|
||||
Enables optimized compilation (debugging symbols are removed and GCC
|
||||
optimization flags are enabled).
|
||||
<p><li><i>--enable-profiling</i> =
|
||||
Enables profiling compilation (compiler flags needed to add profiling
|
||||
data are enabled).
|
||||
<p><li><i>--enable-verbose</i> =
|
||||
Enables verbose messages during the compile.
|
||||
<p><li><i>--enable-jit</i> =
|
||||
Compile the Just In Time (JIT) functionality. This is not available
|
||||
on all platforms.
|
||||
</ul>
|
||||
|
||||
In addition to running <tt>configure</tt>, you must set the
|
||||
<tt>LLVM_LIB_SEARCH_PATH</tt> environment variable in your startup scripts.
|
||||
This environment variable is used to locate "system" libraries like
|
||||
"<tt>-lc</tt>" and "<tt>-lm</tt>" when linking. This variable should be set
|
||||
to the absolute path for the bytecode-libs subdirectory of the C front-end
|
||||
install. For example, one might use
|
||||
install. For example, one might set <tt>LLVM_LIB_SEARCH_PATH</tt> to
|
||||
<tt>/home/vadve/lattner/local/x86/llvm-gcc/bytecode-libs</tt> for the X86
|
||||
version of the C front-end on our research machines.<p>
|
||||
|
||||
@ -166,9 +277,11 @@
|
||||
object files on a different filesystem either to keep them from being backed
|
||||
up or to speed up local builds.
|
||||
|
||||
<p>If you do not wish to use a different location for object files (i.e.
|
||||
you are building into the source tree directly), just set this variable to
|
||||
".".<p>
|
||||
<p>If you wish to place output files into a separate directory, use the
|
||||
<tt>--with-objroot=<i>directory</i></tt> option of <tt>configure</tt> to
|
||||
set the top level directory of where the object files will go. Otherwise,
|
||||
leave this option unspecified, and <tt>configure</tt> will place files
|
||||
within the LLVM source tree.
|
||||
|
||||
<!------------------------------------------------------------------------->
|
||||
<h3><a name="environment">Setting up your environment</a></h3>
|
||||
@ -190,7 +303,7 @@
|
||||
</pre>
|
||||
The <tt>llvmgcc</tt> alias is useful because the C compiler is not
|
||||
included in the CVS tree you just checked out.
|
||||
|
||||
|
||||
<p>The other <a href="#tools">LLVM tools</a> are part of the LLVM
|
||||
source base and built when compiling LLVM. They will be built into the
|
||||
<tt><i>OBJ_ROOT</i>/tools/Debug</tt> directory.</p>
|
||||
@ -201,14 +314,15 @@
|
||||
|
||||
<p>Every directory in the LLVM source tree includes a <tt>Makefile</tt> to
|
||||
build it and any subdirectories that it contains. These makefiles require
|
||||
that you use GNU Make (aka <tt>gmake</tt>) instead of <tt>make</tt> to
|
||||
that you use GNU Make (sometimes called <tt>gmake</tt>) instead of
|
||||
<tt>make</tt> to
|
||||
build them, but can
|
||||
otherwise be used freely. To build the entire LLVM system, just enter the
|
||||
top level <tt>llvm</tt> directory and type <tt>gmake</tt>. A few minutes
|
||||
later you will hopefully have a freshly compiled toolchain waiting for you
|
||||
in <tt><i>OBJ_ROOT</i>/llvm/tools/Debug</tt>. If you want to look at the
|
||||
libraries that were compiled, look in
|
||||
<tt><i>OBJ_ROOT</i>/llvm/lib/Debug</tt>.</p>
|
||||
libraries that
|
||||
were compiled, look in <tt><i>OBJ_ROOT</i>/llvm/lib/Debug</tt>.</p>
|
||||
|
||||
If you get an error about a <tt>/localhome</tt> directory, follow the
|
||||
instructions in the section about <a href="#environment">Setting Up Your
|
||||
@ -242,7 +356,9 @@
|
||||
<!------------------------------------------------------------------------->
|
||||
|
||||
If you are building with the "<tt>OBJ_ROOT=.</tt>" option enabled in the
|
||||
<tt>Makefile.config</tt> file, most source directories will contain two
|
||||
<tt>Makefile.config</tt> file (i.e. you did not specify
|
||||
<tt>--with-objroot</tt> when you ran <tt>configure</tt>), most source
|
||||
directories will contain two
|
||||
directories, <tt>Depend</tt> and <tt>Debug</tt>. The <tt>Depend</tt>
|
||||
directory contains automatically generated dependance files which are used
|
||||
during compilation to make sure that source files get rebuilt if a header
|
||||
@ -250,7 +366,7 @@
|
||||
files, library files, and executables that are used for building a debug
|
||||
enabled build. The <tt>Release</tt> directory is created to hold the same
|
||||
files when the <tt>ENABLE_OPTIMIZED=1</tt> flag is passed to <tt>gmake</tt>,
|
||||
causing an optimized built to be performed.<p>
|
||||
causing an optimized build to be performed.<p>
|
||||
|
||||
|
||||
<!------------------------------------------------------------------------->
|
||||
@ -258,7 +374,7 @@
|
||||
<!------------------------------------------------------------------------->
|
||||
|
||||
This directory contains public header files exported from the LLVM
|
||||
library. The two main subdirectories of this directory are:<p>
|
||||
library. The three main subdirectories of this directory are:<p>
|
||||
|
||||
<ol>
|
||||
<li><tt>llvm/include/llvm</tt> - This directory contains all of the LLVM
|
||||
@ -268,16 +384,23 @@
|
||||
|
||||
<li><tt>llvm/include/Support</tt> - This directory contains generic
|
||||
support libraries that are independant of LLVM, but are used by LLVM.
|
||||
For example, header files for some C++ STL utilities and a Command Line
|
||||
option processing library are located here.
|
||||
For example, some C++ STL utilities and a Command Line option processing
|
||||
library.
|
||||
|
||||
<li><tt>llvm/include/Config</tt> - This directory contains header files
|
||||
configured by the <tt>configure</tt> script. They wrap "standard" UNIX
|
||||
and C header files. Source code can include these header files which
|
||||
automatically take care of the conditional #includes that the configure
|
||||
script generates.
|
||||
</ol>
|
||||
|
||||
<!------------------------------------------------------------------------->
|
||||
<h3><a name="lib"><tt>llvm/lib</tt></a></h3>
|
||||
<!------------------------------------------------------------------------->
|
||||
|
||||
This directory contains most source files of LLVM system. In LLVM, almost
|
||||
all code exists in libraries, making it very easy to share code among the
|
||||
This directory contains most of the source files of the LLVM system. In
|
||||
LLVM almost all
|
||||
code exists in libraries, making it very easy to share code among the
|
||||
different <a href="#tools">tools</a>.<p>
|
||||
|
||||
<dl compact>
|
||||
@ -365,7 +488,7 @@
|
||||
<dt><tt><b>gccas</b></tt><dd> This tool is invoked by the
|
||||
<tt>llvmgcc</tt> frontend as the "assembler" part of the compiler. This
|
||||
tool actually assembles LLVM assembly to LLVM bytecode,
|
||||
performs a variety of optimizations,
|
||||
performs a variety of optimizations,
|
||||
and outputs LLVM bytecode. Thus when you invoke <tt>llvmgcc -c x.c -o
|
||||
x.o</tt>, you are causing <tt>gccas</tt> to be run, which writes the
|
||||
<tt>x.o</tt> file (which is an LLVM bytecode file that can be
|
||||
|
46
llvm/include/Config/alloca.h
Normal file
46
llvm/include/Config/alloca.h
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Header file: alloc.h
|
||||
*
|
||||
* Description:
|
||||
* This header file includes the infamous alloc.h header file if the
|
||||
* autoconf system has found it. It hides all of the autoconf details
|
||||
* from the rest of the application source code.
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_ALLOC_H
|
||||
#define _CONFIG_ALLOC_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
/*
|
||||
* This is a modified version of that suggested by the Autoconf manual.
|
||||
* 1) The #pragma is indented so that pre-ANSI C compilers ignore it.
|
||||
* 2) If alloca.h cannot be found, then try stdlib.h. Some platforms
|
||||
* (notably FreeBSD) defined alloca() there.
|
||||
*/
|
||||
#ifndef __GNUC__
|
||||
# ifdef HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
# else
|
||||
# ifdef _AIX
|
||||
# pragma alloca
|
||||
# else
|
||||
# ifndef alloca
|
||||
char * alloca ();
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# ifdef HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
# else
|
||||
# ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
# else
|
||||
# error "The function alloca() is required but not found!"
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
23
llvm/include/Config/assert.h
Normal file
23
llvm/include/Config/assert.h
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Header file: assert.h
|
||||
*
|
||||
* Description:
|
||||
* This header file includes the assert.h header file if the
|
||||
* autoconf system has found it.
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_ASSERT_H
|
||||
#define _CONFIG_ASSERT_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
/*
|
||||
* This is the suggested use by the Autoconf manual.
|
||||
* 1) The #pragma is indented so that pre-ANSI C compilers ignore it.
|
||||
*/
|
||||
#ifdef HAVE_ASSERT_H
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
210
llvm/include/Config/config.h.in
Normal file
210
llvm/include/Config/config.h.in
Normal file
@ -0,0 +1,210 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
||||
systems. This function is required for `alloca.c' support on those systems.
|
||||
*/
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define to 1 if using `alloca.c'. */
|
||||
#undef C_ALLOCA
|
||||
|
||||
/* Define to 1 if you have `alloca', as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
|
||||
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
|
||||
*/
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define to 1 if you have the `getcwd' function. */
|
||||
#undef HAVE_GETCWD
|
||||
|
||||
/* Define to 1 if you have the `getpagesize' function. */
|
||||
#undef HAVE_GETPAGESIZE
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#undef HAVE_GETTIMEOFDAY
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the `dl' library (-ldl). */
|
||||
#undef HAVE_LIBDL
|
||||
|
||||
/* Define to 1 if you have the `elf' library (-lelf). */
|
||||
#undef HAVE_LIBELF
|
||||
|
||||
/* Define to 1 if you have the `m' library (-lm). */
|
||||
#undef HAVE_LIBM
|
||||
|
||||
/* Define to 1 if you have the `papi' library (-lpapi). */
|
||||
#undef HAVE_LIBPAPI
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
|
||||
/* Define to 1 if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the `strcspn' function. */
|
||||
#undef HAVE_STRCSPN
|
||||
|
||||
/* Define to 1 if you have the `strdup' function. */
|
||||
#undef HAVE_STRDUP
|
||||
|
||||
/* Define to 1 if you have the `strerror' function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the `strspn' function. */
|
||||
#undef HAVE_STRSPN
|
||||
|
||||
/* Define to 1 if you have the `strstr' function. */
|
||||
#undef HAVE_STRSTR
|
||||
|
||||
/* Define to 1 if you have the `strtod' function. */
|
||||
#undef HAVE_STRTOD
|
||||
|
||||
/* Define to 1 if you have the `strtol' function. */
|
||||
#undef HAVE_STRTOL
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if you have the `vprintf' function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define to 1 if the `setvbuf' function takes the buffering type as its
|
||||
second argument and the buffer pointer as the third, as on System V before
|
||||
release 3. */
|
||||
#undef SETVBUF_REVERSED
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
#undef STACK_DIRECTION
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
|
||||
`char[]'. */
|
||||
#undef YYTEXT_POINTER
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
|
||||
if it is not supported. */
|
||||
#undef inline
|
||||
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
#undef pid_t
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define to mark the machine as having little endian */
|
||||
#ifndef ENDIAN_LITTLE
|
||||
#undef ENDIAN_LITTLE
|
||||
#endif
|
||||
|
||||
/* Define to mark the machine as having big endian */
|
||||
#ifndef ENDIAN_BIG
|
||||
#undef ENDIAN_BIG
|
||||
#endif
|
||||
|
||||
/* Define to indicate how to include hash_map */
|
||||
#undef HAVE_STD_EXT_HASH_MAP
|
||||
#undef HAVE_GNU_EXT_HASH_MAP
|
||||
|
||||
/* Define to incdicate how to include has_set */
|
||||
#undef HAVE_STD_EXT_HASH_SET
|
||||
#undef HAVE_GNU_EXT_HASH_SET
|
||||
|
||||
/* Indicates whether we have STL iterators */
|
||||
#undef HAVE_STD_ITERATOR
|
||||
|
||||
/* Indicates which slist we should use */
|
||||
#undef HAVE_EXT_SLIST
|
||||
|
||||
/* Indicates whether we have the MALLINFO functionality */
|
||||
#undef HAVE_MALLINFO
|
||||
|
||||
/* Indicates if we have MAP_ANONYMOUS */
|
||||
#undef HAVE_MMAP_ANONYMOUS
|
||||
|
||||
/* Indicates whether we have MMAP header file */
|
||||
#undef HAVE_SYS_MMAN_H
|
||||
|
||||
/* Indicates that we have assert.h */
|
||||
#undef HAVE_ASSERT_H
|
||||
|
||||
/* Macros for various header files */
|
||||
#undef HAVE_SIGNAL_H
|
||||
#undef HAVE_ERRNO_H
|
||||
#undef HAVE_SYS_RESOURCE_H
|
||||
#undef HAVE_MATH_H
|
||||
#undef HAVE_DLFCN_H
|
||||
#undef HAVE_LINK_H
|
27
llvm/include/Config/dlfcn.h
Normal file
27
llvm/include/Config/dlfcn.h
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Header file: dlfcn.h
|
||||
*
|
||||
* Description:
|
||||
* This header file is the autoconf replacement for dlfcn.h (if it lives
|
||||
* on the system).
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_DLFCN_H
|
||||
#define _CONFIG_DLFCN_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
/*
|
||||
* According to the man pages on dlopen(), we sometimes need link.h. So,
|
||||
* go grab it just in case.
|
||||
*/
|
||||
#ifdef HAVE_DLFCN_H
|
||||
#include <dlfcn.h>
|
||||
|
||||
#ifdef HAVE_LINK_H
|
||||
#include <link.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
18
llvm/include/Config/errno.h
Normal file
18
llvm/include/Config/errno.h
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Header file: errno.h
|
||||
*
|
||||
* Description:
|
||||
* This header file is the autoconf replacement for errno.h (if it lives
|
||||
* on the system).
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_ERRNO_H
|
||||
#define _CONFIG_ERRNO_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_ERRNO_H
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#endif
|
18
llvm/include/Config/fcntl.h
Normal file
18
llvm/include/Config/fcntl.h
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Header file: fcntl.h
|
||||
*
|
||||
* Description:
|
||||
* This header file is the autoconf replacement for fcntl.h (if it lives
|
||||
* on the system).
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_FCNTL_H
|
||||
#define _CONFIG_FCNTL_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#endif
|
18
llvm/include/Config/limits.h
Normal file
18
llvm/include/Config/limits.h
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Header file: limits.h
|
||||
*
|
||||
* Description:
|
||||
* This header file is the autoconf replacement for limits.h (if it lives
|
||||
* on the system).
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_LIMITS_H
|
||||
#define _CONFIG_LIMITS_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#endif
|
18
llvm/include/Config/link.h
Normal file
18
llvm/include/Config/link.h
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Header file: link.h
|
||||
*
|
||||
* Description:
|
||||
* This header file is the autoconf replacement for link.h (if it lives
|
||||
* on the system).
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_LINK_H
|
||||
#define _CONFIG_LINK_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_LINK_H
|
||||
#include <link.h>
|
||||
#endif
|
||||
|
||||
#endif
|
20
llvm/include/Config/malloc.h
Normal file
20
llvm/include/Config/malloc.h
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Header file: malloc.h
|
||||
*
|
||||
* Description:
|
||||
* This header file includes the infamous malloc.h header file if the
|
||||
* autoconf system has found it. It hides all of the autoconf details
|
||||
* from the rest of the application source code.
|
||||
*/
|
||||
|
||||
#ifndef _SUPPORT_MALLOC_H
|
||||
#define _SUPPORT_MALLOC_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
18
llvm/include/Config/memory.h
Normal file
18
llvm/include/Config/memory.h
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Header file: memory.h
|
||||
*
|
||||
* Description:
|
||||
* This header file is the autoconf replacement for memory.h (if it lives
|
||||
* on the system).
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_MEMORY_H
|
||||
#define _CONFIG_MEMORY_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_MEMORY_H
|
||||
#include <memory.h>
|
||||
#endif
|
||||
|
||||
#endif
|
18
llvm/include/Config/stdint.h
Normal file
18
llvm/include/Config/stdint.h
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Header file: stdint.h
|
||||
*
|
||||
* Description:
|
||||
* This header file is the autoconf replacement for stdint.h (if it lives
|
||||
* on the system).
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_STDINT_H
|
||||
#define _CONFIG_STDINT_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#endif
|
22
llvm/include/Config/stdio.h
Normal file
22
llvm/include/Config/stdio.h
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Header file: stdio.h
|
||||
*
|
||||
* Description:
|
||||
* This header file is the autoconf replacement for stdio.h (if it lives
|
||||
* on the system).
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_STDIO_H
|
||||
#define _CONFIG_STDIO_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
/*
|
||||
* Assume that stdio.h exists if autoconf find the ANSI C header files.
|
||||
* I'd think stdlib.h would be here to, but I guess not.
|
||||
*/
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#endif
|
18
llvm/include/Config/stdlib.h
Normal file
18
llvm/include/Config/stdlib.h
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Header file: stdlib.h
|
||||
*
|
||||
* Description:
|
||||
* This header file is the autoconf replacement for stdlib.h (if it lives
|
||||
* on the system).
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_STDLIB_H
|
||||
#define _CONFIG_STDLIB_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#endif
|
18
llvm/include/Config/string.h
Normal file
18
llvm/include/Config/string.h
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Header file: string.h
|
||||
*
|
||||
* Description:
|
||||
* This header file is the autoconf replacement for string.h (if it lives
|
||||
* on the system).
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_STRING_H
|
||||
#define _CONFIG_STRING_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#endif
|
18
llvm/include/Config/strings.h
Normal file
18
llvm/include/Config/strings.h
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Header file: strings.h
|
||||
*
|
||||
* Description:
|
||||
* This header file is the autoconf replacement for strings.h (if it lives
|
||||
* on the system).
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_STRINGS_H
|
||||
#define _CONFIG_STRINGS_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#endif
|
24
llvm/include/Config/sys/mman.h
Normal file
24
llvm/include/Config/sys/mman.h
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Header file: mman.h
|
||||
*
|
||||
* Description:
|
||||
* This header file includes the headers needed for the mmap() system/
|
||||
* function call. It also defines some macros so that all of our calls
|
||||
* to mmap() can act (more or less) the same, regardless of platform.
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_MMAN_H
|
||||
#define _CONFIG_MMAN_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_SYS_MMAN_H
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_MMAP_ANONYMOUS
|
||||
#define MAP_ANONYMOUS MAP_ANON
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
33
llvm/include/Config/sys/resource.h
Normal file
33
llvm/include/Config/sys/resource.h
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Header file: resource.h
|
||||
*
|
||||
* Description:
|
||||
* This header file is the autoconf replacement for sys/resource.h (if it
|
||||
* lives on the system).
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_SYS_RESOURCE_H
|
||||
#define _CONFIG_SYS_RESOURCE_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
|
||||
/*
|
||||
* In LLVM, we use sys/resource.h to use getrusage() and maybe some other
|
||||
* stuff. Some man pages say that you also need sys/time.h and unistd.h.
|
||||
* So, to be paranoid, we will try to include all three if possible.
|
||||
*/
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include <sys/resource.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
19
llvm/include/Config/sys/stat.h
Normal file
19
llvm/include/Config/sys/stat.h
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Header file: stat.h
|
||||
*
|
||||
* Description:
|
||||
* This header file includes the headers needed for the stat() system
|
||||
* call.
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_SYS_STAT_H
|
||||
#define _CONFIG_SYS_STAT_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
18
llvm/include/Config/sys/time.h
Normal file
18
llvm/include/Config/sys/time.h
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Header file: time.h
|
||||
*
|
||||
* Description:
|
||||
* This header file is the autoconf replacement for sys/time.h (if it
|
||||
* lives on the system).
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_SYS_TIME_H
|
||||
#define _CONFIG_SYS_TIME_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#endif
|
19
llvm/include/Config/sys/types.h
Normal file
19
llvm/include/Config/sys/types.h
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Header file: types.h
|
||||
*
|
||||
* Description:
|
||||
* This header file is the autoconf substitute for sys/types.h. It
|
||||
* includes it for us if it exists on this system.
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_SYS_TYPES_H
|
||||
#define _CONFIG_SYS_TYPES_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
19
llvm/include/Config/sys/wait.h
Normal file
19
llvm/include/Config/sys/wait.h
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Header file: wait.h
|
||||
*
|
||||
* Description:
|
||||
* This header file includes the headers needed for the wait() system
|
||||
* call.
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_SYS_WAIT_H
|
||||
#define _CONFIG_SYS_WAIT_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
28
llvm/include/Config/time.h
Normal file
28
llvm/include/Config/time.h
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Header file: time.h
|
||||
*
|
||||
* Description:
|
||||
* This header file is the autoconf replacement for time.h (if it lives
|
||||
* on the system).
|
||||
*
|
||||
* The added benefit of this header file is that it removes the
|
||||
* "time with sys/time" problem.
|
||||
*
|
||||
* According to the autoconf manual, some systems have a sys/time.h that
|
||||
* includes time.h, but time.h is not written to handle multiple
|
||||
* inclusion. This means that a program including sys/time.h cannot
|
||||
* also include time.h.
|
||||
*
|
||||
* This header file fixes that problem.
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_TIME_H
|
||||
#define _CONFIG_TIME_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_TIME_H
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#endif
|
18
llvm/include/Config/unistd.h
Normal file
18
llvm/include/Config/unistd.h
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Header file: unistd.h
|
||||
*
|
||||
* Description:
|
||||
* This header file is the autoconf replacement for unistd.h (if it lives
|
||||
* on the system).
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_UNISTD_H
|
||||
#define _CONFIG_UNISTD_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#endif
|
@ -9,22 +9,6 @@
|
||||
#ifndef SUPPORT_ALLOCA_H
|
||||
#define SUPPORT_ALLOCA_H
|
||||
|
||||
// TODO: Determine HAVE_ALLOCA_H based on autoconf results.
|
||||
// The following method is too brittle.
|
||||
#if defined(HAVE_ALLOCA_H)
|
||||
#undef HAVE_ALLOCA_H
|
||||
#endif
|
||||
|
||||
#if defined(__linux__)
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#elif defined(__sparc__)
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#elif defined(__FreeBSD__)
|
||||
// not defined here
|
||||
#endif
|
||||
|
||||
#if HAVE_ALLOCA_H
|
||||
#include <alloca.h>
|
||||
#endif
|
||||
#include "Config/alloca.h"
|
||||
|
||||
#endif /* SUPPORT_ALLOCA_H */
|
||||
|
@ -16,7 +16,7 @@
|
||||
#define SUPPORT_ANNOTATION_H
|
||||
|
||||
#include <string>
|
||||
#include <assert.h>
|
||||
|
||||
class AnnotationID;
|
||||
class Annotation;
|
||||
class Annotable;
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <assert.h>
|
||||
|
||||
class BitSetVector {
|
||||
enum { BITSET_WORDSIZE = sizeof(long)*8 };
|
||||
|
@ -8,8 +8,6 @@
|
||||
#ifndef SUPPORT_CASTING_H
|
||||
#define SUPPORT_CASTING_H
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// isa<x> Support Templates
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include <utility>
|
||||
#include <cstdarg>
|
||||
#include "boost/type_traits/object_traits.hpp"
|
||||
#include <assert.h>
|
||||
|
||||
/// cl Namespace - This namespace contains all of the command line option
|
||||
/// processing machinery. It is intentionally a short name to make qualified
|
||||
|
@ -13,65 +13,19 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// TODO: This file sucks. Not only does it not work, but this stuff should be
|
||||
// autoconfiscated anyways. Major FIXME
|
||||
|
||||
#ifndef SUPPORT_DATATYPES_H
|
||||
#define SUPPORT_DATATYPES_H
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
|
||||
#ifdef __linux__
|
||||
# include <endian.h>
|
||||
# if BYTE_ORDER == LITTLE_ENDIAN
|
||||
# undef BIG_ENDIAN
|
||||
# else
|
||||
# undef LITTLE_ENDIAN
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
# include <machine/endian.h>
|
||||
# if _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
# ifndef LITTLE_ENDIAN
|
||||
# define LITTLE_ENDIAN 1
|
||||
# endif
|
||||
# ifdef BIG_ENDIAN
|
||||
# undef BIG_ENDIAN
|
||||
# endif
|
||||
# else
|
||||
# ifndef BIG_ENDIAN
|
||||
# define BIG_ENDIAN 1
|
||||
# endif
|
||||
# ifdef LITTLE_ENDIAN
|
||||
# undef LITTLE_ENDIAN
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __sparc__
|
||||
# include <sys/types.h>
|
||||
# ifdef _LITTLE_ENDIAN
|
||||
# define LITTLE_ENDIAN 1
|
||||
# else
|
||||
# define BIG_ENDIAN 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Convert the information from the header files into our own local
|
||||
// endian macros. We do this because various strange systems define both
|
||||
// BIG_ENDIAN and LITTLE_ENDIAN, and we don't want to conflict with them.
|
||||
//
|
||||
// Don't worry; once we introduce autoconf, this will look a lot nicer.
|
||||
//
|
||||
#ifdef LITTLE_ENDIAN
|
||||
#define ENDIAN_LITTLE
|
||||
#endif
|
||||
|
||||
#ifdef BIG_ENDIAN
|
||||
#define ENDIAN_BIG
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#if (defined(ENDIAN_LITTLE) && defined(ENDIAN_BIG))
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <vector>
|
||||
#include <stack>
|
||||
#include <map>
|
||||
#include <assert.h>
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// class SCC : A simple representation of an SCC in a generic Graph.
|
||||
|
@ -10,6 +10,11 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
//
|
||||
// This will include the signal handler return type.
|
||||
//
|
||||
#include "Config/config.h"
|
||||
|
||||
// RemoveFileOnSignal - This function registers signal handlers to ensure that
|
||||
// if a signal gets delivered that the named file is removed.
|
||||
//
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iosfwd>
|
||||
#include <assert.h>
|
||||
|
||||
class TimerGroup;
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
#define SUPPORT_TREE_H
|
||||
|
||||
#include <vector>
|
||||
#include <assert.h>
|
||||
|
||||
template<class ConcreteTreeNode, class Payload>
|
||||
class Tree {
|
||||
|
@ -17,23 +17,25 @@
|
||||
// 3.0.4 std ext/hash_map
|
||||
// 3.1 __gnu_cxx ext/hash_map
|
||||
//
|
||||
#if __GNUC__ == 3
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_GNU_EXT_HASH_MAP
|
||||
|
||||
#include <ext/hash_map>
|
||||
|
||||
#ifndef HASH_NAMESPACE
|
||||
#if __GNUC_MINOR__ == 0
|
||||
#define HASH_NAMESPACE std
|
||||
#else
|
||||
#define HASH_NAMESPACE __gnu_cxx
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#include <hash_map>
|
||||
#ifndef HASH_NAMESPACE
|
||||
#ifdef HAVE_STD_EXT_HASH_MAP
|
||||
#include <ext/hash_map>
|
||||
#define HASH_NAMESPACE std
|
||||
|
||||
#else
|
||||
#include <hash_map>
|
||||
#define HASH_NAMESPACE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
using HASH_NAMESPACE::hash_map;
|
||||
|
@ -17,23 +17,25 @@
|
||||
// 3.0.4 std ext/hash_set
|
||||
// 3.1 __gnu_cxx ext/hash_set
|
||||
//
|
||||
#if __GNUC__==3
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#ifdef HAVE_GNU_EXT_HASH_SET
|
||||
|
||||
#include <ext/hash_set>
|
||||
|
||||
#ifndef HASH_NAMESPACE
|
||||
#if __GNUC_MINOR__ == 0
|
||||
#define HASH_NAMESPACE std
|
||||
#else
|
||||
#define HASH_NAMESPACE __gnu_cxx
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#include <hash_set>
|
||||
#ifndef HASH_NAMESPACE
|
||||
#ifdef HAVE_STD_EXT_HASH_SET
|
||||
#include <ext/hash_set>
|
||||
#define HASH_NAMESPACE std
|
||||
|
||||
#else
|
||||
#include <hash_set>
|
||||
#define HASH_NAMESPACE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
using HASH_NAMESPACE::hash_set;
|
||||
|
@ -31,7 +31,6 @@
|
||||
#ifndef SUPPORT_ILIST
|
||||
#define SUPPORT_ILIST
|
||||
|
||||
#include <assert.h>
|
||||
#include <algorithm>
|
||||
#include <Support/iterator>
|
||||
|
||||
|
@ -19,9 +19,11 @@
|
||||
#ifndef SUPPORT_ITERATOR
|
||||
#define SUPPORT_ITERATOR
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
#include <iterator>
|
||||
|
||||
#if __GNUC__ == 3
|
||||
#ifdef HAVE_STD_ITERATOR
|
||||
|
||||
// Define stupid wrappers around std::iterator...
|
||||
template<class Ty, class PtrDiffTy>
|
||||
@ -35,6 +37,7 @@ struct forward_iterator
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
// Just use bidirectional_iterator directly.
|
||||
using std::bidirectional_iterator;
|
||||
using std::forward_iterator;
|
||||
|
@ -10,6 +10,8 @@
|
||||
#ifndef SUPPORT_SLIST
|
||||
#define SUPPORT_SLIST
|
||||
|
||||
#include "Config/config.h"
|
||||
|
||||
// Compiler Support Matrix
|
||||
//
|
||||
// Version Namespace Header File
|
||||
@ -17,18 +19,19 @@
|
||||
// 3.0.4 std ext/slist
|
||||
// 3.1 __gnu_cxx ext/slist
|
||||
//
|
||||
#if __GNUC__ == 3
|
||||
|
||||
#ifdef HAVE_EXT_SLIST
|
||||
#include <ext/slist>
|
||||
|
||||
#if __GNUC_MINOR__ == 0
|
||||
using std::slist;
|
||||
#else
|
||||
using __gnu_cxx::slist;
|
||||
#endif
|
||||
|
||||
#else
|
||||
// GCC 2.x
|
||||
#include <slist>
|
||||
#endif
|
||||
|
||||
#if HAVE_EXT_SLIST == std
|
||||
using std::slist;
|
||||
#endif
|
||||
|
||||
#if HAVE_EXT_SLIST == gnu
|
||||
using __gnu_cxx::slist;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -21,7 +21,16 @@
|
||||
#ifndef LLVM_ABSTRACT_TYPE_USER_H
|
||||
#define LLVM_ABSTRACT_TYPE_USER_H
|
||||
|
||||
#include <assert.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
|
||||
//
|
||||
// In this way, most every LLVM source file will have access to the assert()
|
||||
// macro without having to #include <assert.h> directly.
|
||||
//
|
||||
#include "Config/assert.h"
|
||||
|
||||
class Type;
|
||||
class DerivedType;
|
||||
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <iosfwd>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <assert.h>
|
||||
|
||||
class Instruction;
|
||||
class Function;
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "llvm/Pass.h"
|
||||
#include <set>
|
||||
|
||||
class Instruction;
|
||||
|
||||
template <typename GraphType> struct GraphTraits;
|
||||
|
@ -8,6 +8,7 @@
|
||||
#define LLVM_CODEGEN_INSTR_SELECTION_H
|
||||
|
||||
#include "llvm/Instruction.h"
|
||||
|
||||
class Function;
|
||||
class InstrForest;
|
||||
class MachineInstr;
|
||||
|
@ -35,7 +35,6 @@ class TargetData;
|
||||
class TargetRegisterClass;
|
||||
class MachineFunction;
|
||||
#include <vector>
|
||||
#include <assert.h>
|
||||
|
||||
class MachineFrameInfo {
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
#define LLVM_CODEGEN_SSAREGMAP_H
|
||||
|
||||
#include "llvm/Target/MRegisterInfo.h"
|
||||
|
||||
class TargetRegisterClass;
|
||||
|
||||
class SSARegMap {
|
||||
|
@ -14,6 +14,7 @@
|
||||
#define LLVM_GLOBAL_VARIABLE_H
|
||||
|
||||
#include "llvm/GlobalValue.h"
|
||||
|
||||
class Module;
|
||||
class Constant;
|
||||
class PointerType;
|
||||
|
@ -9,6 +9,7 @@
|
||||
#define LLVM_INSTRUCTION_H
|
||||
|
||||
#include "llvm/User.h"
|
||||
|
||||
template<typename SC> struct ilist_traits;
|
||||
template<typename ValueSubClass, typename ItemParentClass, typename SymTabClass,
|
||||
typename SubClass> class SymbolTableListTraits;
|
||||
|
@ -22,7 +22,6 @@
|
||||
#ifndef LLVM_PASS_H
|
||||
#define LLVM_PASS_H
|
||||
|
||||
#include <assert.h>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <iosfwd>
|
||||
|
@ -8,7 +8,6 @@
|
||||
#define LLVM_TARGET_TARGETCACHEINFO_H
|
||||
|
||||
#include "Support/DataTypes.h"
|
||||
#include <assert.h>
|
||||
|
||||
class TargetMachine;
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
#include "Support/DataTypes.h"
|
||||
#include <vector>
|
||||
#include <assert.h>
|
||||
|
||||
class MachineInstr;
|
||||
class TargetMachine;
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
#include "Support/hash_map"
|
||||
#include <string>
|
||||
#include <assert.h>
|
||||
|
||||
class TargetMachine;
|
||||
class IGNode;
|
||||
|
251
llvm/install-sh
Normal file
251
llvm/install-sh
Normal file
@ -0,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
|
@ -23,7 +23,7 @@
|
||||
#include <list>
|
||||
#include "llvmAsmParser.h"
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include "Config/stdlib.h"
|
||||
|
||||
#define RET_TOK(type, Enum, sym) \
|
||||
llvmAsmlval.type = Instruction::Enum; return sym
|
||||
|
@ -5,3 +5,9 @@ LIBRARYNAME = asmparser
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
||||
|
||||
#
|
||||
# Make the source code file for the lexer depend upon the header file generated
|
||||
# by the Bison parser. This prevents the generation of dependencies from
|
||||
# being performed until after the header file has been created.
|
||||
#
|
||||
Lexer.cpp: llvmAsmParser.h
|
||||
|
@ -11,9 +11,9 @@
|
||||
|
||||
#include "llvm/Bytecode/Reader.h"
|
||||
#include "llvm/Module.h"
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mman.h>
|
||||
#include <fcntl.h>
|
||||
#include "Config/sys/stat.h"
|
||||
#include "Config/sys/mman.h"
|
||||
#include "Config/fcntl.h"
|
||||
|
||||
namespace {
|
||||
struct ar_hdr {
|
||||
|
@ -11,17 +11,17 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "ReaderInternals.h"
|
||||
#include "Config/sys/mman.h"
|
||||
#include "llvm/Bytecode/Reader.h"
|
||||
#include "llvm/Bytecode/Format.h"
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/Constants.h"
|
||||
#include "llvm/iPHINode.h"
|
||||
#include "llvm/iOther.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mman.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include "Config/sys/types.h"
|
||||
#include "Config/sys/stat.h"
|
||||
#include "Config/fcntl.h"
|
||||
#include "Config/unistd.h"
|
||||
#include <algorithm>
|
||||
|
||||
bool BytecodeParser::getTypeSlot(const Type *Ty, unsigned &Slot) {
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "llvm/DerivedTypes.h"
|
||||
#include "Support/STLExtras.h"
|
||||
#include "Support/Statistic.h"
|
||||
#include <string.h>
|
||||
#include "Config/string.h"
|
||||
#include <algorithm>
|
||||
|
||||
static RegisterPass<WriteBytecodePass> X("emitbytecode", "Bytecode Writer");
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "llvm/Type.h"
|
||||
#include "llvm/CodeGen/MachineInstr.h"
|
||||
#include "Support/STLExtras.h"
|
||||
#include "Config/alloca.h"
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// class InstrTreeNode
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/iOther.h"
|
||||
#include "llvm/Pass.h"
|
||||
#include <limits.h>
|
||||
#include "Config/limits.h"
|
||||
|
||||
const int INVALID_FRAME_OFFSET = INT_MAX; // std::numeric_limits<int>::max();
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/Target/TargetData.h"
|
||||
#include "Support/Statistic.h"
|
||||
#include <dlfcn.h>
|
||||
#include "Config/dlfcn.h"
|
||||
|
||||
Statistic<> NumInitBytes("lli", "Number of bytes of global vars initialized");
|
||||
|
||||
|
@ -17,10 +17,10 @@
|
||||
#include "llvm/SymbolTable.h"
|
||||
#include "llvm/Target/TargetData.h"
|
||||
#include <map>
|
||||
#include <dlfcn.h>
|
||||
#include <link.h>
|
||||
#include "Config/dlfcn.h"
|
||||
#include "Config/link.h"
|
||||
#include <cmath>
|
||||
#include <stdio.h>
|
||||
#include "Config/stdio.h"
|
||||
using std::vector;
|
||||
|
||||
typedef GenericValue (*ExFunc)(FunctionType *, const vector<GenericValue> &);
|
||||
|
@ -6,6 +6,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "VM.h"
|
||||
#include "Config/sys/mman.h"
|
||||
#include "llvm/CodeGen/MachineCodeEmitter.h"
|
||||
#include "llvm/CodeGen/MachineFunction.h"
|
||||
#include "llvm/CodeGen/MachineConstantPool.h"
|
||||
@ -82,7 +83,7 @@ static void *getMemory(unsigned NumPages) {
|
||||
static unsigned long Counter = 0;
|
||||
pa = mmap((void*)(0x140000000UL+Counter), pageSize*NumPages,
|
||||
PROT_READ|PROT_WRITE|PROT_EXEC,
|
||||
MAP_PRIVATE|MAP_ANON|MAP_FIXED, -1, 0); /* fd = -1 */
|
||||
MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0); /* fd = -1 */
|
||||
Counter += pageSize*NumPages;
|
||||
#else
|
||||
std::cerr << "This architecture is not supported by the JIT\n";
|
||||
|
@ -9,7 +9,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "VM.h"
|
||||
#include <dlfcn.h> // dlsym access
|
||||
#include "Config/dlfcn.h" // dlsym access
|
||||
#include <iostream>
|
||||
|
||||
// AtExitList - List of functions registered with the at_exit function
|
||||
|
@ -3,7 +3,7 @@ TOOLNAME = lli
|
||||
PARALLEL_DIRS = Interpreter JIT
|
||||
|
||||
# Get the config name...
|
||||
include $(LEVEL)/Makefile.$(shell uname)
|
||||
include $(LEVEL)/Makefile.config
|
||||
|
||||
# Generic JIT libraries
|
||||
JITLIBS = lli-jit codegen
|
||||
|
@ -1,6 +1,8 @@
|
||||
LEVEL = ..
|
||||
|
||||
PARALLEL_DIRS = VMCore Analysis Transforms AsmParser Bytecode Support CodeGen Target CWriter Reoptimizer
|
||||
PARALLEL_DIRS = VMCore Analysis Transforms AsmParser Bytecode Support CodeGen Target CWriter
|
||||
|
||||
OPTIONAL_DIRS = Reoptimizer
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "Support/CommandLine.h"
|
||||
#include <dlfcn.h>
|
||||
#include <link.h>
|
||||
#include "Config/dlfcn.h"
|
||||
#include "Config/link.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace {
|
||||
|
@ -32,7 +32,7 @@ static const int *KillSigsEnd = KillSigs + sizeof(KillSigs)/sizeof(KillSigs[0]);
|
||||
|
||||
|
||||
// SignalHandler - The signal handler that runs...
|
||||
static void SignalHandler(int Sig) {
|
||||
static RETSIGTYPE SignalHandler(int Sig) {
|
||||
while (!FilesToRemove.empty()) {
|
||||
std::remove(FilesToRemove.back().c_str());
|
||||
FilesToRemove.pop_back();
|
||||
|
@ -10,12 +10,12 @@
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include "Config/sys/types.h"
|
||||
#include "Config/sys/stat.h"
|
||||
#include "Config/fcntl.h"
|
||||
#include "Config/sys/wait.h"
|
||||
#include "Config/unistd.h"
|
||||
#include "Config/errno.h"
|
||||
|
||||
/// removeFile - Delete the specified file
|
||||
///
|
||||
|
@ -4,15 +4,16 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "Config/malloc.h"
|
||||
|
||||
#include "Support/Timer.h"
|
||||
#include "Support/CommandLine.h"
|
||||
#include <sys/resource.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#ifndef __FreeBSD__
|
||||
#include <malloc.h>
|
||||
#endif // __FreeBSD__
|
||||
#include <stdio.h>
|
||||
|
||||
#include "Config/sys/resource.h"
|
||||
#include "Config/sys/time.h"
|
||||
#include "Config/unistd.h"
|
||||
#include "Config/malloc.h"
|
||||
#include "Config/stdio.h"
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
@ -21,10 +22,12 @@
|
||||
std::string LibSupportInfoOutputFilename;
|
||||
|
||||
namespace {
|
||||
#ifdef HAVE_MALLINFO
|
||||
cl::opt<bool>
|
||||
TrackSpace("track-memory", cl::desc("Enable -time-passes memory "
|
||||
"tracking (this may be slow)"),
|
||||
cl::Hidden);
|
||||
#endif
|
||||
|
||||
cl::opt<std::string, true>
|
||||
InfoOutputFilename("info-output-file",
|
||||
@ -76,12 +79,12 @@ Timer::~Timer() {
|
||||
}
|
||||
|
||||
static long getMemUsage() {
|
||||
#ifndef __FreeBSD__
|
||||
#ifdef HAVE_MALLINFO
|
||||
if (TrackSpace) {
|
||||
struct mallinfo MI = mallinfo();
|
||||
return MI.uordblks/*+MI.hblkhd*/;
|
||||
}
|
||||
#endif // __FreeBSD__
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -14,20 +14,29 @@ endif
|
||||
Debug/Sparc.burm.cpp: Debug/Sparc.burm Debug/.dir
|
||||
$(RunBurg) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Debug/Sparc.burm.o: Debug/Sparc.burm.cpp
|
||||
$(BUILD_OBJ_DIR)/Debug/Sparc.burm.lo: Debug/Sparc.burm.cpp
|
||||
$(CompileG) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Release/Sparc.burm.o: Debug/Sparc.burm.cpp
|
||||
$(BUILD_OBJ_DIR)/Release/Sparc.burm.lo: Debug/Sparc.burm.cpp
|
||||
$(CompileO) $< -o $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Profile/Sparc.burm.o: Debug/Sparc.burm.cpp
|
||||
$(BUILD_OBJ_DIR)/Profile/Sparc.burm.lo: Debug/Sparc.burm.cpp
|
||||
$(CompileP) $< -o $@
|
||||
|
||||
#$(BUILD_OBJ_DIR)/Debug/Sparc.burm.o: Debug/Sparc.burm.cpp
|
||||
# $(CompileG) $< -o $@
|
||||
|
||||
#$(BUILD_OBJ_DIR)/Release/Sparc.burm.o: Debug/Sparc.burm.cpp
|
||||
# $(CompileO) $< -o $@
|
||||
|
||||
#$(BUILD_OBJ_DIR)/Profile/Sparc.burm.o: Debug/Sparc.burm.cpp
|
||||
# $(CompileP) $< -o $@
|
||||
|
||||
Debug/Sparc.burg.in1 : Sparc.burg.in Debug/.dir
|
||||
$(CXX) -E -I$(LEVEL)/include $(DEBUG_FLAG) -x c++ $< | sed '/^# /d' | sed 's/Ydefine/#define/' > $@
|
||||
$(CXX) -E -I$(LEVEL)/include $(DEBUG_FLAG) -x c++ $< | ${SED} '/^# /d' | ${SED} 's/Ydefine/#define/' > $@
|
||||
|
||||
Debug/Sparc.burm : Debug/Sparc.burg.in1
|
||||
$(CXX) -E -I$(LEVEL)/include $(DEBUG_FLAG) -x c++ $< | sed '/^# /d' | sed 's/Xinclude/#include/g' | sed 's/Xdefine/#define/g' > $@
|
||||
$(CXX) -E -I$(LEVEL)/include $(DEBUG_FLAG) -x c++ $< | ${SED} '/^# /d' | ${SED} 's/Xinclude/#include/g' | ${SED} 's/Xdefine/#define/g' > $@
|
||||
|
||||
$(BUILD_OBJ_DIR)/Depend/Sparc.burm.d: $(BUILD_OBJ_DIR)/Depend/.dir
|
||||
touch $@
|
||||
@ -35,8 +44,8 @@ $(BUILD_OBJ_DIR)/Depend/Sparc.burm.d: $(BUILD_OBJ_DIR)/Depend/.dir
|
||||
SparcV9CodeEmitter.cpp: SparcV9CodeEmitter.inc
|
||||
|
||||
SparcV9CodeEmitter.inc: SparcV9.td SparcV9_F2.td SparcV9_F3.td SparcV9_F4.td SparcV9_Reg.td $(TBLGEN)
|
||||
@echo "TableGen-erating $@"
|
||||
@${ECHO} "TableGen-erating $@"
|
||||
cpp -P SparcV9.td | $(TBLGEN) -gen-emitter -o $@
|
||||
|
||||
clean::
|
||||
rm -f SparcV9CodeEmitter.inc
|
||||
${RM} -f SparcV9CodeEmitter.inc
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/Constants.h"
|
||||
#include "llvm/DerivedTypes.h"
|
||||
#include <stdlib.h>
|
||||
#include "Config/stdlib.h"
|
||||
|
||||
static const uint32_t MAXLO = (1 << 10) - 1; // set bits set by %lo(*)
|
||||
static const uint32_t MAXSIMM = (1 << 12) - 1; // set bits in simm13 field of OR
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "llvm/Target/TargetOptInfo.h"
|
||||
#include "llvm/Type.h"
|
||||
#include "SparcRegClassInfo.h"
|
||||
#include <sys/types.h>
|
||||
#include "Config/sys/types.h"
|
||||
|
||||
class LiveRange;
|
||||
class UltraSparc;
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "llvm/CodeGen/MachineInstr.h"
|
||||
#include "llvm/Value.h"
|
||||
#include "Support/Statistic.h"
|
||||
#include "Support/Alloca.h"
|
||||
#include "Config/alloca.h"
|
||||
|
||||
namespace {
|
||||
Statistic<>
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "llvm/iOperators.h"
|
||||
#include "llvm/iPHINode.h"
|
||||
#include "llvm/Module.h"
|
||||
#include <stdio.h>
|
||||
#include "Config/stdio.h"
|
||||
|
||||
#define INSERT_LOAD_COUNT
|
||||
#define INSERT_STORE
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "llvm/Module.h"
|
||||
#include "Graph.h"
|
||||
#include <fstream>
|
||||
#include <stdio.h>
|
||||
#include "Config/stdio.h"
|
||||
using std::vector;
|
||||
|
||||
struct ProfilePaths : public FunctionPass {
|
||||
|
@ -11,10 +11,10 @@
|
||||
#include "llvm/Module.h"
|
||||
#include "Support/STLExtras.h"
|
||||
#include "Support/TypeInfo.h"
|
||||
#include <stdio.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#include "Config/stdio.h"
|
||||
#include "Config/sys/resource.h"
|
||||
#include "Config/sys/time.h"
|
||||
#include "Config/unistd.h"
|
||||
#include <set>
|
||||
|
||||
// IncludeFile - Stub function used to help linking out.
|
||||
|
4993
llvm/ltmain.sh
Normal file
4993
llvm/ltmain.sh
Normal file
File diff suppressed because it is too large
Load Diff
101
llvm/mkinstalldirs
Executable file
101
llvm/mkinstalldirs
Executable file
@ -0,0 +1,101 @@
|
||||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Public domain
|
||||
|
||||
# $Id$
|
||||
|
||||
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
|
@ -11,8 +11,8 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "Support/CommandLine.h"
|
||||
#include <dlfcn.h>
|
||||
#include <link.h>
|
||||
#include "Config/dlfcn.h"
|
||||
#include "Config/link.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace {
|
||||
|
@ -32,7 +32,7 @@ static const int *KillSigsEnd = KillSigs + sizeof(KillSigs)/sizeof(KillSigs[0]);
|
||||
|
||||
|
||||
// SignalHandler - The signal handler that runs...
|
||||
static void SignalHandler(int Sig) {
|
||||
static RETSIGTYPE SignalHandler(int Sig) {
|
||||
while (!FilesToRemove.empty()) {
|
||||
std::remove(FilesToRemove.back().c_str());
|
||||
FilesToRemove.pop_back();
|
||||
|
@ -10,12 +10,12 @@
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include "Config/sys/types.h"
|
||||
#include "Config/sys/stat.h"
|
||||
#include "Config/fcntl.h"
|
||||
#include "Config/sys/wait.h"
|
||||
#include "Config/unistd.h"
|
||||
#include "Config/errno.h"
|
||||
|
||||
/// removeFile - Delete the specified file
|
||||
///
|
||||
|
@ -4,15 +4,16 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "Config/malloc.h"
|
||||
|
||||
#include "Support/Timer.h"
|
||||
#include "Support/CommandLine.h"
|
||||
#include <sys/resource.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#ifndef __FreeBSD__
|
||||
#include <malloc.h>
|
||||
#endif // __FreeBSD__
|
||||
#include <stdio.h>
|
||||
|
||||
#include "Config/sys/resource.h"
|
||||
#include "Config/sys/time.h"
|
||||
#include "Config/unistd.h"
|
||||
#include "Config/malloc.h"
|
||||
#include "Config/stdio.h"
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
@ -21,10 +22,12 @@
|
||||
std::string LibSupportInfoOutputFilename;
|
||||
|
||||
namespace {
|
||||
#ifdef HAVE_MALLINFO
|
||||
cl::opt<bool>
|
||||
TrackSpace("track-memory", cl::desc("Enable -time-passes memory "
|
||||
"tracking (this may be slow)"),
|
||||
cl::Hidden);
|
||||
#endif
|
||||
|
||||
cl::opt<std::string, true>
|
||||
InfoOutputFilename("info-output-file",
|
||||
@ -76,12 +79,12 @@ Timer::~Timer() {
|
||||
}
|
||||
|
||||
static long getMemUsage() {
|
||||
#ifndef __FreeBSD__
|
||||
#ifdef HAVE_MALLINFO
|
||||
if (TrackSpace) {
|
||||
struct mallinfo MI = mallinfo();
|
||||
return MI.uordblks/*+MI.hblkhd*/;
|
||||
}
|
||||
#endif // __FreeBSD__
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -25,4 +25,4 @@ test:: $(TOOLEXENAME_G) sample.gr
|
||||
$(TOOLEXENAME_G) -I sample.gr -o tmp && cmp tmp sample.c
|
||||
$(TOOLEXENAME_G) -I -O0 <sample.gr >tmp && cmp tmp sample.c
|
||||
$(TOOLEXENAME_G) -I -= <sample.gr >tmp && cmp tmp sample.c
|
||||
rm -f tmp sample.c
|
||||
$(RM) -f tmp sample.c
|
||||
|
@ -6,6 +6,13 @@ USEDLIBS = support.a
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
||||
|
||||
#
|
||||
# Make the source file depend on the header file. In this way, dependencies
|
||||
# (which depend on the source file) won't get generated until bison is done
|
||||
# generating the C source and header files for the parser.
|
||||
#
|
||||
FileLexer.cpp: FileParser.h
|
||||
|
||||
clean::
|
||||
-rm -f FileParser.cpp FileParser.h FileLexer.cpp CommandLine.cpp
|
||||
-rm -f FileParser.output
|
||||
|
@ -10,12 +10,12 @@
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include "Config/sys/types.h"
|
||||
#include "Config/sys/stat.h"
|
||||
#include "Config/fcntl.h"
|
||||
#include "Config/sys/wait.h"
|
||||
#include "Config/unistd.h"
|
||||
#include "Config/errno.h"
|
||||
|
||||
/// removeFile - Delete the specified file
|
||||
///
|
||||
|
@ -3,7 +3,7 @@ TOOLNAME = lli
|
||||
PARALLEL_DIRS = Interpreter JIT
|
||||
|
||||
# Get the config name...
|
||||
include $(LEVEL)/Makefile.$(shell uname)
|
||||
include $(LEVEL)/Makefile.config
|
||||
|
||||
# Generic JIT libraries
|
||||
JITLIBS = lli-jit codegen
|
||||
|
Loading…
Reference in New Issue
Block a user