- ## Check if source root is obj-root by looking for Makefile.config there
- if (-f ${LLVMDIR}/Makefile.config) then
- set OBJROOT = ${LLVMDIR}
- set BUILDROOT = .
- else ## Otherwise assume a default location for OBJROOT
- set OBJROOT = "/localhome/$USER/llvm"
- set SRCROOT = `sh -c "cd $LLVMDIR; pwd | sed 's/\//\\\//g'"`
- set CURSRCDIR = `echo $cwd | sed -e "s/${SRCROOT}//"`
- set BUILDROOT = ${OBJROOT}/${CURSRCDIR}
- unset SRCROOT CURSRCDIR
+ ## Try to determine object root directory by looking for Makefile.config
+ foreach objdir ( $OBJROOTDIRLIST )
+ if (-f "${objdir}/Makefile.config") then
+ set OBJROOT = ${objdir}
+ break
+ endif
+ end
+ if ($?OBJROOT == 0) then
+ echo "FATAL: Could not choose an obj-root directory from these choices:"
+ echo " ${OBJROOTDIRLIST}."
+ echo " You can specify it explicitly using '-obj obj-root'."
+ exit 1