File: configure

package info (click to toggle)
lua-coxpcall 1.13.0-6
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 128 kB
  • sloc: sh: 28; makefile: 15
file content (36 lines) | stat: -rwxr-xr-x 782 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash

if [ $1 == "--help" ]; then
  echo "Usage: configure lua51"
  echo "where lua51 is the name of your Lua executable"
  exit 0
fi

echo "Trying to find where you installed Lua..."

if [ $1 != "" ]; then
  lua=$1
else
  lua="lua51"
fi

lua_bin=`which $lua`
lua_bin_dir=`dirname $lua_bin`

lua_root=`dirname $lua_bin_dir`

if [ $lua_root != "" ]; then
  echo "Lua is in $lua_root"
  echo "Writing config"
  lua_share=$lua_root/share/lua/5.1
  lua_lib=$lua_root/lib/lua/5.1
  bin_dir=$lua_root/bin
  echo "LUA_BIN= $lua_bin" > config
  echo "LUA_DIR= $lua_share" >> config
  echo "BIN_DIR= $bin_dir" >> config
  echo "LUA_LIBDIR= $lua_lib" >> config
  echo "Now run 'make && sudo make install'"
else
  echo "Lua not found, please install Lua 5.1 (and put in your PATH)"
fi