︙ | | | ︙ | |
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
PATCHDIR="$(pwd)/patches"
OUTDIR="$(pwd)/out"
INSTDIR="$(pwd)/inst"
PATCHSCRIPTDIR="$(pwd)/patchscripts"
export SRC SRCURL BUILDDIR PATCHDIR OUTDIR INSTDIR PATCHSCRIPTDIR
# Set configure options for this sub-project
LDFLAGS="${KC_TK_LDFLAGS}"
CFLAGS="${KC_TK_CFLAGS}"
CPPFLAGS="${KC_TK_CPPFLAGS}"
LIBS="${KC_TK_LIBS}"
export LDFLAGS CFLAGS CPPFLAGS LIBS
# Must be kept in-sync with "../tcl/build.sh"
TCLFOSSILDATE="../tcl/src/tcl${TCLVERS}.tar.gz.date"
export TCLFOSSILDATE
rm -rf 'build' 'out' 'inst'
|
|
|
|
|
|
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
PATCHDIR="$(pwd)/patches"
OUTDIR="$(pwd)/out"
INSTDIR="$(pwd)/inst"
PATCHSCRIPTDIR="$(pwd)/patchscripts"
export SRC SRCURL BUILDDIR PATCHDIR OUTDIR INSTDIR PATCHSCRIPTDIR
# Set configure options for this sub-project
LDFLAGS="${LDFLAGS} ${KC_TK_LDFLAGS}"
CFLAGS="${CFLAGS} ${KC_TK_CFLAGS}"
CPPFLAGS="${CPPFLAGS} ${KC_TK_CPPFLAGS}"
LIBS="${LIBS} ${KC_TK_LIBS}"
export LDFLAGS CFLAGS CPPFLAGS LIBS
# Must be kept in-sync with "../tcl/build.sh"
TCLFOSSILDATE="../tcl/src/tcl${TCLVERS}.tar.gz.date"
export TCLFOSSILDATE
rm -rf 'build' 'out' 'inst'
|
︙ | | | ︙ | |
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
echo "Running patch script: ${patchscript}"
(
. "${patchscript}"
)
fi
done
for dir in "${TCLCONFIGDIRTAIL}" unix win macosx win64 __fail__; do
if [ -z "${dir}" ]; then
continue
fi
if [ "${dir}" = "__fail__" ]; then
|
>
>
>
>
>
>
|
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
echo "Running patch script: ${patchscript}"
(
. "${patchscript}"
)
fi
done
# Allow wrapper programs to supplant real programs
if [ -d 'fake-bin' ]; then
PATH="$(pwd)/fake-bin:${PATH}"
export PATH
fi
for dir in "${TCLCONFIGDIRTAIL}" unix win macosx win64 __fail__; do
if [ -z "${dir}" ]; then
continue
fi
if [ "${dir}" = "__fail__" ]; then
|
︙ | | | ︙ | |
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
cd "${BUILDDIR}/${dir}" || exit 1
# Remove broken pre-generated Makfiles
rm -f GNUmakefile Makefile makefile
if [ "${dir}" = "win" ]; then
# Statically link Tk to Tclkit if we are compiling for
# Windows
STATICTK="1"
if [ "${win64}" = "1" ]; then
# Mingw32 for AMD64 requires this, apparently
CPPFLAGS="${CPPFLAGS} -D_WIN32_IE=0x0501"
CFLAGS="${CFLAGS} -D_WIN32_IE=0x0501"
export CPPFLAGS CFLAGS
fi
|
|
>
|
>
|
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
cd "${BUILDDIR}/${dir}" || exit 1
# Remove broken pre-generated Makfiles
rm -f GNUmakefile Makefile makefile
if [ "${dir}" = "win" ]; then
# Statically link Tk to Tclkit if we are compiling for
# Windows unless otherwise requested
if [ -z "${STATICTK}" ]; then
STATICTK="1"
fi
if [ "${win64}" = "1" ]; then
# Mingw32 for AMD64 requires this, apparently
CPPFLAGS="${CPPFLAGS} -D_WIN32_IE=0x0501"
CFLAGS="${CFLAGS} -D_WIN32_IE=0x0501"
export CPPFLAGS CFLAGS
fi
|
︙ | | | ︙ | |
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
|
# If we are building statically, don't create a
# pkgIndex.tcl
rm -f "${INSTDIR}"/lib/tk*/pkgIndex.tcl
else
# Update pkgIndex to load libtk from the local directory rather
# than the parent directory
for pkgIndex in "${INSTDIR}"/lib/tk*/pkgIndex.tcl; do
sed 's@ \.\. @ @g' "${pkgIndex}" > "${pkgIndex}.new"
mv "${pkgIndex}.new" "${pkgIndex}"
done
fi
mkdir "${OUTDIR}/lib" || exit 1
cp -r "${INSTDIR}/lib"/tk* "${OUTDIR}/lib/"
cp -r "${INSTDIR}/lib"/libtk* "${OUTDIR}/lib"/tk*/
rm -rf "${OUTDIR}/lib"/tk*/demos
"${STRIP:-strip}" -g "${OUTDIR}"/lib/tk*/*.so >/dev/null 2>/dev/null
find "${OUTDIR}" -type f -name '*.a' | xargs rm -f >/dev/null 2>/dev/null
break
done
exit 0
) || exit 1
exit 0
|
|
>
|
>
>
>
>
>
|
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
# If we are building statically, don't create a
# pkgIndex.tcl
rm -f "${INSTDIR}"/lib/tk*/pkgIndex.tcl
else
# Update pkgIndex to load libtk from the local directory rather
# than the parent directory
for pkgIndex in "${INSTDIR}"/lib/tk*/pkgIndex.tcl; do
sed 's@ \.\. bin @ @g;s@ \.\. @ @;s@ lib\(tk.*\.dll\)@ \1@' "${pkgIndex}" > "${pkgIndex}.new"
mv "${pkgIndex}.new" "${pkgIndex}"
done
fi
mkdir "${OUTDIR}/lib" || exit 1
cp -r "${INSTDIR}/lib"/tk* "${OUTDIR}/lib/"
cp -r "${INSTDIR}/bin"/tk*.dll "${OUTDIR}/lib/"/tk*/
cp -r "${INSTDIR}/lib"/libtk* "${OUTDIR}/lib"/tk*/
rm -rf "${OUTDIR}/lib"/tk*/demos
"${STRIP:-strip}" -g "${OUTDIR}"/lib/tk*/*.{so,dll,dylib,shlib} >/dev/null 2>/dev/null
find "${OUTDIR}" -type f -name '*.a' | xargs rm -f >/dev/null 2>/dev/null
# If we have a shared object, delete static libraries
if find "${INSTDIR}" -type f '(' -name '*.dll' -o -name '*.so' -o -name '*.dylib' -o -name '*.shlib' ')' 2>/dev/null | grep '^' >/dev/null; then
find "${INSTDIR}" -type f -name '*.a' | grep -v 'stub' | xargs rm -f
fi
break
done
exit 0
) || exit 1
exit 0
|