235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
|
], [
LIBS="${SAVE_LIBS}"
$3
]
)
])
AC_DEFUN(DC_DO_STATIC_LINK_LIB, [
AC_MSG_CHECKING([for how to statically link to $1])
SAVELIBS="${LIBS}"
staticlib=""
found="0"
dnl HP/UX uses -Wl,-a,archive -lstdc++ -Wl,-a,shared_archive
dnl Linux and Solaris us -Wl,-Bstatic ... -Wl,-Bdynamic
for trylink in "-Wl,-a,archive $2 -Wl,-a,shared_archive" "-Wl,-Bstatic $2 -Wl,-Bdynamic" "$2"; do
LIBS="${SAVELIBS} ${trylink}"
AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [
staticlib="${trylink}"
found="1"
break
])
done
if test "${found}" = "1"; then
SAVELIBS=`echo "$SAVELIBS" | sed 's@ $2 @ @'`
LIBS="${SAVELIBS} ${staticlib}"
AC_MSG_RESULT([${staticlib}])
AC_SUBST(LIBS)
$3
else
LIBS="${SAVELIBS}"
AC_MSG_RESULT([cant])
$4
fi
])
AC_DEFUN(DC_DO_STATIC_LINK_LIBCXX, [
dnl Sun Studio uses -lCstd -lCrun, most platforms use -lstdc++
DC_DO_STATIC_LINK_LIB([C++ Library (Sun Studio)], [-lCstd -lCrun],, [
DC_DO_STATIC_LINK_LIB([C++ Library (UNIX)], [-lstdc++])
])
])
AC_DEFUN(DC_FIND_TCLKIT_LIBS, [
DC_SETUP_TCL_PLAT_DEFS
WISH_CFLAGS=""
dnl We will need this for the Tcl project, which we will always have
DC_CHECK_FOR_WHOLE_ARCHIVE
for proj in tcl tclvfs tk; do
for proj in tcl tclvfs tk mk4tcl; do
AC_MSG_CHECKING([for libraries required for ${proj}])
libdir="../../../${proj}/inst"
libfiles="`find "${libdir}" -name '*.a' 2>/dev/null | tr "\n" ' '`"
libfilesnostub="`find "${libdir}" -name '*.a' 2>/dev/null | grep -v 'stub' | tr "\n" ' '`"
for libfile in ${libfiles}; do
|
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
|
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
|
-
+
+
|
DC_TEST_WHOLE_ARCHIVE_SHARED_LIB([$ARCHS $libfiles], [
libfiles="${libfiles}"
])
])
fi
if test "${proj}" = "mk4tcl"; then
if test -n "$libfilesnostub"; then
if test -n "$libfiles"; then
AC_DEFINE(KIT_INCLUDES_MK4TCL, [1], [Specify this if you link against mkt4tcl])
DC_DO_STATIC_LINK_LIBCXX
fi
fi
if test "$proj" = "tk"; then
if test -n "$libfilesnostub"; then
DC_DO_TK
DC_TEST_WHOLE_ARCHIVE_SHARED_LIB([$ARCHS $libfilesnostub], [
|