Skip to content

Commit

Permalink
Added install-nosudo script
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgutierrez committed Jul 15, 2015
1 parent 1f0d9a7 commit 182c87d
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions install-nosudo
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

cd parser
rm -f *.o *.lo

#Compile lemon
if [ ! -f lemon ]; then
gcc -w lemon.c -o lemon
fi

TEST=`re2c -v`
if [ $? != 2 ]; then
echo "error: re2c is not installed"
exit 2
fi

re2c -o scanner.c scanner.re && ./lemon -s parser.lemon && cat base.c >> parser.c
if [ ! -f parser.c ]; then
echo "error: re2c is not installed"
exit 2
fi

sed s/"\#line"/"\/\/"/g scanner.c > xx && mv -f xx scanner.c
sed s/"#line"/"\/\/"/g parser.c > xx && mv -f xx parser.c
gcc -Wl,-rpath /usr/local/lib -I/usr/local/include -L/usr/local/lib -L/opt/local/lib -g3 -O0 -w parser.c scanner.c -ljson-c -o ../bin/zephir-parser

cd ..

ZEPHIRDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
sed "s#%ZEPHIRDIR%#$ZEPHIRDIR#g" bin/zephir > bin/zephir-cmd
chmod 755 bin/zephir-cmd

if [ ! -d "~/bin" ]; then
mkdir ~/bin
fi

cp bin/zephir-cmd ~/bin/zephir
rm bin/zephir-cmd

0 comments on commit 182c87d

Please sign in to comment.