This repository was archived by the owner on Jul 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstallqtlib
More file actions
executable file
·264 lines (230 loc) · 7.65 KB
/
installqtlib
File metadata and controls
executable file
·264 lines (230 loc) · 7.65 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
#!/bin/csh -f
# Script to add Qt libraries and links to a distribution file, and copy other
# files as needed for particular system
#
# $Id$
#
# get the install directory
#
set instdir = `sed -n '/INSTDIR/s/^.*= *//p' configure`
# Copy Qt plugins to imodplug since it is present everywhere
#
@ plugnum = 1
while ($plugnum < 100)
set plugdir = `sed -n "/QTPLUG_SRCDIR$plugnum/s/^.*= *//p" configure`
if ("$plugdir" == "") break
set pluglist = `sed -n "/QTPLUGS_TOCOPY$plugnum/s/^.*= *//p" configure`
foreach i ($pluglist)
if (-e $QTDIR/plugins/$plugdir/$i) then
mkdir -p $instdir/lib/imodplug/$plugdir
\cp $QTDIR/plugins/$plugdir/$i $instdir/lib/imodplug/$plugdir
chmod -R 755 $instdir/lib/imodplug/$plugdir
endif
end
@ plugnum++
end
if ($#argv > 0) then
if ("$argv[1]" == '-p') exit 0
echo "The only allowed argument is '-p' to install Qt plugins only"
exit 1
endif
#
# Get list of install files and copy them to install directory
#
set instlist = `sed -n '/INSTALL_FILES/s/^.*= *//p' configure`
if ("$instlist" != "") then
foreach i ($instlist)
\cp dist/$i $instdir
end
endif
#
# Get list of install files that need renaming and copy them to install directory
#
set instlist = `sed -n '/INSTALL_RENAME/s/^.*= *//p' configure`
while ($#instlist > 1)
\cp dist/$instlist[1] $instdir/$instlist[2]
shift instlist
shift instlist
end
# Get list that need renaming to be called through wrappers for Vista UAC
# Scripts must already have the final name in order for .cmd wrapper to work
#
set wraplist = `sed -n '/UAC_WRAPPERS/s/^.*= *//p' configure`
while ($#wraplist > 1)
set fromname = $instdir/bin/$wraplist[1]
set toname = $instdir/bin/$wraplist[2]
\mv $fromname.exe $toname.exe
shift wraplist
shift wraplist
end
# Get the subdirectory to copy the libraries to
#
set qtlibdir = `sed -n '/QTINSTLIBDIR/s/^.*= *//p' configure`
if ($#qtlibdir == 0) set qtlibdir = ""
# Copy Qt assistant to this location, or to bin if not defined
#
set assistdir = $qtlibdir
if ($assistdir == "") set assistdir = bin
if (! -e $instdir/$assistdir) mkdir -p $instdir/$assistdir
# Qt assistant could be an exe or a .app directory
#
set assistname = `\find $QTDIR/bin -maxdepth 1 -name 'assistant' -print`
if ("$assistname" == "") set assistname = `\find $QTDIR/bin -maxdepth 1 -name '[Aa]ssistant.app' -print`
if ("$assistname" == "") set assistname = `\find $QTDIR/bin -maxdepth 1 -name 'assistant.exe' -print`
if ("$assistname" != "") then
\cp -RL $assistname $instdir/$assistdir
else
echo "Qt Assistant not found in $QTDIR/bin"
exit 1
endif
# For Mac, we can no longer use a wrapper script since Assistant won't terminate
# through it, but we need to know where the executable is
#
if (-e $instdir/qtlib) then
set app = `\find $instdir/qtlib -name '*ssistant.app' -print`
if ("$app" != "") set assistdir = $assistdir/Assistant.app/Contents/MacOS
endif
# Now that the location of assistant executable is known, copy the SQL plugin
set plugdir = `sed -n "/QTSQL_SRCDIR/s/^.*= *//p" configure`
set sqlplug = `sed -n "/QTSQL_TOCOPY/s/^.*= *//p" configure`
set assistplug = $instdir/$assistdir/plugins/$plugdir
mkdir -p $assistplug
if (-e $QTDIR/plugins/$plugdir/$sqlplug) then
\cp $QTDIR/plugins/$plugdir/$sqlplug $assistplug
chmod -R 755 $assistplug
endif
# Get a DLL destination dir
#
set dlldestdir = `sed -n '/DLLDESTDIR/s/^.*= *//p' configure`
set dlldestorig = $dlldestdir
if ("$dlldestdir" == "") set dlldestdir = $qtlibdir
# Done if no destination location defined
#
if ($dlldestdir == "") exit 0
# Get the dynamic library extension, which can be recursively defined
#
set libext = `sed -n '/^LIBEXT.*=/s/^.*= *//p' configure`
set dllext = `sed -n '/^DLLEXT.*=/s/^.*= *//p' configure | sed "/.*LIBEXT.*/s//$libext/"`
set dllrenlist = `sed -n "/DLLSTORENAME/s/^.*= *//p" configure`
#
# Copy DLL's from various places to the install directory
#
@ dllnum = 1
while ($dllnum < 100)
set dlldir = `sed -n "/DLLSOURCEDIR$dllnum/s/^.*= *//p" configure`
set dlllist = `sed -n "/DLLSTOCOPY$dllnum/s/^.*= *//p" configure`
if ("$dlllist" != "") then
foreach i ($dlllist)
\cp -R "$dlldir"/$i.*$dllext* $instdir/$dlldestdir
end
else
break
endif
@ dllnum++
end
if ("$dllrenlist" != "") then
pushd $instdir/$dlldestdir
foreach i ($dllrenlist)
foreach j (${i}*)
\mv $j imod-$j
end
end
popd
endif
# If the destination dir was qtlib, then all programs need wrapper scripts
#
if ("$dlldestorig" == "qtlib") then
pushd $instdir/bin
set envar = LD_LIBRARY_PATH
if ("$dllext" == "dylib") set envar = DYLD_LIBRARY_PATH
mkdir -p realbin
foreach i (*)
file $i | grep '\-bit.*executable\|Mach-O.*executable' >& /dev/null
if (! $status) then
mv $i realbin
cat << EOF > $i
#!/bin/sh
export ${envar}="\${IMOD_DIR}/qtlib:\${IMOD_DIR}/lib:\$$envar"
"\$IMOD_DIR/bin/realbin/$i" "\$@"
EOF
chmod a+rx $i
endif
end
# Fix 3dmodv link to have its own script with the -view option
#
if (-l 3dmodv) then
rm 3dmodv
sed '/mod\" \"/s/ / -view /' < 3dmod >! 3dmodv
chmod a+rx 3dmodv
endif
popd
endif
# Now done if no Qt library location defined
#
if ($qtlibdir == "") exit 0
# Make directory, copy the real file, make the links
#
if (! -e $instdir/$qtlibdir) mkdir -p $instdir/$qtlibdir
#
# Get names of libs to copy
#
set qtlibs = `sed -n '/QTLIBSTOCOPY/s/^.*= *//p' configure`
# Get source for Qt libs if any
#
set qtlibsrc = `sed -n '/QTLIBSRC/s/^.*= *//p' configure`
if ("$qtlibsrc" == "") set qtlibsrc = $QTDIR/lib
# If the library goes to bin, it is Windows and need to copy a dll
# First get rid of any lib's that installed into the bin with the dll's
#
if ($qtlibdir == "bin") then
\find $instdir/$qtlibdir -name '*.lib' -print -exec \rm '{}' \;
foreach i ($qtlibs)
\cp $qtlibsrc/${i}4.dll $instdir/$qtlibdir
if ($status) then
echo "INSTALLQTLIB CANNOT FIND LIBRARY ${i}4.dll IN $qtlibsrc"
exit 1
endif
end
# 6/25/04: discovered these were not coming through right, and it matters
# 3/13/09: also need u+w, so just do 755
chmod 755 $instdir/$qtlibdir/*.dll $instdir/$qtlibdir/assistant*
# Now copy redistributable directory and install manifests
#
if ($?MSVCREDIST) then
set manifest = `sed -n '/MANIFEST/s/^.*= *//p' configure`
set redist = "$MSVCREDIST:t"
\cp -R "$MSVCREDIST" $instdir/bin
chmod -R 755 $instdir/bin/$redist
foreach i ($instdir/bin/*.exe)
if ("$i:t" != $assistname) then
set icyg = `cygpath -w $i`
set errout = `mt "-outputresource:$icyg;#1" -manifest $manifest`
set errstat = $status
if ($errstat) then
\echo "Error code $errstat running: mt -outputresource:$icyg;#1 -manifest $manifest"
echo "$errout"
exit 1
endif
endif
end
endif
exit 0
endif
#
# Mac and Linux: add lib to front of name
#
foreach i ($qtlibs)
if (-d $qtlibsrc/$i.framework) then
# A Framework
cp -R $qtlibsrc/$i.framework $instdir/$qtlibdir
\find $instdir/$qtlibdir/$i.framework -depth -name Headers -exec \rm -rf '{}' \;
else
set files = `\find $qtlibsrc -maxdepth 1 -name "lib${i}*${dllext}*" -print | grep -v debug`
if ("$files" == "") then
echo "INSTALLQTLIB CANNOT FIND ANY lib${i}.${dllext} in $qtlibsrc"
exit 1
endif
\cp -R $files $instdir/$qtlibdir
endif
end
exit 0