• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2CXX=$1
3ARGS=${*:2}
4DIR=external/libcxx/buildcmds
5echo $ANDROID_BUILD_TOP/$CXX > $DIR/cxx_under_test
6
7echo $ARGS | grep -P '\S+\.cpp\b' > /dev/null
8if [ $? -eq 0 ]; then
9  echo $ARGS | perl -ne 's/\S+\.cpp\b/%SOURCE%/; print' \
10             | perl -ne 's/\S+\.o\b/%OUT%/; print' > $DIR/cxx.cmds
11else
12  echo $ARGS | perl -ne 's/out\/\S+\/EXECUTABLES\/\S+\.o\b/%SOURCE%/; print' \
13             | perl -ne 's/-o\s+\S+\b/-o %OUT%/; print' > $DIR/link.cmds
14fi
15
16$CXX $ARGS
17