1
#------------------------------------------------------------------------
4
# Locate the tclConfig.sh file and perform a sanity check on
5
# the Tcl compile flags
12
# Adds the following arguments to configure:
15
# Defines the following vars:
16
# TCL_BIN_DIR Full path to the directory containing
17
# the tclConfig.sh file
18
#------------------------------------------------------------------------
20
AC_DEFUN([SC_PATH_TCLCONFIG], [
22
# Ok, lets find the tcl configuration
23
# First, look for one uninstalled.
24
# the alternative search directory is invoked by --with-tcl
27
if test x"${no_tcl}" = x ; then
28
# we reset no_tcl in case something fails here
31
AC_HELP_STRING([--with-tcl],
32
[directory containing tcl configuration (tclConfig.sh)]),
33
with_tclconfig="${withval}")
34
AC_MSG_CHECKING([for Tcl configuration])
35
AC_CACHE_VAL(ac_cv_c_tclconfig,[
37
# First check to see if --with-tcl was specified.
38
if test x"${with_tclconfig}" != x ; then
39
case "${with_tclconfig}" in
41
if test -f "${with_tclconfig}"; then
42
AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself])
43
with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`"
46
if test -f "${with_tclconfig}/tclConfig.sh" ; then
47
ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`"
49
AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
53
# then check for a private Tcl installation
54
if test x"${ac_cv_c_tclconfig}" = x ; then
57
`ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
58
`ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \
59
`ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
61
`ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
62
`ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
63
`ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
65
`ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
66
`ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
67
`ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
68
if test -f "$i/unix/tclConfig.sh" ; then
69
ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
75
# on Darwin, check in Framework installation locations
76
if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
77
for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
78
`ls -d /Library/Frameworks 2>/dev/null` \
79
`ls -d /Network/Library/Frameworks 2>/dev/null` \
80
`ls -d /System/Library/Frameworks 2>/dev/null` \
82
if test -f "$i/Tcl.framework/tclConfig.sh" ; then
83
ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`"
89
# check in a few common install locations
90
if test x"${ac_cv_c_tclconfig}" = x ; then
91
for i in `ls -d ${libdir} 2>/dev/null` \
92
`ls -d ${exec_prefix}/lib 2>/dev/null` \
93
`ls -d ${prefix}/lib 2>/dev/null` \
94
`ls -d /usr/local/lib 2>/dev/null` \
95
`ls -d /usr/contrib/lib 2>/dev/null` \
96
`ls -d /usr/share/tcltk/tcl8.5 2>/dev/null` \
97
`ls -d /usr/lib 2>/dev/null` \
98
`ls -d /usr/lib64 2>/dev/null` \
100
if test -f "$i/tclConfig.sh" ; then
101
ac_cv_c_tclconfig="`(cd $i; pwd)`"
107
# check in a few other private locations
108
if test x"${ac_cv_c_tclconfig}" = x ; then
111
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
112
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
113
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
114
if test -f "$i/unix/tclConfig.sh" ; then
115
ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
122
if test x"${ac_cv_c_tclconfig}" = x ; then
123
TCL_BIN_DIR="# no Tcl configs found"
124
AC_MSG_ERROR([Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh])
127
TCL_BIN_DIR="${ac_cv_c_tclconfig}"
128
AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh])
133
#------------------------------------------------------------------------
134
# SC_PATH_TKCONFIG --
136
# Locate the tkConfig.sh file
143
# Adds the following arguments to configure:
146
# Defines the following vars:
147
# TK_BIN_DIR Full path to the directory containing
148
# the tkConfig.sh file
149
#------------------------------------------------------------------------
151
AC_DEFUN([SC_PATH_TKCONFIG], [
153
# Ok, lets find the tk configuration
154
# First, look for one uninstalled.
155
# the alternative search directory is invoked by --with-tk
158
if test x"${no_tk}" = x ; then
159
# we reset no_tk in case something fails here
162
AC_HELP_STRING([--with-tk],
163
[directory containing tk configuration (tkConfig.sh)]),
164
with_tkconfig="${withval}")
165
AC_MSG_CHECKING([for Tk configuration])
166
AC_CACHE_VAL(ac_cv_c_tkconfig,[
168
# First check to see if --with-tkconfig was specified.
169
if test x"${with_tkconfig}" != x ; then
170
case "${with_tkconfig}" in
172
if test -f "${with_tkconfig}"; then
173
AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself])
174
with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`"
177
if test -f "${with_tkconfig}/tkConfig.sh" ; then
178
ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`"
180
AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh])
184
# then check for a private Tk library
185
if test x"${ac_cv_c_tkconfig}" = x ; then
188
`ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
189
`ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \
190
`ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \
192
`ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
193
`ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \
194
`ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \
196
`ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
197
`ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \
198
`ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
199
if test -f "$i/unix/tkConfig.sh" ; then
200
ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
206
# on Darwin, check in Framework installation locations
207
if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then
208
for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
209
`ls -d /Library/Frameworks 2>/dev/null` \
210
`ls -d /Network/Library/Frameworks 2>/dev/null` \
211
`ls -d /System/Library/Frameworks 2>/dev/null` \
213
if test -f "$i/Tk.framework/tkConfig.sh" ; then
214
ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`"
220
# check in a few common install locations
221
if test x"${ac_cv_c_tkconfig}" = x ; then
222
for i in `ls -d ${libdir} 2>/dev/null` \
223
`ls -d ${exec_prefix}/lib 2>/dev/null` \
224
`ls -d ${prefix}/lib 2>/dev/null` \
225
`ls -d /usr/local/lib 2>/dev/null` \
226
`ls -d /usr/contrib/lib 2>/dev/null` \
227
`ls -d /usr/share/tcltk/tk8.5 2>/dev/null` \
228
`ls -d /usr/lib 2>/dev/null` \
229
`ls -d /usr/lib64 2>/dev/null` \
231
if test -f "$i/tkConfig.sh" ; then
232
ac_cv_c_tkconfig="`(cd $i; pwd)`"
238
# check in a few other private locations
239
if test x"${ac_cv_c_tkconfig}" = x ; then
242
`ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
243
`ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \
244
`ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
245
if test -f "$i/unix/tkConfig.sh" ; then
246
ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
253
if test x"${ac_cv_c_tkconfig}" = x ; then
254
TK_BIN_DIR="# no Tk configs found"
255
AC_MSG_ERROR([Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh])
258
TK_BIN_DIR="${ac_cv_c_tkconfig}"
259
AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh])
264
#------------------------------------------------------------------------
265
# SC_LOAD_TCLCONFIG --
267
# Load the tclConfig.sh file
271
# Requires the following vars to be set:
276
# Subst the following vars:
281
#------------------------------------------------------------------------
283
AC_DEFUN([SC_LOAD_TCLCONFIG], [
284
AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh])
286
if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
287
AC_MSG_RESULT([loading])
288
. "${TCL_BIN_DIR}/tclConfig.sh"
290
AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
293
# eval is required to do the TCL_DBGX substitution
294
eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
295
eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
297
# If the TCL_BIN_DIR is the build directory (not the install directory),
298
# then set the common variable name to the value of the build variables.
299
# For example, the variable TCL_LIB_SPEC will be set to the value
300
# of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
301
# instead of TCL_BUILD_LIB_SPEC since it will work with both an
302
# installed and uninstalled version of Tcl.
303
if test -f "${TCL_BIN_DIR}/Makefile" ; then
304
TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}"
305
TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}"
306
TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}"
307
elif test "`uname -s`" = "Darwin"; then
308
# If Tcl was built as a framework, attempt to use the libraries
309
# from the framework at the given location so that linking works
310
# against Tcl.framework installed in an arbitrary location.
313
if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then
314
for i in "`cd "${TCL_BIN_DIR}"; pwd`" \
315
"`cd "${TCL_BIN_DIR}"/../..; pwd`"; do
316
if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
317
TCL_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TCL_LIB_FILE}"
322
if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then
323
TCL_STUB_LIB_SPEC="-L`echo "${TCL_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}"
324
TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
330
# eval is required to do the TCL_DBGX substitution
331
eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
332
eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
333
eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
334
eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
336
AC_SUBST(TCL_VERSION)
337
AC_SUBST(TCL_PATCH_LEVEL)
338
AC_SUBST(TCL_BIN_DIR)
339
AC_SUBST(TCL_SRC_DIR)
341
AC_SUBST(TCL_LIB_FILE)
342
AC_SUBST(TCL_LIB_FLAG)
343
AC_SUBST(TCL_LIB_SPEC)
345
AC_SUBST(TCL_STUB_LIB_FILE)
346
AC_SUBST(TCL_STUB_LIB_FLAG)
347
AC_SUBST(TCL_STUB_LIB_SPEC)
350
#------------------------------------------------------------------------
351
# SC_LOAD_TKCONFIG --
353
# Load the tkConfig.sh file
357
# Requires the following vars to be set:
362
# Sets the following vars that should be in tkConfig.sh:
364
#------------------------------------------------------------------------
366
AC_DEFUN([SC_LOAD_TKCONFIG], [
367
AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh])
369
if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
370
AC_MSG_RESULT([loading])
371
. "${TK_BIN_DIR}/tkConfig.sh"
373
AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh])
376
# eval is required to do the TK_DBGX substitution
377
eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
378
eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
380
# If the TK_BIN_DIR is the build directory (not the install directory),
381
# then set the common variable name to the value of the build variables.
382
# For example, the variable TK_LIB_SPEC will be set to the value
383
# of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
384
# instead of TK_BUILD_LIB_SPEC since it will work with both an
385
# installed and uninstalled version of Tcl.
386
if test -f "${TK_BIN_DIR}/Makefile" ; then
387
TK_LIB_SPEC="${TK_BUILD_LIB_SPEC}"
388
TK_STUB_LIB_SPEC="${TK_BUILD_STUB_LIB_SPEC}"
389
TK_STUB_LIB_PATH="${TK_BUILD_STUB_LIB_PATH}"
390
elif test "`uname -s`" = "Darwin"; then
391
# If Tk was built as a framework, attempt to use the libraries
392
# from the framework at the given location so that linking works
393
# against Tk.framework installed in an arbitrary location.
396
if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then
397
for i in "`cd "${TK_BIN_DIR}"; pwd`" \
398
"`cd "${TK_BIN_DIR}"/../..; pwd`"; do
399
if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
400
TK_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TK_LIB_FILE}"
405
if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then
406
TK_STUB_LIB_SPEC="-L` echo "${TK_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}"
407
TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
413
# eval is required to do the TK_DBGX substitution
414
eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
415
eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
416
eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
417
eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
423
AC_SUBST(TK_LIB_FILE)
424
AC_SUBST(TK_LIB_FLAG)
425
AC_SUBST(TK_LIB_SPEC)
427
AC_SUBST(TK_STUB_LIB_FILE)
428
AC_SUBST(TK_STUB_LIB_FLAG)
429
AC_SUBST(TK_STUB_LIB_SPEC)
432
#------------------------------------------------------------------------
434
# Locate a tclsh shell installed on the system path. This macro
435
# will only find a Tcl shell that already exists on the system.
436
# It will not find a Tcl shell in the Tcl build directory or
437
# a Tcl shell that has been installed from the Tcl build directory.
438
# If a Tcl shell can't be located on the PATH, then TCLSH_PROG will
439
# be set to "". Extensions should take care not to create Makefile
440
# rules that are run by default and depend on TCLSH_PROG. An
441
# extension can't assume that an executable Tcl shell exists at
448
# Subst's the following values:
450
#------------------------------------------------------------------------
452
AC_DEFUN([SC_PROG_TCLSH], [
453
AC_MSG_CHECKING([for tclsh])
454
AC_CACHE_VAL(ac_cv_path_tclsh, [
455
search_path=`echo ${PATH} | sed -e 's/:/ /g'`
456
for dir in $search_path ; do
457
for j in `ls -r $dir/tclsh[[8-9]]* 2> /dev/null` \
458
`ls -r $dir/tclsh* 2> /dev/null` ; do
459
if test x"$ac_cv_path_tclsh" = x ; then
460
if test -f "$j" ; then
469
if test -f "$ac_cv_path_tclsh" ; then
470
TCLSH_PROG="$ac_cv_path_tclsh"
471
AC_MSG_RESULT([$TCLSH_PROG])
473
# It is not an error if an installed version of Tcl can't be located.
475
AC_MSG_RESULT([No tclsh found on PATH])
480
#------------------------------------------------------------------------
482
# Determine the fully qualified path name of the tclsh executable
483
# in the Tcl build directory. This macro will correctly determine
484
# the name of the tclsh executable even if tclsh has not yet
485
# been built in the build directory. The build tclsh must be used
486
# when running tests from an extension build directory. It is not
487
# correct to use the TCLSH_PROG in cases like this.
493
# Subst's the following values:
495
#------------------------------------------------------------------------
497
AC_DEFUN([SC_BUILD_TCLSH], [
498
AC_MSG_CHECKING([for tclsh in Tcl build directory])
499
BUILD_TCLSH="${TCL_BIN_DIR}"/tclsh
500
AC_MSG_RESULT([$BUILD_TCLSH])
501
AC_SUBST(BUILD_TCLSH)
504
#------------------------------------------------------------------------
505
# SC_ENABLE_SHARED --
507
# Allows the building of shared libraries
514
# Adds the following arguments to configure:
515
# --enable-shared=yes|no
517
# Defines the following vars:
518
# STATIC_BUILD Used for building import/export libraries
521
# Sets the following vars:
522
# SHARED_BUILD Value of 1 or 0
523
#------------------------------------------------------------------------
525
AC_DEFUN([SC_ENABLE_SHARED], [
526
AC_MSG_CHECKING([how to build libraries])
527
AC_ARG_ENABLE(shared,
528
AC_HELP_STRING([--enable-shared],
529
[build and link with shared libraries (default: on)]),
530
[tcl_ok=$enableval], [tcl_ok=yes])
532
if test "${enable_shared+set}" = set; then
533
enableval="$enable_shared"
539
if test "$tcl_ok" = "yes" ; then
540
AC_MSG_RESULT([shared])
543
AC_MSG_RESULT([static])
545
AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?])
549
#------------------------------------------------------------------------
550
# SC_ENABLE_FRAMEWORK --
552
# Allows the building of shared libraries into frameworks
559
# Adds the following arguments to configure:
560
# --enable-framework=yes|no
562
# Sets the following vars:
563
# FRAMEWORK_BUILD Value of 1 or 0
564
#------------------------------------------------------------------------
566
AC_DEFUN([SC_ENABLE_FRAMEWORK], [
567
if test "`uname -s`" = "Darwin" ; then
568
AC_MSG_CHECKING([how to package libraries])
569
AC_ARG_ENABLE(framework,
570
AC_HELP_STRING([--enable-framework],
571
[package shared libraries in MacOSX frameworks (default: off)]),
572
[enable_framework=$enableval], [enable_framework=no])
573
if test $enable_framework = yes; then
574
if test $SHARED_BUILD = 0; then
575
AC_MSG_WARN([Frameworks can only be built if --enable-shared is yes])
578
if test $tcl_corefoundation = no; then
579
AC_MSG_WARN([Frameworks can only be used when CoreFoundation is available])
583
if test $enable_framework = yes; then
584
AC_MSG_RESULT([framework])
587
if test $SHARED_BUILD = 1; then
588
AC_MSG_RESULT([shared library])
590
AC_MSG_RESULT([static library])
597
#------------------------------------------------------------------------
598
# SC_ENABLE_THREADS --
600
# Specify if thread support should be enabled
607
# Adds the following arguments to configure:
610
# Sets the following vars:
611
# THREADS_LIBS Thread library(s)
613
# Defines the following vars:
618
#------------------------------------------------------------------------
620
AC_DEFUN([SC_ENABLE_THREADS], [
621
AC_ARG_ENABLE(threads,
622
AC_HELP_STRING([--enable-threads],
623
[build with threads (default: off)]),
624
[tcl_ok=$enableval], [tcl_ok=no])
626
if test "${TCL_THREADS}" = 1; then
630
if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
632
# USE_THREAD_ALLOC tells us to try the special thread-based
633
# allocator that significantly reduces lock contention
634
AC_DEFINE(USE_THREAD_ALLOC, 1,
635
[Do we want to use the threaded memory allocator?])
636
AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
637
if test "`uname -s`" = "SunOS" ; then
638
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
639
[Do we really want to follow the standard? Yes we do!])
641
AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
642
AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
643
if test "$tcl_ok" = "no"; then
644
# Check a little harder for __pthread_mutex_init in the same
645
# library, as some systems hide it there until pthread.h is
646
# defined. We could alternatively do an AC_TRY_COMPILE with
647
# pthread.h, but that will work with libpthread really doesn't
648
# exist, like AIX 4.2. [Bug: 4359]
649
AC_CHECK_LIB(pthread, __pthread_mutex_init,
650
tcl_ok=yes, tcl_ok=no)
653
if test "$tcl_ok" = "yes"; then
654
# The space is needed
655
THREADS_LIBS=" -lpthread"
657
AC_CHECK_LIB(pthreads, pthread_mutex_init,
658
tcl_ok=yes, tcl_ok=no)
659
if test "$tcl_ok" = "yes"; then
660
# The space is needed
661
THREADS_LIBS=" -lpthreads"
663
AC_CHECK_LIB(c, pthread_mutex_init,
664
tcl_ok=yes, tcl_ok=no)
665
if test "$tcl_ok" = "no"; then
666
AC_CHECK_LIB(c_r, pthread_mutex_init,
667
tcl_ok=yes, tcl_ok=no)
668
if test "$tcl_ok" = "yes"; then
669
# The space is needed
670
THREADS_LIBS=" -pthread"
673
AC_MSG_WARN([Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...])
679
# Does the pthread-implementation provide
680
# 'pthread_attr_setstacksize' ?
683
LIBS="$LIBS $THREADS_LIBS"
684
AC_CHECK_FUNCS(pthread_attr_setstacksize)
685
AC_CHECK_FUNC(pthread_attr_get_np,tcl_ok=yes,tcl_ok=no)
686
if test $tcl_ok = yes ; then
687
AC_DEFINE(HAVE_PTHREAD_ATTR_GET_NP, 1,
688
[Do we want a BSD-like thread-attribute interface?])
689
AC_CACHE_CHECK([for pthread_attr_get_np declaration],
690
tcl_cv_grep_pthread_attr_get_np, [
691
AC_EGREP_HEADER(pthread_attr_get_np, pthread.h,
692
tcl_cv_grep_pthread_attr_get_np=present,
693
tcl_cv_grep_pthread_attr_get_np=missing)])
694
if test $tcl_cv_grep_pthread_attr_get_np = missing ; then
695
AC_DEFINE(ATTRGETNP_NOT_DECLARED, 1,
696
[Is pthread_attr_get_np() declared in <pthread.h>?])
699
AC_CHECK_FUNC(pthread_getattr_np,tcl_ok=yes,tcl_ok=no)
700
if test $tcl_ok = yes ; then
701
AC_DEFINE(HAVE_PTHREAD_GETATTR_NP, 1,
702
[Do we want a Linux-like thread-attribute interface?])
703
AC_CACHE_CHECK([for pthread_getattr_np declaration],
704
tcl_cv_grep_pthread_getattr_np, [
705
AC_EGREP_HEADER(pthread_getattr_np, pthread.h,
706
tcl_cv_grep_pthread_getattr_np=present,
707
tcl_cv_grep_pthread_getattr_np=missing)])
708
if test $tcl_cv_grep_pthread_getattr_np = missing ; then
709
AC_DEFINE(GETATTRNP_NOT_DECLARED, 1,
710
[Is pthread_getattr_np declared in <pthread.h>?])
714
if test $tcl_ok = no; then
715
# Darwin thread stacksize API
716
AC_CHECK_FUNCS(pthread_get_stacksize_np)
722
# Do checking message here to not mess up interleaved configure output
723
AC_MSG_CHECKING([for building with threads])
724
if test "${TCL_THREADS}" = 1; then
725
AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?])
726
if test "${tcl_threaded_core}" = 1; then
727
AC_MSG_RESULT([yes (threaded core)])
732
AC_MSG_RESULT([no (default)])
735
AC_SUBST(TCL_THREADS)
738
#------------------------------------------------------------------------
739
# SC_ENABLE_SYMBOLS --
741
# Specify if debugging symbols should be used.
742
# Memory (TCL_MEM_DEBUG) and compile (TCL_COMPILE_DEBUG) debugging
743
# can also be enabled.
748
# Requires the following vars to be set in the Makefile:
756
# Adds the following arguments to configure:
759
# Defines the following vars:
760
# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true
761
# Sets to $(CFLAGS_OPTIMIZE) if false
762
# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true
763
# Sets to $(LDFLAGS_OPTIMIZE) if false
764
# DBGX Formerly used as debug library extension;
767
#------------------------------------------------------------------------
769
AC_DEFUN([SC_ENABLE_SYMBOLS], [
770
AC_MSG_CHECKING([for build with symbols])
771
AC_ARG_ENABLE(symbols,
772
AC_HELP_STRING([--enable-symbols],
773
[build with debugging symbols (default: off)]),
774
[tcl_ok=$enableval], [tcl_ok=no])
775
# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT.
777
if test "$tcl_ok" = "no"; then
778
CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
779
LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
781
AC_DEFINE(TCL_CFG_OPTIMIZED, 1, [Is this an optimized build?])
783
CFLAGS_DEFAULT='$(CFLAGS_DEBUG)'
784
LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)'
785
if test "$tcl_ok" = "yes"; then
786
AC_MSG_RESULT([yes (standard debugging)])
789
AC_SUBST(CFLAGS_DEFAULT)
790
AC_SUBST(LDFLAGS_DEFAULT)
791
### FIXME: Surely TCL_CFG_DEBUG should be set to whether we're debugging?
792
AC_DEFINE(TCL_CFG_DEBUG, 1, [Is debugging enabled?])
794
if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
795
AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?])
798
ifelse($1,bccdebug,dnl Only enable 'compile' for the Tcl core itself
799
if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then
800
AC_DEFINE(TCL_COMPILE_DEBUG, 1, [Is bytecode debugging enabled?])
801
AC_DEFINE(TCL_COMPILE_STATS, 1, [Are bytecode statistics enabled?])
804
if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
805
if test "$tcl_ok" = "all"; then
806
AC_MSG_RESULT([enabled symbols mem ]ifelse($1,bccdebug,[compile ])[debugging])
808
AC_MSG_RESULT([enabled $tcl_ok debugging])
813
#------------------------------------------------------------------------
814
# SC_ENABLE_LANGINFO --
816
# Allows use of modern nl_langinfo check for better l10n.
817
# This is only relevant for Unix.
824
# Adds the following arguments to configure:
825
# --enable-langinfo=yes|no (default is yes)
827
# Defines the following vars:
828
# HAVE_LANGINFO Triggers use of nl_langinfo if defined.
830
#------------------------------------------------------------------------
832
AC_DEFUN([SC_ENABLE_LANGINFO], [
833
AC_ARG_ENABLE(langinfo,
834
AC_HELP_STRING([--enable-langinfo],
835
[use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]),
836
[langinfo_ok=$enableval], [langinfo_ok=yes])
839
if test "$langinfo_ok" = "yes"; then
840
AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no])
842
AC_MSG_CHECKING([whether to use nl_langinfo])
843
if test "$langinfo_ok" = "yes"; then
844
AC_CACHE_VAL(tcl_cv_langinfo_h, [
845
AC_TRY_COMPILE([#include <langinfo.h>], [nl_langinfo(CODESET);],
846
[tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])])
847
AC_MSG_RESULT([$tcl_cv_langinfo_h])
848
if test $tcl_cv_langinfo_h = yes; then
849
AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?])
852
AC_MSG_RESULT([$langinfo_ok])
856
#--------------------------------------------------------------------
859
# Decide whether to use symlinks for linking the manpages,
860
# whether to compress the manpages after installation, and
861
# whether to add a package name suffix to the installed
862
# manpages to avoidfile name clashes.
863
# If compression is enabled also find out what file name suffix
864
# the given compression program is using.
871
# Adds the following arguments to configure:
872
# --enable-man-symlinks
873
# --enable-man-compression=PROG
874
# --enable-man-suffix[=STRING]
876
# Defines the following variable:
878
# MAN_FLAGS - The apropriate flags for installManPage
879
# according to the user's selection.
881
#--------------------------------------------------------------------
883
AC_DEFUN([SC_CONFIG_MANPAGES], [
884
AC_MSG_CHECKING([whether to use symlinks for manpages])
885
AC_ARG_ENABLE(man-symlinks,
886
AC_HELP_STRING([--enable-man-symlinks],
887
[use symlinks for the manpages (default: off)]),
888
test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks",
890
AC_MSG_RESULT([$enableval])
892
AC_MSG_CHECKING([whether to compress the manpages])
893
AC_ARG_ENABLE(man-compression,
894
AC_HELP_STRING([--enable-man-compression=PROG],
895
[compress the manpages with PROG (default: off)]),
897
yes) AC_MSG_ERROR([missing argument to --enable-man-compression]);;
899
*) MAN_FLAGS="$MAN_FLAGS --compress $enableval";;
902
AC_MSG_RESULT([$enableval])
903
if test "$enableval" != "no"; then
904
AC_MSG_CHECKING([for compressed file suffix])
907
Z=`ls TeST* | sed 's/^....//'`
909
MAN_FLAGS="$MAN_FLAGS --extension $Z"
913
AC_MSG_CHECKING([whether to add a package name suffix for the manpages])
914
AC_ARG_ENABLE(man-suffix,
915
AC_HELP_STRING([--enable-man-suffix=STRING],
916
[use STRING as a suffix to manpage file names (default: no, AC_PACKAGE_NAME if enabled without specifying STRING)]),
918
yes) enableval="AC_PACKAGE_NAME" MAN_FLAGS="$MAN_FLAGS --suffix $enableval";;
920
*) MAN_FLAGS="$MAN_FLAGS --suffix $enableval";;
923
AC_MSG_RESULT([$enableval])
928
#--------------------------------------------------------------------
931
# Determine what the system is (some things cannot be easily checked
932
# on a feature-driven basis, alas). This can usually be done via the
933
# "uname" command, but there are a few systems, like Next, where
940
# Defines the following var:
942
# system - System/platform/version identification code.
944
#--------------------------------------------------------------------
946
AC_DEFUN([SC_CONFIG_SYSTEM], [
947
AC_CACHE_CHECK([system version], tcl_cv_sys_version, [
948
if test -f /usr/lib/NextStep/software_version; then
949
tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
951
tcl_cv_sys_version=`uname -s`-`uname -r`
952
if test "$?" -ne 0 ; then
953
AC_MSG_WARN([can't find uname command])
954
tcl_cv_sys_version=unknown
956
# Special check for weird MP-RAS system (uname returns weird
957
# results, and the version is kept in special file).
959
if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
960
tcl_cv_sys_version=MP-RAS-`awk '{print $[3]}' /etc/.relid`
962
if test "`uname -s`" = "AIX" ; then
963
tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
968
system=$tcl_cv_sys_version
971
#--------------------------------------------------------------------
974
# Try to determine the proper flags to pass to the compiler
975
# for building shared libraries and other such nonsense.
982
# Defines and substitutes the following vars:
984
# DL_OBJS - Name of the object file that implements dynamic
985
# loading for Tcl on this system.
986
# DL_LIBS - Library file(s) to include in tclsh and other base
987
# applications in order for the "load" command to work.
988
# LDFLAGS - Flags to pass to the compiler when linking object
989
# files into an executable application binary such
991
# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib",
992
# that tell the run-time dynamic linker where to look
993
# for shared libraries such as libtcl.so. Depends on
994
# the variable LIB_RUNTIME_DIR in the Makefile. Could
995
# be the same as CC_SEARCH_FLAGS if ${CC} is used to link.
996
# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib",
997
# that tell the run-time dynamic linker where to look
998
# for shared libraries such as libtcl.so. Depends on
999
# the variable LIB_RUNTIME_DIR in the Makefile.
1000
# MAKE_LIB - Command to execute to build the a library;
1001
# differs when building shared or static.
1003
# Command to execute to build a stub library.
1004
# INSTALL_LIB - Command to execute to install a library;
1005
# differs when building shared or static.
1006
# INSTALL_STUB_LIB -
1007
# Command to execute to install a stub library.
1008
# STLIB_LD - Base command to use for combining object files
1009
# into a static library.
1010
# SHLIB_CFLAGS - Flags to pass to cc when compiling the components
1011
# of a shared library (may request position-independent
1012
# code, among other things).
1013
# SHLIB_LD - Base command to use for combining object files
1014
# into a shared library.
1015
# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
1016
# creating shared libraries. This symbol typically
1017
# goes at the end of the "ld" commands that build
1018
# shared libraries. The value of the symbol is
1019
# "${LIBS}" if all of the dependent libraries should
1020
# be specified when creating a shared library. If
1021
# dependent libraries should not be specified (as on
1022
# SunOS 4.x, where they cause the link to fail, or in
1023
# general if Tcl and Tk aren't themselves shared
1024
# libraries), then this symbol has an empty string
1026
# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable
1027
# extensions. An empty string means we don't know how
1028
# to use shared libraries on this platform.
1029
# TCL_SHLIB_LD_EXTRAS - Additional element which are added to SHLIB_LD_LIBS
1030
# TK_SHLIB_LD_EXTRAS for the build of Tcl and Tk, but not recorded in the
1031
# tclConfig.sh, since they are only used for the build
1033
# Examples: MacOS X records the library version and
1034
# compatibility version in the shared library. But
1035
# of course the Tcl version of this is only used for Tcl.
1036
# LIB_SUFFIX - Specifies everything that comes after the "libfoo"
1037
# in a static or shared library name, using the $VERSION variable
1038
# to put the version in the right place. This is used
1039
# by platforms that need non-standard library names.
1040
# Examples: ${VERSION}.so.1.1 on NetBSD, since it needs
1041
# to have a version after the .so, and ${VERSION}.a
1042
# on AIX, since a shared library needs to have
1043
# a .a extension whereas shared objects for loadable
1044
# extensions have a .so extension. Defaults to
1045
# ${VERSION}${SHLIB_SUFFIX}.
1047
# Libs to use when linking Tcl shell or some other
1048
# shell that includes Tcl libs.
1050
# Flags used when running the compiler in debug mode
1052
# Flags used when running the compiler in optimize mode
1053
# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit)
1055
#--------------------------------------------------------------------
1057
AC_DEFUN([SC_CONFIG_CFLAGS], [
1059
# Step 0.a: Enable 64 bit support?
1061
AC_MSG_CHECKING([if 64bit support is requested])
1062
AC_ARG_ENABLE(64bit,
1063
AC_HELP_STRING([--enable-64bit],
1064
[enable 64bit support (default: off)]),
1065
[do64bit=$enableval], [do64bit=no])
1066
AC_MSG_RESULT([$do64bit])
1068
# Step 0.b: Enable Solaris 64 bit VIS support?
1070
AC_MSG_CHECKING([if 64bit Sparc VIS support is requested])
1071
AC_ARG_ENABLE(64bit-vis,
1072
AC_HELP_STRING([--enable-64bit-vis],
1073
[enable 64bit Sparc VIS support (default: off)]),
1074
[do64bitVIS=$enableval], [do64bitVIS=no])
1075
AC_MSG_RESULT([$do64bitVIS])
1076
# Force 64bit on with VIS
1077
AS_IF([test "$do64bitVIS" = "yes"], [do64bit=yes])
1079
# Step 0.c: Check if visibility support is available. Do this here so
1080
# that platform specific alternatives can be used below if this fails.
1082
AC_CACHE_CHECK([if compiler supports visibility "hidden"],
1083
tcl_cv_cc_visibility_hidden, [
1084
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
1086
extern __attribute__((__visibility__("hidden"))) void f(void);
1087
void f(void) {}], [f();], tcl_cv_cc_visibility_hidden=yes,
1088
tcl_cv_cc_visibility_hidden=no)
1089
CFLAGS=$hold_cflags])
1090
AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
1091
AC_DEFINE(MODULE_SCOPE,
1092
[extern __attribute__((__visibility__("hidden")))],
1093
[Compiler support for module scope symbols])
1096
# Step 0.d: Disable -rpath support?
1098
AC_MSG_CHECKING([if rpath support is requested])
1099
AC_ARG_ENABLE(rpath,
1100
AC_HELP_STRING([--disable-rpath],
1101
[disable rpath support (default: on)]),
1102
[doRpath=$enableval], [doRpath=yes])
1103
AC_MSG_RESULT([$doRpath])
1105
# Step 1: set the variable "system" to hold the name and version number
1110
# Step 2: check for existence of -ldl library. This is needed because
1111
# Linux can use either -ldl or -ldld for dynamic loading.
1113
AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
1115
# Require ranlib early so we can override it in special cases below.
1116
AS_IF([test x"${SHLIB_VERSION}" = x], [SHLIB_VERSION="1.0"])
1118
AC_REQUIRE([AC_PROG_RANLIB])
1120
# Step 3: set configuration options based on system name and version.
1123
# default to '{$LIBS}' and set to "" on per-platform necessary basis
1124
SHLIB_LD_LIBS='${LIBS}'
1125
LDFLAGS_ORIG="$LDFLAGS"
1126
# When ld needs options to work in 64-bit mode, put them in
1127
# LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
1128
# is disabled by the user. [Bug 1016796]
1130
UNSHARED_LIB_SUFFIX=""
1131
TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`'
1132
ECHO_VERSION='`echo ${VERSION}`'
1133
TCL_LIB_VERSIONS_OK=ok
1136
AS_IF([test "$GCC" = yes], [
1137
CFLAGS_WARNING="-Wall"
1138
], [CFLAGS_WARNING=""])
1139
AC_CHECK_TOOL(AR, ar)
1141
LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
1147
AS_IF([test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"], [
1148
# AIX requires the _r compiler when gcc isn't being used
1154
# Make sure only first arg gets _r
1155
CC=`echo "$CC" | sed -e 's/^\([[^ ]]*\)/\1_r/'`
1158
AC_MSG_RESULT([Using $CC for compiling with threads])
1164
DL_OBJS="tclLoadDl.o"
1165
LD_LIBRARY_PATH_VAR="LIBPATH"
1167
# ldAix No longer needed with use of -bexpall/-brtl
1168
# but some extensions may still reference it
1169
LDAIX_SRC='$(UNIX_DIR)/ldAix'
1171
# Check to enable 64-bit flags for compiler/linker
1172
AS_IF([test "$do64bit" = yes], [
1173
AS_IF([test "$GCC" = yes], [
1174
AC_MSG_WARN([64bit mode not supported with GCC on $system])
1177
CFLAGS="$CFLAGS -q64"
1179
RANLIB="${RANLIB} -X64"
1181
SHLIB_LD_FLAGS="-b64"
1185
AS_IF([test "`uname -m`" = ia64], [
1186
# AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
1187
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
1188
# AIX-5 has dl* in libc.so
1190
AS_IF([test "$GCC" = yes], [
1191
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
1193
CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
1195
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
1197
AS_IF([test "$GCC" = yes], [
1198
SHLIB_LD='${CC} -shared -Wl,-bexpall'
1200
SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry"
1201
LDFLAGS="$LDFLAGS -brtl"
1203
SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}"
1205
CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
1206
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1210
SHLIB_CFLAGS="-fPIC"
1211
SHLIB_LD='${CC} -nostart'
1213
DL_OBJS="tclLoadDl.o"
1216
#-----------------------------------------------------------
1217
# Check for inet_ntoa in -lbind, for BeOS (which also needs
1218
# -lsocket, even if the network functions are in -lnet which
1219
# is always linked to, for compatibility.
1220
#-----------------------------------------------------------
1221
AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"])
1223
BSD/OS-2.1*|BSD/OS-3*)
1225
SHLIB_LD="shlicc -r"
1227
DL_OBJS="tclLoadDl.o"
1233
SHLIB_CFLAGS="-export-dynamic -fPIC"
1234
SHLIB_LD='${CC} -shared'
1236
DL_OBJS="tclLoadDl.o"
1238
LDFLAGS="$LDFLAGS -export-dynamic"
1244
SHLIB_LD='${CC} -shared'
1246
DL_OBJS="tclLoadDl.o"
1252
SHLIB_CFLAGS="-K PIC"
1256
DL_OBJS="tclLoadDl.o"
1262
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
1263
SHLIB_CFLAGS="-fPIC"
1265
SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
1266
DL_OBJS="tclLoadDl.o"
1268
AC_CHECK_LIB(network, inet_ntoa, [LIBS="$LIBS -lnetwork"])
1271
# Use updated header definitions where possible
1272
AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?])
1273
AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?])
1274
LIBS="$LIBS -lxnet" # Use the XOPEN network library
1276
AS_IF([test "`uname -m`" = ia64], [
1281
AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
1282
AS_IF([test "$tcl_ok" = yes], [
1285
DL_OBJS="tclLoadShl.o"
1287
LDFLAGS="$LDFLAGS -Wl,-E"
1288
CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
1289
LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
1290
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
1292
AS_IF([test "$GCC" = yes], [
1293
SHLIB_LD='${CC} -shared'
1294
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1297
# Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
1298
#CFLAGS="$CFLAGS +DAportable"
1300
# Check to enable 64-bit flags for compiler/linker
1301
AS_IF([test "$do64bit" = "yes"], [
1302
AS_IF([test "$GCC" = yes], [
1303
case `${CC} -dumpmachine` in
1305
# 64-bit gcc in use. Fix flags for GNU ld.
1307
SHLIB_LD='${CC} -shared'
1308
AS_IF([test $doRpath = yes], [
1309
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
1310
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1313
AC_MSG_WARN([64bit mode not supported with GCC on $system])
1318
CFLAGS="$CFLAGS +DD64"
1319
LDFLAGS_ARCH="+DD64"
1322
HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
1324
AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
1325
AS_IF([test "$tcl_ok" = yes], [
1329
DL_OBJS="tclLoadShl.o"
1331
LDFLAGS="$LDFLAGS -Wl,-E"
1332
CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
1333
LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
1334
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
1338
SHLIB_LD="ld -shared -rdata_shared"
1340
DL_OBJS="tclLoadDl.o"
1342
AS_IF([test $doRpath = yes], [
1343
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1344
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
1348
SHLIB_LD="ld -n32 -shared -rdata_shared"
1350
DL_OBJS="tclLoadDl.o"
1352
AS_IF([test $doRpath = yes], [
1353
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1354
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
1355
AS_IF([test "$GCC" = yes], [
1356
CFLAGS="$CFLAGS -mabi=n32"
1357
LDFLAGS="$LDFLAGS -mabi=n32"
1361
# Use to build 6.2 compatible binaries on 6.3.
1362
CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
1365
CFLAGS="$CFLAGS -n32"
1368
LDFLAGS="$LDFLAGS -n32"
1373
SHLIB_LD="ld -n32 -shared -rdata_shared"
1375
DL_OBJS="tclLoadDl.o"
1377
AS_IF([test $doRpath = yes], [
1378
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1379
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
1381
# Check to enable 64-bit flags for compiler/linker
1383
AS_IF([test "$do64bit" = yes], [
1384
AS_IF([test "$GCC" = yes], [
1385
AC_MSG_WARN([64bit mode not supported by gcc])
1388
SHLIB_LD="ld -64 -shared -rdata_shared"
1389
CFLAGS="$CFLAGS -64"
1395
SHLIB_CFLAGS="-fPIC"
1398
CFLAGS_OPTIMIZE="-O2"
1399
# egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings
1400
# when you inline the string and math operations. Turn this off to
1401
# get rid of the warnings.
1402
#CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
1404
SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
1405
DL_OBJS="tclLoadDl.o"
1407
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
1408
AS_IF([test $doRpath = yes], [
1409
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
1410
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1411
AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"])
1412
AS_IF([test $do64bit = yes], [
1413
AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [
1415
CFLAGS="$CFLAGS -m64"
1416
AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no)
1417
CFLAGS=$hold_cflags])
1418
AS_IF([test $tcl_cv_cc_m64 = yes], [
1419
CFLAGS="$CFLAGS -m64"
1424
# The combo of gcc + glibc has a bug related to inlining of
1425
# functions like strtod(). The -fno-builtin flag should address
1426
# this problem but it does not work. The -fno-inline flag is kind
1427
# of overkill but it works. Disable inlining only when one of the
1428
# files in compat/*.c is being linked in.
1430
AS_IF([test x"${USE_COMPAT}" != x],[CFLAGS="$CFLAGS -fno-inline"])
1433
SHLIB_CFLAGS="-fPIC"
1436
SHLIB_LD='${CC} -shared'
1439
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
1442
AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"])
1445
SHLIB_CFLAGS="-fPIC"
1448
SHLIB_LD='${CC} -shared'
1449
DL_OBJS="tclLoadDl.o"
1450
DL_LIBS="-mshared -ldl"
1451
LD_FLAGS="-Wl,--export-dynamic"
1452
AS_IF([test $doRpath = yes], [
1453
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1454
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
1457
SHLIB_CFLAGS="-K PIC"
1461
DL_OBJS="tclLoadDl.o"
1467
SHLIB_CFLAGS="-K PIC"
1471
DL_OBJS="tclLoadDl.o"
1473
LDFLAGS="$LDFLAGS -Wl,-Bexport"
1477
NetBSD-1.*|FreeBSD-[[1-2]].*)
1478
SHLIB_CFLAGS="-fPIC"
1479
SHLIB_LD="ld -Bshareable -x"
1481
DL_OBJS="tclLoadDl.o"
1483
AS_IF([test $doRpath = yes], [
1484
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1485
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
1486
AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [
1491
], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)])
1492
AS_IF([test $tcl_cv_ld_elf = yes], [
1493
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
1495
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
1498
# Ancient FreeBSD doesn't handle version numbers with dots.
1500
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
1501
TCL_LIB_VERSIONS_OK=nodots
1507
# Equivalent using configure option --disable-load
1508
# Step 4 will set the necessary variables
1513
SHLIB_CFLAGS="-fPIC"
1514
SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
1516
DL_OBJS="tclLoadDl.o"
1518
AS_IF([test $doRpath = yes], [
1519
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
1520
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1521
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
1526
CFLAGS_OPTIMIZE="-O1"
1529
CFLAGS_OPTIMIZE="-O0"
1532
CFLAGS_OPTIMIZE="-O2"
1535
AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [
1540
], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)])
1541
AS_IF([test $tcl_cv_ld_elf = yes], [
1542
LDFLAGS=-Wl,-export-dynamic
1544
AS_IF([test "${TCL_THREADS}" = "1"], [
1545
# On OpenBSD: Compile with -pthread
1546
# Don't link with -lpthread
1547
LIBS=`echo $LIBS | sed s/-lpthread//`
1548
CFLAGS="$CFLAGS -pthread"
1550
# OpenBSD doesn't do version numbers with dots.
1551
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
1552
TCL_LIB_VERSIONS_OK=nodots
1554
NetBSD-*|FreeBSD-[[3-4]].*)
1555
# FreeBSD 3.* and greater have ELF.
1556
# NetBSD 2.* has ELF and can use 'cc -shared' to build shared libs
1557
SHLIB_CFLAGS="-fPIC"
1558
SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
1560
DL_OBJS="tclLoadDl.o"
1562
LDFLAGS="$LDFLAGS -export-dynamic"
1563
AS_IF([test $doRpath = yes], [
1564
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
1565
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1566
AS_IF([test "${TCL_THREADS}" = "1"], [
1567
# The -pthread needs to go in the CFLAGS, not LIBS
1568
LIBS=`echo $LIBS | sed s/-pthread//`
1569
CFLAGS="$CFLAGS -pthread"
1570
LDFLAGS="$LDFLAGS -pthread"
1574
# FreeBSD-3 doesn't handle version numbers with dots.
1575
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
1576
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
1577
TCL_LIB_VERSIONS_OK=nodots
1582
# This configuration from FreeBSD Ports.
1583
SHLIB_CFLAGS="-fPIC"
1584
SHLIB_LD="${CC} -shared"
1585
TCL_SHLIB_LD_EXTRAS="-soname \$[@]"
1587
DL_OBJS="tclLoadDl.o"
1590
AS_IF([test $doRpath = yes], [
1591
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1592
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
1593
AS_IF([test "${TCL_THREADS}" = "1"], [
1594
# The -pthread needs to go in the LDFLAGS, not LIBS
1595
LIBS=`echo $LIBS | sed s/-pthread//`
1596
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
1597
LDFLAGS="$LDFLAGS $PTHREAD_LIBS"])
1598
# Version numbers are dot-stripped by system policy.
1599
TCL_TRIM_DOTS=`echo ${VERSION} | tr -d .`
1600
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
1601
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1'
1602
TCL_LIB_VERSIONS_OK=nodots
1605
CFLAGS_OPTIMIZE="-Os"
1606
SHLIB_CFLAGS="-fno-common"
1607
# To avoid discrepancies between what headers configure sees during
1608
# preprocessing tests and compiling tests, move any -isysroot and
1609
# -mmacosx-version-min flags from CFLAGS to CPPFLAGS:
1610
CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \
1611
awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
1612
if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`"
1613
CFLAGS="`echo " ${CFLAGS}" | \
1614
awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
1615
if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`"
1616
AS_IF([test $do64bit = yes], [
1619
AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag],
1620
tcl_cv_cc_arch_ppc64, [
1622
CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
1623
AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes,
1624
tcl_cv_cc_arch_ppc64=no)
1625
CFLAGS=$hold_cflags])
1626
AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [
1627
CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
1631
AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag],
1632
tcl_cv_cc_arch_x86_64, [
1634
CFLAGS="$CFLAGS -arch x86_64"
1635
AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes,
1636
tcl_cv_cc_arch_x86_64=no)
1637
CFLAGS=$hold_cflags])
1638
AS_IF([test $tcl_cv_cc_arch_x86_64 = yes], [
1639
CFLAGS="$CFLAGS -arch x86_64"
1643
AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);;
1646
# Check for combined 32-bit and 64-bit fat build
1647
AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \
1648
&& echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '], [
1651
SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}'
1652
AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
1653
hold_ldflags=$LDFLAGS
1654
LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
1655
AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no)
1656
LDFLAGS=$hold_ldflags])
1657
AS_IF([test $tcl_cv_ld_single_module = yes], [
1658
SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
1660
SHLIB_SUFFIX=".dylib"
1661
DL_OBJS="tclLoadDyld.o"
1663
# Don't use -prebind when building for Mac OS X 10.4 or later only:
1664
AS_IF([test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \
1665
"`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4], [
1666
LDFLAGS="$LDFLAGS -prebind"])
1667
LDFLAGS="$LDFLAGS -headerpad_max_install_names"
1668
AC_CACHE_CHECK([if ld accepts -search_paths_first flag],
1669
tcl_cv_ld_search_paths_first, [
1670
hold_ldflags=$LDFLAGS
1671
LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
1672
AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes,
1673
tcl_cv_ld_search_paths_first=no)
1674
LDFLAGS=$hold_ldflags])
1675
AS_IF([test $tcl_cv_ld_search_paths_first = yes], [
1676
LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
1678
AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
1679
AC_DEFINE(MODULE_SCOPE, [__private_extern__],
1680
[Compiler support for module scope symbols])
1684
LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
1685
AC_DEFINE(MAC_OSX_TCL, 1, [Is this a Mac I see before me?])
1686
PLAT_OBJS='${MAC_OSX_OBJS}'
1687
PLAT_SRCS='${MAC_OSX_SRCS}'
1688
AC_MSG_CHECKING([whether to use CoreFoundation])
1689
AC_ARG_ENABLE(corefoundation,
1690
AC_HELP_STRING([--enable-corefoundation],
1691
[use CoreFoundation API on MacOSX (default: on)]),
1692
[tcl_corefoundation=$enableval], [tcl_corefoundation=yes])
1693
AC_MSG_RESULT([$tcl_corefoundation])
1694
AS_IF([test $tcl_corefoundation = yes], [
1695
AC_CACHE_CHECK([for CoreFoundation.framework],
1696
tcl_cv_lib_corefoundation, [
1698
AS_IF([test "$fat_32_64" = yes], [
1699
for v in CFLAGS CPPFLAGS LDFLAGS; do
1700
# On Tiger there is no 64-bit CF, so remove 64-bit
1701
# archs from CFLAGS et al. while testing for
1702
# presence of CF. 64-bit CF is disabled in
1703
# tclUnixPort.h if necessary.
1704
eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
1706
LIBS="$LIBS -framework CoreFoundation"
1707
AC_TRY_LINK([#include <CoreFoundation/CoreFoundation.h>],
1708
[CFBundleRef b = CFBundleGetMainBundle();],
1709
tcl_cv_lib_corefoundation=yes,
1710
tcl_cv_lib_corefoundation=no)
1711
AS_IF([test "$fat_32_64" = yes], [
1712
for v in CFLAGS CPPFLAGS LDFLAGS; do
1713
eval $v'="$hold_'$v'"'
1716
AS_IF([test $tcl_cv_lib_corefoundation = yes], [
1717
LIBS="$LIBS -framework CoreFoundation"
1718
AC_DEFINE(HAVE_COREFOUNDATION, 1,
1719
[Do we have access to Darwin CoreFoundation.framework?])
1720
], [tcl_corefoundation=no])
1721
AS_IF([test "$fat_32_64" = yes -a $tcl_corefoundation = yes],[
1722
AC_CACHE_CHECK([for 64-bit CoreFoundation],
1723
tcl_cv_lib_corefoundation_64, [
1724
for v in CFLAGS CPPFLAGS LDFLAGS; do
1725
eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
1727
AC_TRY_LINK([#include <CoreFoundation/CoreFoundation.h>],
1728
[CFBundleRef b = CFBundleGetMainBundle();],
1729
tcl_cv_lib_corefoundation_64=yes,
1730
tcl_cv_lib_corefoundation_64=no)
1731
for v in CFLAGS CPPFLAGS LDFLAGS; do
1732
eval $v'="$hold_'$v'"'
1734
AS_IF([test $tcl_cv_lib_corefoundation_64 = no], [
1735
AC_DEFINE(NO_COREFOUNDATION_64, 1,
1736
[Is Darwin CoreFoundation unavailable for 64-bit?])
1737
LDFLAGS="$LDFLAGS -Wl,-no_arch_warnings"
1744
SHLIB_LD='${CC} -nostdlib -r'
1747
DL_OBJS="tclLoadNext.o"
1754
CFLAGS_OPTIMIZE="" # Optimizer is buggy
1755
AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h
1756
[Should OS/390 do the right thing with sockets?])
1758
OSF1-1.0|OSF1-1.1|OSF1-1.2)
1759
# OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
1761
# Hack: make package name same as library name
1762
SHLIB_LD='ld -R -export $@:'
1765
DL_OBJS="tclLoadOSF.o"
1771
# OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
1772
SHLIB_CFLAGS="-fPIC"
1773
AS_IF([test "$SHARED_BUILD" = 1], [SHLIB_LD="ld -shared"], [
1774
SHLIB_LD="ld -non_shared"
1778
DL_OBJS="tclLoadDl.o"
1786
AS_IF([test "$SHARED_BUILD" = 1], [
1787
SHLIB_LD='ld -shared -expect_unresolved "*"'
1789
SHLIB_LD='ld -non_shared -expect_unresolved "*"'
1792
DL_OBJS="tclLoadDl.o"
1794
AS_IF([test $doRpath = yes], [
1795
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1796
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
1797
AS_IF([test "$GCC" = yes], [CFLAGS="$CFLAGS -mieee"], [
1798
CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"])
1799
# see pthread_intro(3) for pthread support on osf1, k.furukawa
1800
AS_IF([test "${TCL_THREADS}" = 1], [
1801
CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
1802
CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
1803
LIBS=`echo $LIBS | sed s/-lpthreads//`
1804
AS_IF([test "$GCC" = yes], [
1805
LIBS="$LIBS -lpthread -lmach -lexc"
1807
CFLAGS="$CFLAGS -pthread"
1808
LDFLAGS="$LDFLAGS -pthread"
1814
# This may work for all QNX, but it was only reported for v6.
1815
SHLIB_CFLAGS="-fPIC"
1816
SHLIB_LD="ld -Bshareable -x"
1819
DL_OBJS="tclLoadDl.o"
1820
# dlopen is in -lc on QNX
1826
# Note, dlopen is available only on SCO 3.2.5 and greater. However,
1827
# this test works, since "uname -s" was non-standard in 3.2.4 and
1829
AS_IF([test "$GCC" = yes], [
1830
SHLIB_CFLAGS="-fPIC -melf"
1831
LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
1833
SHLIB_CFLAGS="-Kpic -belf"
1834
LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
1839
DL_OBJS="tclLoadDl.o"
1845
SHLIB_CFLAGS="-K PIC"
1849
DL_OBJS="tclLoadDl.o"
1859
DL_OBJS="tclLoadDl.o"
1861
CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
1862
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1864
# SunOS can't handle version numbers with dots in them in library
1865
# specs, like -ltcl7.5, so use -ltcl75 instead. Also, it
1866
# requires an extra version number at the end of .so file names.
1867
# So, the library has to have a name like libtcl75.so.1.0
1869
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
1870
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
1871
TCL_LIB_VERSIONS_OK=nodots
1874
# Careful to not let 5.10+ fall into this case
1876
# Note: If _REENTRANT isn't defined, then Solaris
1877
# won't define thread-safe library routines.
1879
AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
1880
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
1881
[Do we really want to follow the standard? Yes we do!])
1883
SHLIB_CFLAGS="-KPIC"
1885
DL_OBJS="tclLoadDl.o"
1887
AS_IF([test "$GCC" = yes], [
1888
SHLIB_LD='${CC} -shared'
1889
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
1890
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1892
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
1893
CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
1894
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1898
# Note: If _REENTRANT isn't defined, then Solaris
1899
# won't define thread-safe library routines.
1901
AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
1902
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
1903
[Do we really want to follow the standard? Yes we do!])
1905
SHLIB_CFLAGS="-KPIC"
1907
# Check to enable 64-bit flags for compiler/linker
1908
AS_IF([test "$do64bit" = yes], [
1910
AS_IF([test "$arch" = "sparcv9 sparc"], [
1911
AS_IF([test "$GCC" = yes], [
1912
AS_IF([test "`${CC} -dumpversion | awk -F. '{print [$]1}'`" -lt 3], [
1913
AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system])
1916
CFLAGS="$CFLAGS -m64 -mcpu=v9"
1917
LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
1918
SHLIB_CFLAGS="-fPIC"
1922
AS_IF([test "$do64bitVIS" = yes], [
1923
CFLAGS="$CFLAGS -xarch=v9a"
1924
LDFLAGS_ARCH="-xarch=v9a"
1926
CFLAGS="$CFLAGS -xarch=v9"
1927
LDFLAGS_ARCH="-xarch=v9"
1929
# Solaris 64 uses this as well
1930
#LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
1932
], [AS_IF([test "$arch" = "amd64 i386"], [
1933
AS_IF([test "$GCC" = yes], [
1935
SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*)
1937
CFLAGS="$CFLAGS -m64"
1938
LDFLAGS="$LDFLAGS -m64";;
1940
AC_MSG_WARN([64bit mode not supported with GCC on $system]);;
1945
SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*)
1946
CFLAGS="$CFLAGS -m64"
1947
LDFLAGS="$LDFLAGS -m64";;
1949
CFLAGS="$CFLAGS -xarch=amd64"
1950
LDFLAGS="$LDFLAGS -xarch=amd64";;
1953
], [AC_MSG_WARN([64bit mode not supported for $arch])])])
1956
#--------------------------------------------------------------------
1957
# On Solaris 5.x i386 with the sunpro compiler we need to link
1958
# with sunmath to get floating point rounding control
1959
#--------------------------------------------------------------------
1960
AS_IF([test "$GCC" = yes],[use_sunmath=no],[
1962
AC_MSG_CHECKING([whether to use -lsunmath for fp rounding control])
1963
AS_IF([test "$arch" = "amd64 i386"], [
1964
AC_MSG_RESULT([yes])
1965
MATH_LIBS="-lsunmath $MATH_LIBS"
1966
AC_CHECK_HEADER(sunmath.h)
1974
DL_OBJS="tclLoadDl.o"
1976
AS_IF([test "$GCC" = yes], [
1977
SHLIB_LD='${CC} -shared'
1978
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
1979
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1980
AS_IF([test "$do64bit_ok" = yes], [
1981
AS_IF([test "$arch" = "sparcv9 sparc"], [
1982
# We need to specify -static-libgcc or we need to
1983
# add the path to the sparv9 libgcc.
1984
SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
1985
# for finding sparcv9 libgcc, get the regular libgcc
1986
# path, remove so name and append 'sparcv9'
1987
#v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
1988
#CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
1989
], [AS_IF([test "$arch" = "amd64 i386"], [
1990
SHLIB_LD="$SHLIB_LD -m64 -static-libgcc"
1994
AS_IF([test "$use_sunmath" = yes], [textmode=textoff],[textmode=text])
1996
SunOS-5.[[1-9]][[0-9]]*)
1997
SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";;
1999
SHLIB_LD="/usr/ccs/bin/ld -G -z $textmode";;
2001
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
2002
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
2005
UNIX_SV* | UnixWare-5*)
2006
SHLIB_CFLAGS="-KPIC"
2010
DL_OBJS="tclLoadDl.o"
2012
# Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
2013
# that don't grok the -Bexport option. Test that it does.
2014
AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [
2015
hold_ldflags=$LDFLAGS
2016
LDFLAGS="$LDFLAGS -Wl,-Bexport"
2017
AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no)
2018
LDFLAGS=$hold_ldflags])
2019
AS_IF([test $tcl_cv_ld_Bexport = yes], [
2020
LDFLAGS="$LDFLAGS -Wl,-Bexport"
2027
AS_IF([test "$do64bit" = yes -a "$do64bit_ok" = no], [
2028
AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform])
2031
AS_IF([test "$do64bit" = yes -a "$do64bit_ok" = yes], [
2032
AC_DEFINE(TCL_CFG_DO64BIT, 1, [Is this a 64-bit build?])
2035
dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so
2036
dnl # until the end of configure, as configure's compile and link tests use
2037
dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's
2038
dnl # preprocessing tests use only CPPFLAGS.
2039
AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""])
2041
# Step 4: disable dynamic loading if requested via a command-line switch.
2044
AC_HELP_STRING([--enable-load],
2045
[allow dynamic loading and "load" command (default: on)]),
2046
[tcl_ok=$enableval], [tcl_ok=yes])
2047
AS_IF([test "$tcl_ok" = no], [DL_OBJS=""])
2049
AS_IF([test "x$DL_OBJS" != x], [BUILD_DLTEST="\$(DLTEST_TARGETS)"], [
2050
AC_MSG_WARN([Can't figure out how to do dynamic loading or shared libraries on this system.])
2054
DL_OBJS="tclLoadNone.o"
2056
LDFLAGS="$LDFLAGS_ORIG"
2061
LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
2063
# If we're running gcc, then change the C flags for compiling shared
2064
# libraries to the right flags for gcc, instead of those for the
2065
# standard manufacturer compiler.
2067
AS_IF([test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes], [
2073
NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
2076
*) SHLIB_CFLAGS="-fPIC" ;;
2079
AS_IF([test "$SHARED_LIB_SUFFIX" = ""], [
2080
SHARED_LIB_SUFFIX='${VERSION}${SHLIB_SUFFIX}'])
2081
AS_IF([test "$UNSHARED_LIB_SUFFIX" = ""], [
2082
UNSHARED_LIB_SUFFIX='${VERSION}.a'])
2084
AS_IF([test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""], [
2085
LIB_SUFFIX=${SHARED_LIB_SUFFIX}
2086
MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
2087
INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE)'
2089
LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}
2091
AS_IF([test "$RANLIB" = ""], [
2092
MAKE_LIB='$(STLIB_LD) [$]@ ${OBJS}'
2093
INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE)'
2095
MAKE_LIB='${STLIB_LD} [$]@ ${OBJS} ; ${RANLIB} [$]@'
2096
INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE) ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(LIB_FILE))'
2100
# Stub lib does not depend on shared/static configuration
2101
AS_IF([test "$RANLIB" = ""], [
2102
MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS}'
2103
INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"'
2105
MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS} ; ${RANLIB} [$]@'
2106
INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)"/$(STUB_LIB_FILE) ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(STUB_LIB_FILE))'
2109
# Define TCL_LIBS now that we know what DL_LIBS is.
2110
# The trick here is that we don't want to change the value of TCL_LIBS if
2111
# it is already set when tclConfig.sh had been loaded by Tk.
2112
AS_IF([test "x${TCL_LIBS}" = x], [
2113
TCL_LIBS="${DL_LIBS} ${LIBS} ${MATH_LIBS}"])
2116
# FIXME: This subst was left in only because the TCL_DL_LIBS
2117
# entry in tclConfig.sh uses it. It is not clear why someone
2118
# would use TCL_DL_LIBS instead of TCL_LIBS.
2126
AC_SUBST(CFLAGS_DEBUG)
2127
AC_SUBST(CFLAGS_OPTIMIZE)
2128
AC_SUBST(CFLAGS_WARNING)
2131
AC_SUBST(LDFLAGS_DEBUG)
2132
AC_SUBST(LDFLAGS_OPTIMIZE)
2133
AC_SUBST(CC_SEARCH_FLAGS)
2134
AC_SUBST(LD_SEARCH_FLAGS)
2138
AC_SUBST(TCL_SHLIB_LD_EXTRAS)
2139
AC_SUBST(TK_SHLIB_LD_EXTRAS)
2140
AC_SUBST(SHLIB_LD_LIBS)
2141
AC_SUBST(SHLIB_CFLAGS)
2142
AC_SUBST(SHLIB_SUFFIX)
2143
AC_DEFINE_UNQUOTED(TCL_SHLIB_EXT,"${SHLIB_SUFFIX}",
2144
[What is the default extension for shared libraries?])
2147
AC_SUBST(MAKE_STUB_LIB)
2148
AC_SUBST(INSTALL_LIB)
2149
AC_SUBST(INSTALL_STUB_LIB)
2153
#--------------------------------------------------------------------
2156
# Determine which interface to use to talk to the serial port.
2157
# Note that #include lines must begin in leftmost column for
2158
# some compilers to recognize them as preprocessor directives,
2159
# and some build environments have stdin not pointing at a
2160
# pseudo-terminal (usually /dev/null instead.)
2167
# Defines only one of the following vars:
2173
#--------------------------------------------------------------------
2175
AC_DEFUN([SC_SERIAL_PORT], [
2176
AC_CHECK_HEADERS(sys/modem.h)
2177
AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [
2179
#include <termios.h>
2183
if (tcgetattr(0, &t) == 0) {
2185
t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
2189
}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
2190
if test $tcl_cv_api_serial = no ; then
2196
if (ioctl(0, TCGETA, &t) == 0) {
2197
t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
2201
}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
2203
if test $tcl_cv_api_serial = no ; then
2209
if (ioctl(0, TIOCGETP, &t) == 0) {
2211
t.sg_flags |= ODDP | EVENP | RAW;
2215
}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
2217
if test $tcl_cv_api_serial = no ; then
2219
#include <termios.h>
2224
if (tcgetattr(0, &t) == 0
2225
|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
2227
t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
2231
}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
2233
if test $tcl_cv_api_serial = no; then
2240
if (ioctl(0, TCGETA, &t) == 0
2241
|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
2242
t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
2246
}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
2248
if test $tcl_cv_api_serial = no; then
2255
if (ioctl(0, TIOCGETP, &t) == 0
2256
|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
2258
t.sg_flags |= ODDP | EVENP | RAW;
2262
}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none)
2264
case $tcl_cv_api_serial in
2265
termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);;
2266
termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);;
2267
sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);;
2271
#--------------------------------------------------------------------
2272
# SC_MISSING_POSIX_HEADERS
2274
# Supply substitutes for missing POSIX header files. Special
2276
# - stdlib.h doesn't define strtol, strtoul, or
2277
# strtod insome versions of SunOS
2278
# - some versions of string.h don't declare procedures such
2286
# Defines some of the following vars:
2289
# HAVE_LIMITS_H or NO_LIMITS_H
2298
#--------------------------------------------------------------------
2300
AC_DEFUN([SC_MISSING_POSIX_HEADERS], [
2301
AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [
2302
AC_TRY_LINK([#include <sys/types.h>
2303
#include <dirent.h>], [
2304
#ifndef _POSIX_SOURCE
2307
* Generate compilation error to make the test fail: Lynx headers
2308
* are only valid if really in the POSIX environment.
2311
missing_procedure();
2315
struct dirent *entryPtr;
2317
d = opendir("foobar");
2318
entryPtr = readdir(d);
2319
p = entryPtr->d_name;
2321
], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)])
2323
if test $tcl_cv_dirent_h = no; then
2324
AC_DEFINE(NO_DIRENT_H, 1, [Do we have <dirent.h>?])
2327
AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have <float.h>?])])
2328
AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have <values.h>?])])
2329
AC_CHECK_HEADER(limits.h,
2330
[AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have <limits.h>?])],
2331
[AC_DEFINE(NO_LIMITS_H, 1, [Do we have <limits.h>?])])
2332
AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0)
2333
AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0)
2334
AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0)
2335
AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0)
2336
if test $tcl_ok = 0; then
2337
AC_DEFINE(NO_STDLIB_H, 1, [Do we have <stdlib.h>?])
2339
AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0)
2340
AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0)
2341
AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0)
2343
# See also memmove check below for a place where NO_STRING_H can be
2346
if test $tcl_ok = 0; then
2347
AC_DEFINE(NO_STRING_H, 1, [Do we have <string.h>?])
2350
AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have <sys/wait.h>?])])
2351
AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have <dlfcn.h>?])])
2353
# OS/390 lacks sys/param.h (and doesn't need it, by chance).
2354
AC_HAVE_HEADERS(sys/param.h)
2357
#--------------------------------------------------------------------
2360
# Locate the X11 header files and the X11 library archive. Try
2361
# the ac_path_x macro first, but if it doesn't find the X stuff
2362
# (e.g. because there's no xmkmf program) then check through
2363
# a list of possible directories. Under some conditions the
2364
# autoconf macro will return an include directory that contains
2365
# no include files, so double-check its result just to be safe.
2372
# Sets the following vars:
2376
#--------------------------------------------------------------------
2378
AC_DEFUN([SC_PATH_X], [
2381
if test "$no_x" = ""; then
2382
if test "$x_includes" = ""; then
2383
AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
2385
if test ! -r $x_includes/X11/Intrinsic.h; then
2386
not_really_there="yes"
2390
if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
2391
AC_MSG_CHECKING([for X11 header files])
2392
found_xincludes="no"
2393
AC_TRY_CPP([#include <X11/Intrinsic.h>], found_xincludes="yes", found_xincludes="no")
2394
if test "$found_xincludes" = "no"; then
2395
dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
2397
if test -r $i/X11/Intrinsic.h; then
2400
found_xincludes="yes"
2406
if test "$x_includes" != ""; then
2407
XINCLUDES="-I$x_includes"
2408
found_xincludes="yes"
2411
if test "$found_xincludes" = "no"; then
2412
AC_MSG_RESULT([couldn't find any!])
2415
if test "$no_x" = yes; then
2416
AC_MSG_CHECKING([for X11 libraries])
2418
dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
2420
if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then
2428
if test "$x_libraries" = ""; then
2431
XLIBSW="-L$x_libraries -lX11"
2434
if test "$XLIBSW" = nope ; then
2435
AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
2437
if test "$XLIBSW" = nope ; then
2438
AC_MSG_RESULT([could not find any! Using -lX11.])
2443
#--------------------------------------------------------------------
2446
# The statements below check for systems where POSIX-style
2447
# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented.
2448
# On these systems (mostly older ones), use the old BSD-style
2449
# FIONBIO approach instead.
2456
# Defines some of the following vars:
2462
#--------------------------------------------------------------------
2464
AC_DEFUN([SC_BLOCKING_STYLE], [
2465
AC_CHECK_HEADERS(sys/ioctl.h)
2466
AC_CHECK_HEADERS(sys/filio.h)
2468
AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O])
2470
# There used to be code here to use FIONBIO under AIX. However, it
2471
# was reported that FIONBIO doesn't work under AIX 3.2.5. Since
2472
# using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO
2473
# code (JO, 5/31/97).
2476
AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
2477
AC_MSG_RESULT([FIONBIO])
2480
AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
2481
AC_MSG_RESULT([FIONBIO])
2484
AC_MSG_RESULT([O_NONBLOCK])
2489
#--------------------------------------------------------------------
2492
# Checks how the system deals with time.h, what time structures
2493
# are used on the system, and what fields the structures have.
2500
# Defines some of the following vars:
2506
#--------------------------------------------------------------------
2508
AC_DEFUN([SC_TIME_HANDLER], [
2509
AC_CHECK_HEADERS(sys/time.h)
2512
AC_CHECK_FUNCS(gmtime_r localtime_r mktime)
2514
AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [
2515
AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;],
2516
tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)])
2517
if test $tcl_cv_member_tm_tzadj = yes ; then
2518
AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?])
2521
AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [
2522
AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
2523
tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)])
2524
if test $tcl_cv_member_tm_gmtoff = yes ; then
2525
AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?])
2529
# Its important to include time.h in this check, as some systems
2530
# (like convex) have timezone functions, etc.
2532
AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [
2533
AC_TRY_COMPILE([#include <time.h>],
2534
[extern long timezone;
2537
tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)])
2538
if test $tcl_cv_timezone_long = yes ; then
2539
AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
2542
# On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
2544
AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [
2545
AC_TRY_COMPILE([#include <time.h>],
2546
[extern time_t timezone;
2549
tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)])
2550
if test $tcl_cv_timezone_time = yes ; then
2551
AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
2556
#--------------------------------------------------------------------
2559
# Under Solaris 2.4, strtod returns the wrong value for the
2560
# terminating character under some conditions. Check for this
2561
# and if the problem exists use a substitute procedure
2562
# "fixstrtod" (provided by Tcl) that corrects the error.
2563
# Also, on Compaq's Tru64 Unix 5.0,
2564
# strtod(" ") returns 0.0 instead of a failure to convert.
2571
# Might defines some of the following vars:
2572
# strtod (=fixstrtod)
2574
#--------------------------------------------------------------------
2576
AC_DEFUN([SC_BUGGY_STRTOD], [
2577
AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0)
2578
if test "$tcl_strtod" = 1; then
2579
AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[
2581
extern double strtod();
2583
char *infString="Inf", *nanString="NaN", *spaceString=" ";
2586
value = strtod(infString, &term);
2587
if ((term != infString) && (term[-1] == 0)) {
2590
value = strtod(nanString, &term);
2591
if ((term != nanString) && (term[-1] == 0)) {
2594
value = strtod(spaceString, &term);
2595
if (term == (spaceString+1)) {
2599
}], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy,
2600
tcl_cv_strtod_buggy=buggy)])
2601
if test "$tcl_cv_strtod_buggy" = buggy; then
2602
AC_LIBOBJ([fixstrtod])
2604
AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?])
2609
#--------------------------------------------------------------------
2612
# Search for the libraries needed to link the Tcl shell.
2613
# Things like the math library (-lm) and socket stuff (-lsocket vs.
2614
# -lnsl) are dealt with here.
2621
# Might append to the following vars:
2625
# Might define the following vars:
2628
#--------------------------------------------------------------------
2630
AC_DEFUN([SC_TCL_LINK_LIBS], [
2631
#--------------------------------------------------------------------
2632
# On a few very rare systems, all of the libm.a stuff is
2633
# already in libc.a. Set compiler flags accordingly.
2634
# Also, Linux requires the "ieee" library for math to work
2635
# right (and it must appear before "-lm").
2636
#--------------------------------------------------------------------
2638
AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm")
2639
AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])
2641
#--------------------------------------------------------------------
2642
# Interactive UNIX requires -linet instead of -lsocket, plus it
2643
# needs net/errno.h to define the socket-related error codes.
2644
#--------------------------------------------------------------------
2646
AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"])
2647
AC_CHECK_HEADER(net/errno.h, [
2648
AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have <net/errno.h>?])])
2650
#--------------------------------------------------------------------
2651
# Check for the existence of the -lsocket and -lnsl libraries.
2652
# The order here is important, so that they end up in the right
2653
# order in the command line generated by make. Here are some
2654
# special considerations:
2655
# 1. Use "connect" and "accept" to check for -lsocket, and
2656
# "gethostbyname" to check for -lnsl.
2657
# 2. Use each function name only once: can't redo a check because
2658
# autoconf caches the results of the last check and won't redo it.
2659
# 3. Use -lnsl and -lsocket only if they supply procedures that
2660
# aren't already present in the normal libraries. This is because
2661
# IRIX 5.2 has libraries, but they aren't needed and they're
2662
# bogus: they goof up name resolution if used.
2663
# 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
2664
# To get around this problem, check for both libraries together
2665
# if -lsocket doesn't work by itself.
2666
#--------------------------------------------------------------------
2669
AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
2670
if test "$tcl_checkSocket" = 1; then
2671
AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt,
2672
LIBS="$LIBS -lsocket", tcl_checkBoth=1)])
2674
if test "$tcl_checkBoth" = 1; then
2676
LIBS="$LIBS -lsocket -lnsl"
2677
AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs])
2679
AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname,
2680
[LIBS="$LIBS -lnsl"])])
2683
#--------------------------------------------------------------------
2684
# SC_TCL_EARLY_FLAGS
2686
# Check for what flags are needed to be passed so the correct OS
2687
# features are available.
2694
# Might define the following vars:
2696
# _LARGEFILE64_SOURCE
2697
# _LARGEFILE_SOURCE64
2699
#--------------------------------------------------------------------
2701
AC_DEFUN([SC_TCL_EARLY_FLAG],[
2702
AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
2703
AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,
2704
AC_TRY_COMPILE([[#define ]$1[ 1
2706
[tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
2707
[tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)))
2708
if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then
2709
AC_DEFINE($1, 1, [Add the ]$1[ flag when building])
2710
tcl_flags="$tcl_flags $1"
2714
AC_DEFUN([SC_TCL_EARLY_FLAGS],[
2715
AC_MSG_CHECKING([for required early compiler flags])
2717
SC_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include <stdlib.h>],
2718
[char *p = (char *)strtoll; char *q = (char *)strtoull;])
2719
SC_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include <sys/stat.h>],
2720
[struct stat64 buf; int i = stat64("/", &buf);])
2721
SC_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include <sys/stat.h>],
2722
[char *p = (char *)open64;])
2723
if test "x${tcl_flags}" = "x" ; then
2724
AC_MSG_RESULT([none])
2726
AC_MSG_RESULT([${tcl_flags}])
2730
#--------------------------------------------------------------------
2731
# SC_TCL_64BIT_FLAGS
2733
# Check for what is defined in the way of 64-bit features.
2740
# Might define the following vars:
2741
# TCL_WIDE_INT_IS_LONG
2743
# HAVE_STRUCT_DIRENT64
2744
# HAVE_STRUCT_STAT64
2747
#--------------------------------------------------------------------
2749
AC_DEFUN([SC_TCL_64BIT_FLAGS], [
2750
AC_MSG_CHECKING([for 64-bit integer type])
2751
AC_CACHE_VAL(tcl_cv_type_64bit,[
2752
tcl_cv_type_64bit=none
2753
# See if the compiler knows natively about __int64
2754
AC_TRY_COMPILE(,[__int64 value = (__int64) 0;],
2755
tcl_type_64bit=__int64, tcl_type_64bit="long long")
2756
# See if we should use long anyway Note that we substitute in the
2757
# type that is our current guess for a 64-bit type inside this check
2758
# program, so it should be modified only carefully...
2759
AC_TRY_COMPILE(,[switch (0) {
2760
case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ;
2761
}],tcl_cv_type_64bit=${tcl_type_64bit})])
2762
if test "${tcl_cv_type_64bit}" = none ; then
2763
AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?])
2764
AC_MSG_RESULT([using long])
2766
AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit},
2767
[What type should be used to define wide integers?])
2768
AC_MSG_RESULT([${tcl_cv_type_64bit}])
2770
# Now check for auxiliary declarations
2771
AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[
2772
AC_TRY_COMPILE([#include <sys/types.h>
2773
#include <sys/dirent.h>],[struct dirent64 p;],
2774
tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)])
2775
if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
2776
AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in <sys/types.h>?])
2779
AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[
2780
AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p;
2782
tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)])
2783
if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
2784
AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in <sys/stat.h>?])
2787
AC_CHECK_FUNCS(open64 lseek64)
2788
AC_MSG_CHECKING([for off64_t])
2789
AC_CACHE_VAL(tcl_cv_type_off64_t,[
2790
AC_TRY_COMPILE([#include <sys/types.h>],[off64_t offset;
2792
tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)])
2793
dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the
2794
dnl functions lseek64 and open64 are defined.
2795
if test "x${tcl_cv_type_off64_t}" = "xyes" && \
2796
test "x${ac_cv_func_lseek64}" = "xyes" && \
2797
test "x${ac_cv_func_open64}" = "xyes" ; then
2798
AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in <sys/types.h>?])
2799
AC_MSG_RESULT([yes])
2806
#--------------------------------------------------------------------
2807
# SC_TCL_CFG_ENCODING TIP #59
2809
# Declare the encoding to use for embedded configuration information.
2815
# Might append to the following vars:
2818
# Will define the following vars:
2819
# TCL_CFGVAL_ENCODING
2821
#--------------------------------------------------------------------
2823
AC_DEFUN([SC_TCL_CFG_ENCODING], [
2824
AC_ARG_WITH(encoding,
2825
AC_HELP_STRING([--with-encoding],
2826
[encoding for configuration values (default: iso8859-1)]),
2827
with_tcencoding=${withval})
2829
if test x"${with_tcencoding}" != x ; then
2830
AC_DEFINE_UNQUOTED(TCL_CFGVAL_ENCODING,"${with_tcencoding}",
2831
[What encoding should be used for embedded configuration info?])
2833
AC_DEFINE(TCL_CFGVAL_ENCODING,"iso8859-1",
2834
[What encoding should be used for embedded configuration info?])
2838
#--------------------------------------------------------------------
2839
# SC_TCL_CHECK_BROKEN_FUNC
2841
# Check for broken function.
2844
# funcName - function to test for
2845
# advancedTest - the advanced test to run if the function is present
2848
# Might cause compatability versions of the function to be used.
2849
# Might affect the following vars:
2850
# USE_COMPAT (implicit)
2852
#--------------------------------------------------------------------
2854
AC_DEFUN([SC_TCL_CHECK_BROKEN_FUNC],[
2855
AC_CHECK_FUNC($1, tcl_ok=1, tcl_ok=0)
2856
if test ["$tcl_ok"] = 1; then
2857
AC_CACHE_CHECK([proper ]$1[ implementation], [tcl_cv_]$1[_unbroken],
2858
AC_TRY_RUN([[int main() {]$2[}]],[tcl_cv_]$1[_unbroken]=ok,
2859
[tcl_cv_]$1[_unbroken]=broken,[tcl_cv_]$1[_unbroken]=unknown))
2860
if test ["$tcl_cv_]$1[_unbroken"] = "ok"; then
2866
if test ["$tcl_ok"] = 0; then
2872
#--------------------------------------------------------------------
2873
# SC_TCL_GETHOSTBYADDR_R
2875
# Check if we have MT-safe variant of gethostbyaddr().
2882
# Might define the following vars:
2883
# HAVE_GETHOSTBYADDR_R
2884
# HAVE_GETHOSTBYADDR_R_7
2885
# HAVE_GETHOSTBYADDR_R_8
2887
#--------------------------------------------------------------------
2889
AC_DEFUN([SC_TCL_GETHOSTBYADDR_R], [AC_CHECK_FUNC(gethostbyaddr_r, [
2890
AC_CACHE_CHECK([for gethostbyaddr_r with 7 args], tcl_cv_api_gethostbyaddr_r_7, [
2897
struct hostent *result;
2902
(void) gethostbyaddr_r(addr, length, type, result, buffer, buflen,
2904
], tcl_cv_api_gethostbyaddr_r_7=yes, tcl_cv_api_gethostbyaddr_r_7=no)])
2905
tcl_ok=$tcl_cv_api_gethostbyaddr_r_7
2906
if test "$tcl_ok" = yes; then
2907
AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1,
2908
[Define to 1 if gethostbyaddr_r takes 7 args.])
2910
AC_CACHE_CHECK([for gethostbyaddr_r with 8 args], tcl_cv_api_gethostbyaddr_r_8, [
2917
struct hostent *result, *resultp;
2922
(void) gethostbyaddr_r(addr, length, type, result, buffer, buflen,
2923
&resultp, &h_errnop);
2924
], tcl_cv_api_gethostbyaddr_r_8=yes, tcl_cv_api_gethostbyaddr_r_8=no)])
2925
tcl_ok=$tcl_cv_api_gethostbyaddr_r_8
2926
if test "$tcl_ok" = yes; then
2927
AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1,
2928
[Define to 1 if gethostbyaddr_r takes 8 args.])
2931
if test "$tcl_ok" = yes; then
2932
AC_DEFINE(HAVE_GETHOSTBYADDR_R, 1,
2933
[Define to 1 if gethostbyaddr_r is available.])
2937
#--------------------------------------------------------------------
2938
# SC_TCL_GETHOSTBYNAME_R
2940
# Check to see what variant of gethostbyname_r() we have.
2941
# Based on David Arnold's example from the comp.programming.threads
2949
# Might define the following vars:
2950
# HAVE_GETHOSTBYADDR_R
2951
# HAVE_GETHOSTBYADDR_R_3
2952
# HAVE_GETHOSTBYADDR_R_5
2953
# HAVE_GETHOSTBYADDR_R_6
2955
#--------------------------------------------------------------------
2957
AC_DEFUN([SC_TCL_GETHOSTBYNAME_R], [AC_CHECK_FUNC(gethostbyname_r, [
2958
AC_CACHE_CHECK([for gethostbyname_r with 6 args], tcl_cv_api_gethostbyname_r_6, [
2963
struct hostent *he, *res;
2968
(void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop);
2969
], tcl_cv_api_gethostbyname_r_6=yes, tcl_cv_api_gethostbyname_r_6=no)])
2970
tcl_ok=$tcl_cv_api_gethostbyname_r_6
2971
if test "$tcl_ok" = yes; then
2972
AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1,
2973
[Define to 1 if gethostbyname_r takes 6 args.])
2975
AC_CACHE_CHECK([for gethostbyname_r with 5 args], tcl_cv_api_gethostbyname_r_5, [
2985
(void) gethostbyname_r(name, he, buffer, buflen, &h_errnop);
2986
], tcl_cv_api_gethostbyname_r_5=yes, tcl_cv_api_gethostbyname_r_5=no)])
2987
tcl_ok=$tcl_cv_api_gethostbyname_r_5
2988
if test "$tcl_ok" = yes; then
2989
AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1,
2990
[Define to 1 if gethostbyname_r takes 5 args.])
2992
AC_CACHE_CHECK([for gethostbyname_r with 3 args], tcl_cv_api_gethostbyname_r_3, [
2998
struct hostent_data data;
3000
(void) gethostbyname_r(name, he, &data);
3001
], tcl_cv_api_gethostbyname_r_3=yes, tcl_cv_api_gethostbyname_r_3=no)])
3002
tcl_ok=$tcl_cv_api_gethostbyname_r_3
3003
if test "$tcl_ok" = yes; then
3004
AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1,
3005
[Define to 1 if gethostbyname_r takes 3 args.])
3009
if test "$tcl_ok" = yes; then
3010
AC_DEFINE(HAVE_GETHOSTBYNAME_R, 1,
3011
[Define to 1 if gethostbyname_r is available.])
3015
#--------------------------------------------------------------------
3016
# SC_TCL_GETADDRINFO
3018
# Check if we have 'getaddrinfo'
3024
# Might define the following vars:
3027
#--------------------------------------------------------------------
3029
AC_DEFUN([SC_TCL_GETADDRINFO], [AC_CHECK_FUNC(getaddrinfo, [
3030
AC_CACHE_CHECK([for working getaddrinfo], tcl_cv_api_getaddrinfo, [
3034
const char *name, *port;
3035
struct addrinfo *aiPtr, hints;
3036
(void)getaddrinfo(name,port, &hints, &aiPtr);
3037
(void)freeaddrinfo(aiPtr);
3038
], tcl_cv_api_getaddrinfo=yes, tcl_cv_getaddrinfo=no)])
3039
tcl_ok=$tcl_cv_api_getaddrinfo
3040
if test "$tcl_ok" = yes; then
3041
AC_DEFINE(HAVE_GETADDRINFO, 1,
3042
[Define to 1 if getaddrinfo is available.])
3046
#--------------------------------------------------------------------
3049
# Check if we have MT-safe variant of getpwuid() and if yes,
3050
# which one exactly.
3057
# Might define the following vars:
3062
#--------------------------------------------------------------------
3064
AC_DEFUN([SC_TCL_GETPWUID_R], [AC_CHECK_FUNC(getpwuid_r, [
3065
AC_CACHE_CHECK([for getpwuid_r with 5 args], tcl_cv_api_getpwuid_r_5, [
3067
#include <sys/types.h>
3071
struct passwd pw, *pwp;
3075
(void) getpwuid_r(uid, &pw, buf, buflen, &pwp);
3076
], tcl_cv_api_getpwuid_r_5=yes, tcl_cv_api_getpwuid_r_5=no)])
3077
tcl_ok=$tcl_cv_api_getpwuid_r_5
3078
if test "$tcl_ok" = yes; then
3079
AC_DEFINE(HAVE_GETPWUID_R_5, 1,
3080
[Define to 1 if getpwuid_r takes 5 args.])
3082
AC_CACHE_CHECK([for getpwuid_r with 4 args], tcl_cv_api_getpwuid_r_4, [
3084
#include <sys/types.h>
3092
(void)getpwnam_r(uid, &pw, buf, buflen);
3093
], tcl_cv_api_getpwuid_r_4=yes, tcl_cv_api_getpwuid_r_4=no)])
3094
tcl_ok=$tcl_cv_api_getpwuid_r_4
3095
if test "$tcl_ok" = yes; then
3096
AC_DEFINE(HAVE_GETPWUID_R_4, 1,
3097
[Define to 1 if getpwuid_r takes 4 args.])
3100
if test "$tcl_ok" = yes; then
3101
AC_DEFINE(HAVE_GETPWUID_R, 1,
3102
[Define to 1 if getpwuid_r is available.])
3106
#--------------------------------------------------------------------
3109
# Check if we have MT-safe variant of getpwnam() and if yes,
3110
# which one exactly.
3117
# Might define the following vars:
3122
#--------------------------------------------------------------------
3124
AC_DEFUN([SC_TCL_GETPWNAM_R], [AC_CHECK_FUNC(getpwnam_r, [
3125
AC_CACHE_CHECK([for getpwnam_r with 5 args], tcl_cv_api_getpwnam_r_5, [
3127
#include <sys/types.h>
3131
struct passwd pw, *pwp;
3135
(void) getpwnam_r(name, &pw, buf, buflen, &pwp);
3136
], tcl_cv_api_getpwnam_r_5=yes, tcl_cv_api_getpwnam_r_5=no)])
3137
tcl_ok=$tcl_cv_api_getpwnam_r_5
3138
if test "$tcl_ok" = yes; then
3139
AC_DEFINE(HAVE_GETPWNAM_R_5, 1,
3140
[Define to 1 if getpwnam_r takes 5 args.])
3142
AC_CACHE_CHECK([for getpwnam_r with 4 args], tcl_cv_api_getpwnam_r_4, [
3144
#include <sys/types.h>
3152
(void)getpwnam_r(name, &pw, buf, buflen);
3153
], tcl_cv_api_getpwnam_r_4=yes, tcl_cv_api_getpwnam_r_4=no)])
3154
tcl_ok=$tcl_cv_api_getpwnam_r_4
3155
if test "$tcl_ok" = yes; then
3156
AC_DEFINE(HAVE_GETPWNAM_R_4, 1,
3157
[Define to 1 if getpwnam_r takes 4 args.])
3160
if test "$tcl_ok" = yes; then
3161
AC_DEFINE(HAVE_GETPWNAM_R, 1,
3162
[Define to 1 if getpwnam_r is available.])
3166
#--------------------------------------------------------------------
3169
# Check if we have MT-safe variant of getgrgid() and if yes,
3170
# which one exactly.
3177
# Might define the following vars:
3182
#--------------------------------------------------------------------
3184
AC_DEFUN([SC_TCL_GETGRGID_R], [AC_CHECK_FUNC(getgrgid_r, [
3185
AC_CACHE_CHECK([for getgrgid_r with 5 args], tcl_cv_api_getgrgid_r_5, [
3187
#include <sys/types.h>
3191
struct group gr, *grp;
3195
(void) getgrgid_r(gid, &gr, buf, buflen, &grp);
3196
], tcl_cv_api_getgrgid_r_5=yes, tcl_cv_api_getgrgid_r_5=no)])
3197
tcl_ok=$tcl_cv_api_getgrgid_r_5
3198
if test "$tcl_ok" = yes; then
3199
AC_DEFINE(HAVE_GETGRGID_R_5, 1,
3200
[Define to 1 if getgrgid_r takes 5 args.])
3202
AC_CACHE_CHECK([for getgrgid_r with 4 args], tcl_cv_api_getgrgid_r_4, [
3204
#include <sys/types.h>
3212
(void)getgrgid_r(gid, &gr, buf, buflen);
3213
], tcl_cv_api_getgrgid_r_4=yes, tcl_cv_api_getgrgid_r_4=no)])
3214
tcl_ok=$tcl_cv_api_getgrgid_r_4
3215
if test "$tcl_ok" = yes; then
3216
AC_DEFINE(HAVE_GETGRGID_R_4, 1,
3217
[Define to 1 if getgrgid_r takes 4 args.])
3220
if test "$tcl_ok" = yes; then
3221
AC_DEFINE(HAVE_GETGRGID_R, 1,
3222
[Define to 1 if getgrgid_r is available.])
3226
#--------------------------------------------------------------------
3229
# Check if we have MT-safe variant of getgrnam() and if yes,
3230
# which one exactly.
3237
# Might define the following vars:
3242
#--------------------------------------------------------------------
3244
AC_DEFUN([SC_TCL_GETGRNAM_R], [AC_CHECK_FUNC(getgrnam_r, [
3245
AC_CACHE_CHECK([for getgrnam_r with 5 args], tcl_cv_api_getgrnam_r_5, [
3247
#include <sys/types.h>
3251
struct group gr, *grp;
3255
(void) getgrnam_r(name, &gr, buf, buflen, &grp);
3256
], tcl_cv_api_getgrnam_r_5=yes, tcl_cv_api_getgrnam_r_5=no)])
3257
tcl_ok=$tcl_cv_api_getgrnam_r_5
3258
if test "$tcl_ok" = yes; then
3259
AC_DEFINE(HAVE_GETGRNAM_R_5, 1,
3260
[Define to 1 if getgrnam_r takes 5 args.])
3262
AC_CACHE_CHECK([for getgrnam_r with 4 args], tcl_cv_api_getgrnam_r_4, [
3264
#include <sys/types.h>
3272
(void)getgrnam_r(name, &gr, buf, buflen);
3273
], tcl_cv_api_getgrnam_r_4=yes, tcl_cv_api_getgrnam_r_4=no)])
3274
tcl_ok=$tcl_cv_api_getgrnam_r_4
3275
if test "$tcl_ok" = yes; then
3276
AC_DEFINE(HAVE_GETGRNAM_R_4, 1,
3277
[Define to 1 if getgrnam_r takes 4 args.])
3280
if test "$tcl_ok" = yes; then
3281
AC_DEFINE(HAVE_GETGRNAM_R, 1,
3282
[Define to 1 if getgrnam_r is available.])