Skip to content

Commit

Permalink
improving install script
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.code.sf.net/p/canvasdraw/cd/trunk@510 86f90930-8b5f-43f8-b0d1-9726248d827e
  • Loading branch information
scuri committed Apr 25, 2015
1 parent 1bb053b commit 2f4725d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cd/LINSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ INSTALL for CD on Linux

To install the development files (includes and static libraries), run the "install_dev" script.

To configure the run time libraries as Lua modules, run the "config_lua_module" script.
To configure the run time libraries as Lua modules, run the "config_lua_module" script. This needs to be used only if the Lua modules have 51/52/.. suffixes. The script is pre-configured for Lua 5.1, to use it for other Lua versions define USE_LUA52=Yes, or USE_LUA53=Yes.

All scripts don't need parameters. They need root privileges. If they fail check the Guide at the documentation.

Expand Down
10 changes: 5 additions & 5 deletions cd/config_lua_module
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#!/bin/bash

#Current Lua Version
LUA_VER=5.1
LUA_PFX=51

# Include TEC_UNAME definitions
source tec_uname
source ./tec_uname

echo ' '
echo ' This script will configure the Tecgraf libraries in the system'
echo ' to be used from Lua. It was tested in Ubuntu and in Fedora.'
echo ' '
echo ' The current Lua version is defined by the variables:'
echo ' USE_LUA51 (default) or USE_LUA52 or USE_LUA52'
echo ' '
echo ' The Run Time libraries must be already installed on the system (see the install script).'
echo ' It assumes that Lua binaries are installed using system packages.'
echo ' '
Expand All @@ -26,6 +25,7 @@ Make_Lua_Link()

# From tec_uname script
ComputeTecUname
ComputeLuaVersion
ComputeSystemPaths
#PrintInfo

Expand Down
28 changes: 26 additions & 2 deletions cd/tec_uname
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,37 @@ ComputeSystemPaths()
TEC_SYSTEM_INC=/usr/include

if [ $TEC_SYSNAME == Haiku ]; then
TEC_SYSTEM_LIB=`finddir B_SYSTEM_LIB_DIRECTORY`
TEC_SYSTEM_INC=`finddir B_SYSTEM_HEADERS_DIRECTORY`
TEC_SYSTEM_LIB=`finddir B_SYSTEM_LIB_DIRECTORY`
TEC_SYSTEM_INC=`finddir B_SYSTEM_HEADERS_DIRECTORY`
fi

TEC_LUA_LIB=$TEC_SYSTEM_LIB/lua/$LUA_VER
}

ComputeLuaVersion()
{
if [ -n "$USE_LUA51" ]; then
LUA_VER=5.1
LUA_SFX=51
fi

if [ -n "$USE_LUA52" ]; then
LUA_VER=5.2
LUA_SFX=52
fi

if [ -n "$USE_LUA53" ]; then
LUA_VER=5.3
LUA_SFX=53
fi

# Default Lua version
if [ -z "$LUA_VER" ]; then
LUA_VER=5.1
LUA_SFX=51
fi
}

PrintInfo()
{
echo ' '
Expand Down

0 comments on commit 2f4725d

Please sign in to comment.