Release coccinelle-0.1.10
[bpt/coccinelle.git] / env.sh
1 # I put both stuff useful for the user and developer in this file. Could
2 # separate and have a env-user.sh, env-compile.sh, env-developer.sh,
3 # but it's not worth it.
4
5 #!!!!You need to source me with "source env.sh" from the good directory!!!!
6
7 # 14 Aug 2009 Try likely locations for support files
8
9 if [ "$1" ] ; then
10 DIR=$1
11 else
12 DIR=`pwd`
13 fi
14
15 if [ ! -r $DIR/standard.iso ]
16 then
17 if [ -r /usr/local/share/coccinelle/standard.iso ]
18 then
19 echo "standard.iso not found in '$DIR' using /usr/local/share/coccinelle"
20 DIR="/usr/local/share/coccinelle"
21 else
22 # The following won't work with "source env.sh" under bash
23 if [ -r `dirname $0`/standard.iso ]
24 then
25 echo "standard.iso not found in '$DIR' using `dirname $0`"
26 DIR=`dirname $0`
27 fi
28 fi
29 fi
30
31 if [ ! -r $DIR/standard.iso ]
32 then echo "standard.iso not found in '$DIR'.
33 Give its directory as the first argument.
34 ";
35 else
36
37
38 ##############################################################################
39 # Compile
40 ##############################################################################
41
42 ##############################################################################
43 # Run
44 ##############################################################################
45
46 # To find the data/ files such as the default standard.h file.
47 # Cf also globals/config.ml
48 echo setting COCCINELLE_HOME=$DIR
49 COCCINELLE_HOME=$DIR ; export COCCINELLE_HOME
50
51 # To find pycaml dynamic library
52 echo adding $COCCINELLE_HOME to LD_LIBRARY_PATH
53 LD_LIBRARY_PATH=$COCCINELLE_HOME:$LD_LIBRARY_PATH ; export LD_LIBRARY_PATH
54
55 # To find .py files like the one in python/coccib
56 echo adding $COCCINELLE_HOME/python to PYTHONPATH
57 PYTHONPATH=$COCCINELLE_HOME/python:PYTHONPATH ; export PYTHONPATH
58
59 fi
60