diff --git a/build_opts.sh b/build_opts.sh index 274285e..2aea6c1 100644 --- a/build_opts.sh +++ b/build_opts.sh @@ -2,17 +2,19 @@ LLVM_PATH=`llvm-config --src-root` LIBOBJC_PATH=`pwd` if [ x$LLVM_PATH != x ] ; then - cd $LLVM_PATH - cd lib/Transforms - if [ ! -d GNURuntime ] ; then - mkdir GNURuntime - fi - cd GNURuntime - for I in `ls $LIBOBJC_PATH/opts/` ; do - if [ ! $I -nt $LIBOBJC_PATH/opts/$I ] ; then - cp $LIBOBJC_PATH/opts/$I . + if [ -d $LLVM_PATH ] ; then + cd $LLVM_PATH + cd lib/Transforms + if [ ! -d GNURuntime ] ; then + mkdir GNURuntime fi - done - $1 $2 - cd .. + cd GNURuntime + for I in `ls $LIBOBJC_PATH/opts/` ; do + if [ ! $I -nt $LIBOBJC_PATH/opts/$I ] ; then + cp $LIBOBJC_PATH/opts/$I . + fi + done + $1 $2 + cd .. + fi fi