1 #!/bin/bash -e 2 3 source version 4 5 # Copy binaries 6 for b in bin/*; do 7 file=`basename $b` 8 # Don't copy symlinks like clang++ or directories 9 if test -h $b || test -d $b; then 10 echo Skipping $file 11 else 12 echo Copying $file 13 cp -a `find ${ANDROID_HOST_OUT}/bin -name $file` $b 14 strip $b 15 fi 16 done 17 18 # Copy license files. 19 # Need to make sure we get all the MODULE_LICENSE_* files used and concatenate 20 # all the NOTICE files (all of which differ slightly). 21 cp -a ${ANDROID_BUILD_TOP}/external/clang/MODULE_LICENSE_* . 22 cp -a ${ANDROID_BUILD_TOP}/external/llvm/MODULE_LICENSE_* . 23 cp -a ${ANDROID_BUILD_TOP}/external/compiler-rt/MODULE_LICENSE_* . 24 cp -a ${ANDROID_BUILD_TOP}/external/libcxx/MODULE_LICENSE_* . 25 cp -a ${ANDROID_BUILD_TOP}/external/libcxxabi/MODULE_LICENSE_* . 26 27 cp -a ${ANDROID_BUILD_TOP}/external/clang/NOTICE . 28 echo >> NOTICE 29 cat ${ANDROID_BUILD_TOP}/external/llvm/NOTICE >> NOTICE 30 echo >> NOTICE 31 cat ${ANDROID_BUILD_TOP}/external/libcxx/NOTICE >> NOTICE 32 echo >> NOTICE 33 cat ${ANDROID_BUILD_TOP}/external/libcxxabi/NOTICE >> NOTICE 34 echo >> NOTICE 35 cat ${ANDROID_BUILD_TOP}/external/compiler-rt/NOTICE >> NOTICE 36 37 # Copy static analyzer scripts. 38 echo Copying static analyzer tools 39 rm -rf tools/* 40 mkdir -p tools 41 cp -a ${ANDROID_BUILD_TOP}/external/clang/tools/scan-build tools 42 cp -a ${ANDROID_BUILD_TOP}/external/clang/tools/scan-view tools 43 44 # Copy libraries 45 echo Copying libc++.dylib 46 cp -a ${ANDROID_HOST_OUT}/lib/libc++.dylib lib/ 47 cp -a ${ANDROID_HOST_OUT}/lib64/libc++.dylib lib64/ 48 49 # Copy header files 50 rm -rf lib/clang/* 51 mkdir -p lib/clang/${MAJOR}.${MINOR}/include 52 #mkdir -p lib/clang/${MAJOR}.${MINOR}/lib/darwin 53 for i in `find ${ANDROID_BUILD_TOP}/external/clang/lib/Headers -mindepth 1 ! -name \*.mk -a ! -name Makefile -a ! -name CMakeLists.txt`; do 54 echo Copying `basename $i` 55 cp -a $i lib/clang/*/include/ 56 done 57 58 # Copy over stdatomic.h from bionic 59 echo Copying stdatomic.h 60 cp -a ${ANDROID_BUILD_TOP}/bionic/libc/include/stdatomic.h lib/clang/*/include/ 61 62 echo Copying arm_neon.h 63 cp -a `find ${ANDROID_PRODUCT_OUT} -name arm_neon.h | head -n 1` lib/clang/*/include 64 65 # Create symlink for appropriately versioned clang 66 cd lib/clang/ 67 ln -s ${MAJOR}.${MINOR} ${MAJOR}.${MINOR}.${PATCH} 68 cd - 69 70