blob: 3c25ae7e8a489103bb1051b6bd0f6fdef7555858 [file] [log] [blame]
# install script
# This file was developed by Reid Spencer and is distributed under the
# University of Illinois Open Source License. See LICENSE.TXT for details.
# This script allows easier installation of LLVM modules. Just specify the names
# of the modules on the command line and they and their dependencies will be
# checked out, built and installed. Use PREFIX= to specify where the modules
# should be installed. See the README.txt file.
# Get the shell function library.
if test ! -z "$LLVM_TOP" ; then
if test -f "$LLVM_TOP/" ; then
. "$LLVM_TOP/"
echo "Your LLVM_TOP variable is not set to an llvm-top directory"
exit 1
elif test -f ./ ; then
. ./
elif test -f ../ ; then
. ../
echo Please run $0 from the llvm-top directory or a module directory.
exit 1
# Get the list of modules to install.
process_arguments "$@"
# Now find out what those modules depend on
get_module_dependencies $MODULES
# Now go run the install command for each of those modules, which are nicely
# sorted in dependence order by get_module_dependencies
for mod in $MODULE_DEPENDENCIES ; do
get_module_info $mod InstallCmd
if test ! -z "$TheCommand" ; then
msg 1 Installing module $mod
cd $LLVM_TOP/$mod
msg 2 Install command for "$mod" is "$TheCommand"
$TheCommand || die $? "Install of module $mod failed."
msg 2 Module $mod has no InstallCmd in the ModuleInfo.txt
# Report what happened.
msg 1 Modules installed: "$MODULE_DEPENDENCIES".