-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup
executable file
·87 lines (68 loc) · 2.42 KB
/
setup
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
#!/QOpenSys/usr/bin/sh
export PWD=$(pwd)
MODULES="STOMP STOMPCMD STOMPFRAME STOMPPARSE STOMPEXT STOMPUTIL STOMPEXTAQ"
#
# set the target lib to OSSILE if nothing else is specified
#
if [[ $TARGET_LIB == "" ]] ; then
TARGET_LIB=OSSILE
fi
#
# compilation steps
#
for MODULE in $MODULES
do
STREAMFILE=$(echo $MODULE | tr '[:upper:]' '[:lower:]')
STREAMFILE=$STREAMFILE.rpgle
if [ -e /QSYS.LIB/$TARGET_LIB.LIB/$MODULE.MODULE ] ; then
system -kpieb "DLTOBJ OBJ($TARGET_LIB/$MODULE) OBJTYPE(*MODULE)"
fi
system -kpieb "CRTRPGMOD $TARGET_LIB/$MODULE SRCSTMF('$STREAMFILE') INCDIR('$INCDIR') OPTION(*SRCSTMT) DBGVIEW(*LIST) OPTIMIZE(*BASIC) STGMDL(*INHERIT)"
done
#
# binding
#
if [ -e /QSYS.LIB/$TARGET_LIB.LIB/STOMP.FILE ] ; then
system -kpieb "DLTOBJ OBJ($TARGET_LIB/STOMP) OBJTYPE(*FILE)"
fi
system -kpieb "CRTSRCPF FILE($TARGET_LIB/STOMP) RCDLEN(112)"
system -kpieb "CPYFRMSTMF FROMSTMF('$PWD/stomp.bnd') TOMBR('/QSYS.LIB/$TARGET_LIB.LIB/STOMP.FILE/STOMP.MBR') MBROPT(*REPLACE)"
if [ -e /QSYS.LIB/$TARGET_LIB.LIB/STOMP.SRVPGM ] ; then
system -kpieb "DLTOBJ OBJ($TARGET_LIB/STOMP) OBJTYPE(*SRVPGM)"
fi
system -kpieb "CRTSRVPGM $TARGET_LIB/STOMP MODULE($TARGET_LIB/STOMP $TARGET_LIB/STOMPCMD $TARGET_LIB/STOMPFRAME $TARGET_LIB/STOMPPARSE $TARGET_LIB/STOMPUTIL $TARGET_LIB/STOMPEXT $TARGET_LIB/STOMPEXTAQ) STGMDL(*INHERIT) BNDSRVPGM($TARGET_LIB/MESSAGE $TARGET_LIB/LLIST $TARGET_LIB/LIBTREE $TARGET_LIB/REFLECTION $TARGET_LIB/LOG4RPG) EXPORT(*SRCFILE) SRCFILE($TARGET_LIB/STOMP) TEXT('STOMP Client')"
#
# cleanup
#
if [ -e /QSYS.LIB/$TARGET_LIB.LIB/STOMP.FILE ] ; then
system -kpieb "DLTOBJ OBJ($TARGET_LIB/STOMP) OBJTYPE(*FILE)"
fi
for MODULE in $MODULES
do
if [ -e /QSYS.LIB/$TARGET_LIB.LIB/$MODULE.MODULE ] ; then
system -kpieb "DLTOBJ OBJ($TARGET_LIB/$MODULE) OBJTYPE(*MODULE)"
fi
done
#
# check if service program has been created
#
if [ ! -e /QSYS.LIB/$TARGET_LIB.LIB/STOMP.SRVPGM ] ; then
exit 5
fi
#
# copy copybook to OSSILE include directory if is is specified and does exist
#
if [[ $INCDIR != "" ]] ; then
if [[ ! -e $INCDIR ]] ; then
echo "include directory $INCDIR does not exist"
else
if [ ! -e $INCDIR/stomp ] ; then
mkdir $INCDIR/stomp
fi
cp $PWD/stomp_h.rpgle $INCDIR/stomp/
cp $PWD/stompcmd_h.rpgle $INCDIR/stomp/
cp $PWD/stompext_amq_h.rpgle $INCDIR/stomp/
cp $PWD/stompext_h.rpgle $INCDIR/stomp/
cp $PWD/stompframe_h.rpgle $INCDIR/stomp/
fi
fi