OSDN Git Service

* configure.ac, config.h.in: use new autoconf macro, AC_CHECK_MEMBERS().
authorarai <arai@6a8cc165-1e22-0410-a132-eb4e3f353aba>
Mon, 27 May 2002 15:35:08 +0000 (15:35 +0000)
committerarai <arai@6a8cc165-1e22-0410-a132-eb4e3f353aba>
Mon, 27 May 2002 15:35:08 +0000 (15:35 +0000)
* IFNAMES, configure.in, src/header.c, src/lharc.c: replaced with
new macro name.

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/lha/lha/trunk@143 6a8cc165-1e22-0410-a132-eb4e3f353aba

IFNAMES
config.h.in
configure.ac
configure.in
src/header.c
src/lharc.c

diff --git a/IFNAMES b/IFNAMES
index d8a4c79..ae34c6c 100644 (file)
--- a/IFNAMES
+++ b/IFNAMES
@@ -13,7 +13,7 @@ EXTEND_TOWNSOS lhlist.c
 # FTIME header.c                       replace with HAVE_FTIME
 # GETTIMEOFDAY header.c                        replace with HAVE_GETTIMEOFDAY
 # SYSV_SYSTEM_DIR lha_macro.h          replace with HAVE_DIRENT_H
-# HAVE_TM_ZONE header.c                        replace with HAVE_TM_GMTOFF
+# HAVE_TM_ZONE header.c                        replace with HAVE_STRUCT_TM_TM_GMTOFF
 LHA_MAIN_SRC lha.h lha_macro.h
 # LONG_MAX lha_macro.h
 # LONG_MIN lha_macro.h
@@ -35,7 +35,7 @@ NONSYSTEM_DIR_LIBRARY lha_macro.h     no use (???)
 NOT_COMPATIBLE_MODE header.c lhext.c
 NOT_USED header.c
 NOVOID lha_macro.h
-# NO_INODE lharc.c                     replace with !HAVE_ST_INO (???)
+# NO_INODE lharc.c                     replace with !HAVE_STRUCT_STAT_ST_INO
 # HAVE_NO_LCHOWN lhext.c               replace with !HAVE_LCHOWN
 NULL lha_macro.h
 OSK header.c
index 3188703..dc293ae 100644 (file)
 /* Define to 1 if you have the <string.h> header file. */
 #undef HAVE_STRING_H
 
+/* Define to 1 if `st_ino' is member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_INO
+
+/* Define to 1 if `tm_gmtoff' is member of `struct tm'. */
+#undef HAVE_STRUCT_TM_TM_GMTOFF
+
 /* Define to 1 if `tm_zone' is member of `struct tm'. */
 #undef HAVE_STRUCT_TM_TM_ZONE
 
-/* Define if your struct stat has st_ino */
-#undef HAVE_ST_INO
-
 /* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
    */
 #undef HAVE_SYS_DIR_H
 /* Define to 1 if you have the `timelocal' function. */
 #undef HAVE_TIMELOCAL
 
-/* Define if your struct tm has tm_gmtoff */
-#undef HAVE_TM_GMTOFF
-
 /* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
    `HAVE_STRUCT_TM_TM_ZONE' instead. */
 #undef HAVE_TM_ZONE
index ccf9c12..752636a 100644 (file)
@@ -28,33 +28,26 @@ AC_HEADER_TIME
 AC_STRUCT_TM
 AC_STRUCT_TIMEZONE
 
-AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
-[AC_TRY_COMPILE([
-#if TM_IN_SYS_TIME
-#include <sys/time.h>
+AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct stat.st_ino],,,
+[
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
 #else
-#include <time.h>
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
 #endif
-  ], [struct tm t; t.tm_gmtoff;],
-  ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)
-])
-
-if test "x$ac_cv_struct_tm_gmtoff" = xyes; then
-  AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if your struct tm has tm_gmtoff])
-fi
-
-AC_CACHE_CHECK([for st_ino in struct stat], ac_cv_struct_st_ino,
-[AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/stat.h>
-  ], [struct stat s; s.st_ino;],
-  ac_cv_struct_st_ino=yes, ac_cv_struct_st_ino=no)
 ])
 
-if test "x$ac_cv_struct_st_ino" = xyes; then
-  AC_DEFINE(HAVE_ST_INO, 1, [Define if your struct stat has st_ino])
-fi
-
 dnl Checks for library functions.
 AC_TYPE_SIGNAL
 AC_FUNC_FORK
index f21c5e9..5eed0d9 100644 (file)
@@ -31,7 +31,7 @@ AC_HEADER_TIME
 AC_STRUCT_TM
 AC_STRUCT_TIMEZONE
 
-AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
+AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_member_struct_tm_tm_gmtoff,
 [AC_TRY_COMPILE([
 #if TM_IN_SYS_TIME
 #include <sys/time.h>
@@ -39,23 +39,27 @@ AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
 #include <time.h>
 #endif
   ], [struct tm t; t.tm_gmtoff;],
-  ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)
+  ac_cv_member_struct_tm_tm_gmtoff=yes,
+  ac_cv_member_struct_tm_tm_gmtoff=no)
 ])
 
-if test "x$ac_cv_struct_tm_gmtoff" = xyes; then
-  AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if your struct tm has tm_gmtoff])
+if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes; then
+  AC_DEFINE(HAVE_STRUCT_TM_TM_GMTOFF, 1,
+           [Define if your struct tm has tm_gmtoff])
 fi
 
-AC_CACHE_CHECK([for st_ino in struct stat], ac_cv_struct_st_ino,
+AC_CACHE_CHECK([for st_ino in struct stat], ac_cv_member_struct_stat_st_ino,
 [AC_TRY_COMPILE([
 #include <sys/types.h>
 #include <sys/stat.h>
   ], [struct stat s; s.st_ino;],
-  ac_cv_struct_st_ino=yes, ac_cv_struct_st_ino=no)
+  ac_cv_member_struct_stat_st_ino=yes,
+  ac_cv_member_struct_stat_st_ino=no)
 ])
 
-if test "x$ac_cv_struct_st_ino" = xyes; then
-  AC_DEFINE(HAVE_ST_INO, 1, [Define if your struct stat has st_ino])
+if test "x$ac_cv_member_struct_stat_st_ino" = xyes; then
+  AC_DEFINE(HAVE_STRUCT_STAT_ST_INO, 1,
+           [Define if your struct stat has st_ino])
 fi
 
 dnl Checks for library functions.
index 82e504d..c063e4b 100644 (file)
@@ -374,12 +374,12 @@ gettz()
 /* ------------------------------------------------------------------------ */
 #if !defined(HAVE_TZSET) && !defined(HAVE_FTIME)       /* maybe defined(HAVE_GETTIMEOFDAY) */
 {
-#ifdef HAVE_TM_GMTOFF
+#ifdef HAVE_STRUCT_TM_TM_GMTOFF
        time_t tt;
 
        time(&tt);
        return -localtime(&tt)->tm_gmtoff;
-#else /* HAVE_TM_GMTOFF */
+#else /* HAVE_STRUCT_TM_TM_GMTOFF */
        struct timeval  tp;
        struct timezone tzp;
        gettimeofday(&tp, &tzp);/* specific to 4.3BSD */
@@ -388,7 +388,7 @@ gettz()
         * 60L : 0));
         */
        return (tzp.tz_minuteswest * 60L);
-#endif /* HAVE_TM_GMTOFF */
+#endif /* HAVE_STRUCT_TM_TM_GMTOFF */
 }
 #endif
 #endif                         /* defined(HAVE_FTIME) || defined(HAVE_GETTIMEOFDAY) ||
index 0ba5234..135db34 100644 (file)
@@ -869,7 +869,7 @@ find_files(name, v_filec, v_filev)
                newname[len + n] = '\0';
                if (GETSTAT(newname, &fil_stbuf) < 0)
                        continue;
-#if !defined(HAVE_ST_INO) || __MINGW32__
+#if !defined(HAVE_STRUCT_STAT_ST_INO) || __MINGW32__
                if ( dp->d_name[0] != '.' ||
                        (n != 1 &&
                         (dp->d_name[1] != '.' ||