Debian Codegraph @

configure

raw
1 #!/bin/bash
2
3 if [ $1 == "--help" ]; then
4 echo "Usage: configure lua51"
5 echo "where lua51 is the name of your Lua executable"
6 exit 0
7 fi
8
9 echo "Trying to find where you installed Lua..."
10
11 if [ $1 != "" ]; then
12 lua=$1
13 else
14 lua="lua51"
15 fi
16
17 lua_bin=`which $lua`
18 lua_bin_dir=`dirname $lua_bin`
19
20 lua_root=`dirname $lua_bin_dir`
21
22 if [ $lua_root != "" ]; then
23 echo "Lua is in $lua_root"
24 echo "Writing config"
25 lua_share=$lua_root/share/lua/5.1
26 lua_lib=$lua_root/lib/lua/5.1
27 bin_dir=$lua_root/bin
28 echo "LUA_BIN= $lua_bin" > config
29 echo "LUA_DIR= $lua_share" >> config
30 echo "BIN_DIR= $bin_dir" >> config
31 echo "LUA_LIBDIR= $lua_lib" >> config
32 echo "Now run 'make && sudo make install'"
33 else
34 echo "Lua not found, please install Lua 5.1 (and put in your PATH)"
35 fi
36