#! /bin/bash PROJECT=libcxx # Available sub-projects. AVAILABLE_PROJECTS=( libcxx libcxxabi libunwind ) # Enabled sub-projects. PROJECTS=( libcxx libcxxabi libunwind ) # Additional options (see functions sources below). # Options followed by a ':' require an argument, by '::' allow an optional argument. SHORT_OPTIONS= # Long options are not available with BSD getopt. LONG_OPTIONS= # Help for additional options usage() { # option h "help" "display this help and exit" return } # Find the directory containing this script. source="${BASH_SOURCE[0]}" while [ -h "${source}" ] ; do SCRIPTS="$(cd -P "$(dirname "${source}")" && pwd)" source="$(readlink "${source}")" [[ ${source} != /* ]] && source="$DIR/${source}" done SCRIPTS="$(cd -P "$(dirname "${source}")" && pwd)" # Get support functions and definitions. source ${SCRIPTS}/support # Check for needed libraries. check_libraries() { return 0 } # Projects. libcxx="${SRCTOP} http://llvm.org/svn/llvm-project/libcxx/trunk libcxx svn" libcxxabi="${PROJECTDIR} http://llvm.org/svn/llvm-project/libcxxabi/trunk libcxxabi svn" libunwind="${PROJECTDIR} http://llvm.org/svn/llvm-project/libunwind/trunk libunwind svn" configure() { # Configure checkout out projects. return 0 } build() { run check_checkout run check_libraries run mkdir -p ${BUILDDIR} run INSTALLDIR=${LOCALLIB} PROJECTDIR=${PROJECTDIR} \ CC="${CC}" CFLAGS="${CFLAGS}" CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \ ARCH=$(getmachinearch ${TARGETTUPLE}) LIBNAME=c++ \ ${MAKE} -j ${MAXJOBS} -C ${BUILDDIR} -f ${PROJECTDIR}/src/Makefile } install() { run check_checkout run check_configure run mkdir -p ${LOCALLIB} run LOCALLIBECC=${LOCALLIBECC} LOCALLIB=${LOCALLIB} PROJECTDIR=${PROJECTDIR} \ CC="${CC}" CFLAGS="${CFLAGS}" CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \ ARCH=$(getmachinearch ${TARGETTUPLE}) LIBNAME=c++ \ ${MAKE} -j ${MAXJOBS} -C ${BUILDDIR} -f ${PROJECTDIR}/src/Makefile install } tests() { # Run regression tests. run ${MAKE} -j ${MAXJOBS} -C ${BUILDDIR} check } if [ "${CHECKOUT}" == "y" ] ; then checkout || exit 1 fi if [ "${CONFIGURE}" == "y" ] ; then configure || exit 1 fi if [ "${UPDATE}" == "y" ] ; then update || exit 1 fi if [ "${PATCH}" == "y" ] ; then patch || exit 1 fi if [ "${CREATE_PATCH}" == "y" ] ; then create_patch || exit 1 fi if [ "${BUILD}" == "y" ] ; then build || exit 1 fi if [ "${TESTS}" == "y" ] ; then tests || exit 1 fi if [ "${INSTALL}" == "y" ] ; then install || exit 1 fi