-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetupSDL
68 lines (60 loc) · 2.09 KB
/
setupSDL
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
## (Use '. setupSDL')
##----------------------------------------------------------------------------
##
## Copyright (C) 2024 Frank Eskesen.
##
## This file is free content, distributed under the MIT license.
## (See accompanying file LICENSE.MIT or the original contained
## within https://opensource.org/licenses/MIT)
##
##----------------------------------------------------------------------------
##
## Title-
## setupSDL
##
## Purpose-
## Initialize SDL (Software Development Lab) PATH
##
## Last change date-
## 2024/03/28
##
## Usage-
## . setupSDL
##
## Implementation note-
## $SDL_ROOT is only used by Makefiles, but
## $PATH (including ./bat and ./bin) is generally needed.
## './bat' is useful, but can be omitted.
## './bin' (initialized by 'make install') is needed:
## 'filecomp' is needed for regression output testing.
## 'makeproj' is used in Makefiles to build dependency files.
##
##############################################################################
##############################################################################
## Set environment
root=`./bat/.root`
export SDL_ROOT="$root"
. ./bat/f.appendstring ## AppendString and PrependString
##############################################################################
## Update PATH
[ "" != "`uname | grep CYGWIN`" ] && PrependString PATH "$HOME/.local/lib/sdlc++"
PrependString PATH "$SDL_ROOT/bin"
PrependString PATH "$SDL_ROOT/bat"
##############################################################################
## Update LD_LIBRARY_PATH
[ ! -d "$HOME/.local/lib" ] && mkdir -p $HOME/.local/lib
if [ ! -L "$HOME/.local/lib/sdlc++" ] ; then
pushd $HOME/.local/lib >/dev/null 2>&1
ln -s $SDL_ROOT/obj/cpp/lib/shared sdlc++
popd >/dev/null 2>&1
fi
PrependString LD_LIBRARY_PATH "$HOME/.local/lib/sdlc++"
##############################################################################
## Display status
if [ 1 == 2 ] ; then
echo PATH $PATH
echo
echo LD_LIBRARY_PATH $LD_LIBRARY_PATH
echo
echo SDL_ROOT $SDL_ROOT
fi