Tcl Source Code

Check-in [a5996386b3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update autogoo for gettimeofday(). Thanks Joe English.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: a5996386b37f7ec1f39799af17109265fee11d72
User & Date: dgp 2012-06-08 13:14:19
Context
2012-06-11
17:34
3532959 Make sure the lifetime management of entries in the linePBodyPtr hash table can tolerate eit... check-in: 20de131aef user: dgp tags: core-8-5-branch
2012-06-08
15:51
Work in progress fixing 3532959 check-in: efc5b0fe61 user: dgp tags: bug-3532959
13:25
3530533 Centralize #include <pthread.h> in the tclUnixPort.h header so that old unix systems that ne... check-in: a790f23b77 user: dgp tags: trunk
13:14
Update autogoo for gettimeofday(). Thanks Joe English. check-in: a5996386b3 user: dgp tags: core-8-5-branch
13:04
Update autogoo for gettimeofday(). Thanks Joe English. check-in: f6e87a9442 user: dgp tags: core-8-4-branch
13:00
3530533 Centralize #include <pthread.h> in the tclUnixPort.h header so that old unix systems that ne... check-in: bd718144bf user: dgp tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.

1




2
3
4
5
6
7
8
2012-06-08  Don Porter  <[email protected]>





	* unix/tclUnixPort.h:	[Bug 3530533] Centralize #include <pthread.h>
	* unix/tclUnixThrd.c:	in the tclUnixPort.h header so that old unix
	systems that need inclusion in all compilation units are supported.

2012-06-06  Jan Nijtmans  <[email protected]>


>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
2012-06-08  Don Porter  <[email protected]>

	* unix/configure.in:	Update autogoo for gettimeofday().
	* unix/tclUnixPort.h:	Thanks Joe English.
	* unix/configure:	autoconf 2.13

	* unix/tclUnixPort.h:	[Bug 3530533] Centralize #include <pthread.h>
	* unix/tclUnixThrd.c:	in the tclUnixPort.h header so that old unix
	systems that need inclusion in all compilation units are supported.

2012-06-06  Jan Nijtmans  <[email protected]>

Changes to unix/configure.

16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
    USE_COMPAT=1
fi

#--------------------------------------------------------------------
#	The code below deals with several issues related to gettimeofday:
#	1. Some systems don't provide a gettimeofday function at all
#	   (set NO_GETTOD if this is the case).
#	2. SGI systems don't use the BSD form of the gettimeofday function,
#	   but they have a BSDgettimeofday function that can be used instead.
#	3. See if gettimeofday is declared in the <sys/time.h> header file.
#	   if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can
#	   declare it.
#--------------------------------------------------------------------

echo "$as_me:$LINENO: checking for BSDgettimeofday" >&5
echo $ECHO_N "checking for BSDgettimeofday... $ECHO_C" >&6
if test "${ac_cv_func_BSDgettimeofday+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define BSDgettimeofday to an innocuous variant, in case <limits.h> declares BSDgettimeofday.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define BSDgettimeofday innocuous_BSDgettimeofday

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char BSDgettimeofday (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef BSDgettimeofday

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char BSDgettimeofday ();
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_BSDgettimeofday) || defined (__stub___BSDgettimeofday)
choke me
#else
char (*f) () = BSDgettimeofday;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != BSDgettimeofday;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_BSDgettimeofday=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func_BSDgettimeofday=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_BSDgettimeofday" >&5
echo "${ECHO_T}$ac_cv_func_BSDgettimeofday" >&6
if test $ac_cv_func_BSDgettimeofday = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_BSDGETTIMEOFDAY 1
_ACEOF

else

    echo "$as_me:$LINENO: checking for gettimeofday" >&5
echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
if test "${ac_cv_func_gettimeofday+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF







<
<
|




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|







16169
16170
16171
16172
16173
16174
16175


16176
16177
16178
16179
16180


































































































16181
16182
16183
16184
16185
16186
16187
16188
    USE_COMPAT=1
fi

#--------------------------------------------------------------------
#	The code below deals with several issues related to gettimeofday:
#	1. Some systems don't provide a gettimeofday function at all
#	   (set NO_GETTOD if this is the case).


#	2. See if gettimeofday is declared in the <sys/time.h> header file.
#	   if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can
#	   declare it.
#--------------------------------------------------------------------



































































































echo "$as_me:$LINENO: checking for gettimeofday" >&5
echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
if test "${ac_cv_func_gettimeofday+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
16367
16368
16369
16370
16371
16372
16373

16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_gettimeofday" >&5
echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
if test $ac_cv_func_gettimeofday = yes; then
  :
else


cat >>confdefs.h <<\_ACEOF
#define NO_GETTOD 1
_ACEOF

fi


fi

echo "$as_me:$LINENO: checking for gettimeofday declaration" >&5
echo $ECHO_N "checking for gettimeofday declaration... $ECHO_C" >&6
if test "${tcl_cv_grep_gettimeofday+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6







>





<
<







16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279


16280
16281
16282
16283
16284
16285
16286
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_gettimeofday" >&5
echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
if test $ac_cv_func_gettimeofday = yes; then
  :
else


cat >>confdefs.h <<\_ACEOF
#define NO_GETTOD 1
_ACEOF




fi

echo "$as_me:$LINENO: checking for gettimeofday declaration" >&5
echo $ECHO_N "checking for gettimeofday declaration... $ECHO_C" >&6
if test "${tcl_cv_grep_gettimeofday+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6

Changes to unix/configure.in.

411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
    USE_COMPAT=1
fi

#--------------------------------------------------------------------
#	The code below deals with several issues related to gettimeofday:
#	1. Some systems don't provide a gettimeofday function at all
#	   (set NO_GETTOD if this is the case).
#	2. SGI systems don't use the BSD form of the gettimeofday function,
#	   but they have a BSDgettimeofday function that can be used instead.
#	3. See if gettimeofday is declared in the <sys/time.h> header file.
#	   if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can
#	   declare it.
#--------------------------------------------------------------------

AC_CHECK_FUNC(BSDgettimeofday,
    [AC_DEFINE(HAVE_BSDGETTIMEOFDAY, 1, [Do we have BSDgettimeofday()?])], [
    AC_CHECK_FUNC(gettimeofday, , [AC_DEFINE(NO_GETTOD, 1, [Do we have gettimeofday()?])])
])
AC_CACHE_CHECK([for gettimeofday declaration], tcl_cv_grep_gettimeofday, [
    AC_EGREP_HEADER(gettimeofday, sys/time.h,
	tcl_cv_grep_gettimeofday=present, tcl_cv_grep_gettimeofday=missing)])
if test $tcl_cv_grep_gettimeofday = missing ; then
    AC_DEFINE(GETTOD_NOT_DECLARED, 1, [Is gettimeofday() actually declared in <sys/time.h>?])
fi







<
<
|




|
<
|







411
412
413
414
415
416
417


418
419
420
421
422
423

424
425
426
427
428
429
430
431
    USE_COMPAT=1
fi

#--------------------------------------------------------------------
#	The code below deals with several issues related to gettimeofday:
#	1. Some systems don't provide a gettimeofday function at all
#	   (set NO_GETTOD if this is the case).


#	2. See if gettimeofday is declared in the <sys/time.h> header file.
#	   if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can
#	   declare it.
#--------------------------------------------------------------------

AC_CHECK_FUNC(gettimeofday,[],[

    AC_DEFINE(NO_GETTOD, 1, [Do we have gettimeofday()?])
])
AC_CACHE_CHECK([for gettimeofday declaration], tcl_cv_grep_gettimeofday, [
    AC_EGREP_HEADER(gettimeofday, sys/time.h,
	tcl_cv_grep_gettimeofday=present, tcl_cv_grep_gettimeofday=missing)])
if test $tcl_cv_grep_gettimeofday = missing ; then
    AC_DEFINE(GETTOD_NOT_DECLARED, 1, [Is gettimeofday() actually declared in <sys/time.h>?])
fi

Changes to unix/tclUnixPort.h.

272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
/*
 * The stuff below is needed by the "time" command.  If this system has no
 * gettimeofday call, then must use times() instead.
 */

#ifdef NO_GETTOD
#   include <sys/times.h>
#else
#   ifdef HAVE_BSDGETTIMEOFDAY
#	define gettimeofday BSDgettimeofday
#   endif
#endif

#ifdef GETTOD_NOT_DECLARED
EXTERN int		gettimeofday (struct timeval *tp,
			    struct timezone *tzp);
#endif








<
<
<
<







272
273
274
275
276
277
278




279
280
281
282
283
284
285
/*
 * The stuff below is needed by the "time" command.  If this system has no
 * gettimeofday call, then must use times() instead.
 */

#ifdef NO_GETTOD
#   include <sys/times.h>




#endif

#ifdef GETTOD_NOT_DECLARED
EXTERN int		gettimeofday (struct timeval *tp,
			    struct timezone *tzp);
#endif