DEFAULT_HOST_TRIPLE="${CFG_CPUTYPE}-${CFG_OSTYPE}"
-CFG_SELF=$(echo $0 | tr '\\' '/')
-CFG_SRC_DIR="$(dirname $CFG_SELF)/"
-CFG_BUILD_DIR="$(echo $PWD | tr '\\' '/')/"
+CFG_SRC_DIR="$(cd $(dirname $0) && pwd)/"
+CFG_BUILD_DIR="$(pwd)/"
+CFG_SELF=${CFG_SRC_DIR}$(basename $0)
CFG_CONFIGURE_ARGS="$@"
OPTIONS=""
if [ -z $CFG_DISABLE_MANAGE_SUBMODULES ]
then
cd ${CFG_SRC_DIR}
+
msg "git: submodule sync"
- "${CFG_GIT}" submodule sync --quiet
- SUBMODULES=$("${CFG_GIT}" submodule status | awk '{print $2}')
- for s in $SUBMODULES
- do
- msg "git: submodule status ${s}"
- status=$("${CFG_GIT}" submodule status ${s} | awk '{print $1}')
- case ${status} in
- -*)
- msg "${s} is not initialized, initializing"
- "${CFG_GIT}" submodule init --quiet ${s}
- need_ok "git failed"
- msg "${s} updating"
- "${CFG_GIT}" submodule update --quiet ${s}
- need_ok "git failed"
- ;;
- +*)
- msg "${s} is not up to date, updating"
- "${CFG_GIT}" submodule update --quiet ${s}
- need_ok "git failed"
- ;;
- *)
- msg "${s} is clean"
- ;;
- esac
- done
+ "${CFG_GIT}" submodule --quiet sync
+
+ # NB: this is just for the sake of getting the submodule SHA1 values
+ # and status written into the build log.
+ msg "git: submodule status"
+ "${CFG_GIT}" submodule status --recursive
+
+ msg "git: submodule update"
+ "${CFG_GIT}" submodule --quiet update --init --recursive
+ need_ok "git failed"
+
+ msg "git: submodule clobber"
+ "${CFG_GIT}" submodule --quiet foreach --recursive git clean -dxf
+ need_ok "git failed"
+ "${CFG_GIT}" submodule --quiet foreach --recursive git checkout .
+ need_ok "git failed"
+
cd ${CFG_BUILD_DIR}
fi
const Target *TheTarget = TargetRegistry::lookupTarget(triple, Err);
std::string FeaturesStr;
std::string Trip(triple);
- std::string CPUStr = llvm::sys::getHostCPUName();
+ std::string CPUStr("generic");
TargetMachine *Target =
TheTarget->createTargetMachine(Trip, CPUStr, FeaturesStr,
Options, Reloc::PIC_,