summaryrefslogtreecommitdiff
path: root/odk/setsdkenv_unix
blob: 2953a4b0699b9235a847dcdb9a38c6be7002cb34 (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#! /bin/sh

# This script starts a new shell and sets all enviroment variables, which
# are necessary for building the examples of the Office Development Kit.
# The Script was developed for the operating systems Solaris and Linux.
# Before the script could be executed the following variables have to be
# adjusted:

# Installation directory of the Software Development Kit.
# Example: SDK_HOME=/work/odk641
SDK_HOME=

# Office installation directory.
# Example: OFFICE_HOME=/opt/staroffice6.0
OFFICE_HOME=

# Directory of the make command.
# Example: SDK_MAKE=/usr/bin
SDK_MAKE=

# Directory of the C++ tools.
# Example: SDK_CPP_HOME=/usr/bin
SDK_CPP_HOME=

# Java installation directory.
# Example: SDK_JAVA_HOME=/usr/local/j2sdk1.4.0
SDK_JAVA_HOME=

# Environment variable to enable auto deployment of example components
# Example: SDK_AUTO_DEPLOYMENT=YES
# SDK_AUTO_DEPLOYMENT=YES
# export SDK_AUTO_DELOYMENT


# ANT installation directory.
# Example: SDK_ANT=/windows/daten/moving/jakarta-ant-1.4
# SDK_ANT=


# Check installation path for the StarOffice Development Kit.
if [ -z "$SDK_HOME" ]
then
    echo Error: Please insert a correct value for the variable SDK_HOME.
    exit 0
fi

export SDK_HOME

# Check installation path for the office.
if [ -z "$OFFICE_HOME" ]
then
    echo Error: Please insert a correct value for the variable OFFICE_HOME.
    exit 0
fi

export OFFICE_HOME

# Set library path.
if [ -n "$LD_LIBRARY_PATH" ]
then
    # path not empty: append colon.
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:
fi
LD_LIBRARY_PATH=$LD_LIBRARY_PATH$OFFICE_HOME/program

export LD_LIBRARY_PATH

# Set office program path.
OFFICE_PROGRAM_PATH=$OFFICE_HOME/program

export OFFICE_PROGRAM_PATH

# Get the operating system.
sd_platform=`uname -s`

# Set the directory name.
case $sd_platform in
  SunOS)
    directoryname=solsparc
    exampleout=SOLARISexample.out
    ;;

  Linux)
    directoryname=linux
    exampleout=LINUXexample.out
    ;;
esac

# Add directory of the SDK tools to the path.
#if [ -n "$PATH" ]
#then
    # Path not empty: append colon.
#    PATH=$PATH:
#fi

PATH=$SDK_HOME/$directoryname/bin:$OFFICE_PROGRAM_PATH:$PATH
LD_LIBRARY_PATH=$SDK_HOME/$directoryname/lib:$SDK_HOME/$exampleout/lib:$OFFICE_PROGRAM_PATH:$LD_LIBRARY_PATH

# Add directory of the command make to the path, if necessary.
if [ -n "$SDK_MAKE" ]
then
    PATH=$SDK_MAKE:$PATH

    export SDK_MAKE
fi

# Add directory of the C++ tools to the path, if necessary.
if [ -n "$SDK_CPP_HOME" ]
then
    PATH=$SDK_CPP_HOME:$PATH

    export SDK_CPP_HOME
fi

# Add directory of the Java tools to the path, if necessary.
if [ -n "$SDK_JAVA_HOME" ]
then
    PATH=$SDK_JAVA_HOME/bin:$PATH

    export SDK_JAVA_HOME
fi

# Add directory of the ANT tools to the path, if necessary.
if [ -n "$SDK_ANT" ]
then
    PATH=$SDK_ANT/bin:$PATH

    export SDK_ANT
fi

export PATH

# Starting a new shell with all necessary environment variables.
echo starting shell
"$SHELL" "$@"
echo  shell terminated