From aff7b3a781eb570bb02e57d7111406466e1b63f6 Mon Sep 17 00:00:00 2001 From: srittau Date: Mon, 15 Dec 2003 05:27:24 +0000 Subject: [PATCH] Check for struct tm.tm_gmtoff instead of defining NO_STRUCT_TM_GMTOFF on a per-architecture basis. --- bin/megatron/macbin.c | 6 ++--- configure.in | 47 ++++++++++++++++++++-------------- sys/solaris/Makefile.kernel.in | 4 +-- 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/bin/megatron/macbin.c b/bin/megatron/macbin.c index e6f52d50..b98ef757 100644 --- a/bin/megatron/macbin.c +++ b/bin/megatron/macbin.c @@ -1,5 +1,5 @@ /* - * $Id: macbin.c,v 1.10 2002-02-16 17:12:53 srittau Exp $ + * $Id: macbin.c,v 1.11 2003-12-15 05:27:24 srittau Exp $ */ #ifdef HAVE_CONFIG_H @@ -85,12 +85,12 @@ int bin_open( binfile, flags, fh, options ) /* call localtime so that we get the timezone offset */ bin.gmtoff = 0; -#ifndef NO_STRUCT_TM_GMTOFF +#ifdef HAVE_STRUCT_TM_TM_GMTOFF time(&t); tp = localtime(&t); if (tp) bin.gmtoff = tp->tm_gmtoff; -#endif /* ! NO_STRUCT_TM_GMTOFF */ +#endif /* HAVE_STRUCT_TM_TM_GMTOFF */ if ( flags == O_RDONLY ) { /* input */ if ( strcmp( binfile, STDIN ) == 0 ) { diff --git a/configure.in b/configure.in index dcf9b175..bd947583 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -dnl $Id: configure.in,v 1.195 2003-12-15 05:05:19 srittau Exp $ +dnl $Id: configure.in,v 1.196 2003-12-15 05:27:24 srittau Exp $ dnl configure.in for netatalk AC_INIT(etc/afpd/main.c) @@ -10,7 +10,10 @@ AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION}) AM_CONFIG_HEADER(config.h) +dnl dnl Checks for programs. +dnl + AC_PROG_AWK AC_PROG_CC AC_PROG_INSTALL @@ -24,12 +27,15 @@ AC_PROG_PS AC_PROG_DVIPS AC_PROG_TROFF2PS +dnl +dnl Checks for libraries. +dnl + dnl ********************************************************************* dnl FIXME! FIXME! These should be selectable properly, and should produce dnl the proper flags and defines... dnl ********************************************************************* -dnl Checks for libraries. dnl Replace `main' with a function in -labs: AC_CHECK_LIB(abs, main) dnl Replace `main' with a function in -laudit: @@ -67,17 +73,20 @@ AC_CHECK_LIB(sys, main) dnl Replace `main' with a function in -lubik: AC_CHECK_LIB(ubik, main) -# -# Check presence of some functions -# -# Check for XPG4 access() function -# Be sure to test before adding AFS libs in LIBS path as AFS lib -# has such a function that works only on AFS filesystems. +dnl +dnl Checks for presence of some functions. +dnl + +dnl Check for XPG4 access() function +dnl Be sure to test before adding AFS libs in LIBS path as AFS lib +dnl has such a function that works only on AFS filesystems. AC_CHECK_FUNCS(access) -# AC_CHECK_FUNCS(pread pwrite) +dnl dnl Checks for header files. +dnl + AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT @@ -87,7 +96,10 @@ AC_CHECK_HEADER(sys/cdefs.h,, CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS" ) +dnl dnl Checks for typedefs, structures, and compiler characteristics. +dnl + AC_C_CONST AC_TYPE_UID_T AC_C_INLINE @@ -98,8 +110,12 @@ AC_TYPE_SIZE_T AC_STRUCT_ST_RDEV AC_HEADER_TIME AC_STRUCT_TM +AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include ]) +dnl dnl Checks for library functions. +dnl + AC_TYPE_GETGROUPS AC_PROG_GCC_TRADITIONAL AC_FUNC_MEMCMP @@ -111,7 +127,10 @@ AC_FUNC_WAIT3 AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strcasestr strstr strtoul setpgrp strchr memcpy) AC_FUNC_SETPGRP +dnl dnl Checks for (v)snprintf +dnl + NETATALK_SNPRINTF_CHECK dnl -------------------------------------------------------------------------- @@ -467,7 +486,6 @@ dnl --------------------- operating system specific flags (port from sys/*) dnl ----- AIX specific ----- if test x"$this_os" = "xaix"; then AC_MSG_RESULT([ * AIX specific configuration]) - AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available]) dnl This is probably a lie; AIX 4.3 supports a 64-bit long dnl compilation environment. It's enough to get things defined @@ -489,14 +507,6 @@ if test x"$this_os" = "xhpux11"; then AC_MSG_RESULT([ * HP-UX 11 specific configuration]) AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro]) - AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available]) -fi - -dnl ----- IRIX specific ----- -if test x"$this_os" = "xirix"; then - AC_MSG_RESULT([ * IRIX specific configuration]) - - AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available]) fi dnl ----- Linux specific ----- @@ -599,7 +609,6 @@ if test x"$this_os" = "xsolaris"; then AC_MSG_RESULT([ * Solaris specific configuration]) AC_DEFINE(__svr4__, 1, [Solaris compatibility macro]) AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro]) - AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available]) AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro]) CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS" need_dash_r=yes diff --git a/sys/solaris/Makefile.kernel.in b/sys/solaris/Makefile.kernel.in index a4e46205..5624a89f 100644 --- a/sys/solaris/Makefile.kernel.in +++ b/sys/solaris/Makefile.kernel.in @@ -1,7 +1,7 @@ # Solaris specific defines, passed to subdirectories. # To use Sun CC, uncomment the CC and KFLAGS variables. # -# $Id: Makefile.kernel.in,v 1.4 2003-06-17 06:39:37 srittau Exp $ +# $Id: Makefile.kernel.in,v 1.5 2003-12-15 05:27:24 srittau Exp $ # uncomment for 64-bit sparc kernel @@ -38,7 +38,7 @@ LIBSHARED= -ldl # -D_ISOC9X_SOURCE is handled by OSVERSION. basically, it's not needed # with 2.5.1. # add -DHAVE_IFNAMEINDEX if you're using solaris 8. -DEFS= -DNO_STRUCT_TM_GMTOFF -DHAVE_IFNAMEINDEX -D__svr4__ -DSOLARIS -I../../sys/generic \ +DEFS= -DHAVE_IFNAMEINDEX -D__svr4__ -DSOLARIS -I../../sys/generic \ -I.. ${OSDEFS} ${MACHINEDEFS} AFPLIBS= ADDLIBS= -lsocket -lnsl -- 2.39.2