]> git.wh0rd.org - dump.git/commitdiff
Configure magic for testing ext2_ino_t and s_journal_inum
authorStelian Pop <stelian@popies.net>
Wed, 21 Mar 2001 09:37:12 +0000 (09:37 +0000)
committerStelian Pop <stelian@popies.net>
Wed, 21 Mar 2001 09:37:12 +0000 (09:37 +0000)
config.h.in
configure
configure.in
dump/itime.c
dump/traverse.c

index 907e5d024d61a137725d08602b8d17ad0a6514c8..c08eced97e30c6f774e40887f3f6de9d134223ec 100644 (file)
 /* Define if you want to include readline support.  */
 #undef HAVE_READLINE
 
+/* Define if we have the ext2_ino_t type (from e2fsprogs 1.20+). */ 
+#undef HAVE_EXT2_INO_T
+
+/* Define if we have the s_journal_inum field in struct ext2_super_block. */
+#undef HAVE_EXT2_JOURNAL_INUM
 /* Define this is you want old style F script (no arguments) */
 #undef OLD_STYLE_FSCRIPT
 
index e61f8d08feec5287512a103897830fbcbbe0a905..462ef78cdb2477dd3b648a9218fb30814f2b9fb7 100755 (executable)
--- a/configure
+++ b/configure
@@ -1697,8 +1697,60 @@ if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
        { echo "configure: error: You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs" 1>&2; exit 1; }
 fi
 
+echo $ac_n "checking for ext2_ino_t type in ext2 headers""... $ac_c" 1>&6
+echo "configure:1702: checking for ext2_ino_t type in ext2 headers" >&5
+cat > conftest.$ac_ext <<EOF
+#line 1704 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+#include <linux/ext2_fs.h>
+#include <ext2fs/ext2fs.h>
+int main() {
+ext2_ino_t ino = 0;
+; return 0; }
+EOF
+if { (eval echo configure:1713: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cat >> confdefs.h <<\EOF
+#define HAVE_EXT2_INO_T 1
+EOF
+, echo "$ac_t""yes" 1>&6
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+echo $ac_n "checking for s_journal_inum field in ext2_super_block struct""... $ac_c" 1>&6
+echo "configure:1728: checking for s_journal_inum field in ext2_super_block struct" >&5
+cat > conftest.$ac_ext <<EOF
+#line 1730 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+#include <linux/ext2_fs.h>
+#include <ext2fs/ext2fs.h>
+int main() {
+struct ext2_super_block es; es.s_journal_inum = 0;
+; return 0; }
+EOF
+if { (eval echo configure:1739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cat >> confdefs.h <<\EOF
+#define HAVE_EXT2_JOURNAL_INUM 1
+EOF
+, echo "$ac_t""yes" 1>&6
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:1702: checking for tgetent in -ltermcap" >&5
+echo "configure:1754: checking for tgetent in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1706,7 +1758,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1710 "configure"
+#line 1762 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1717,7 +1769,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:1721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1746,17 +1798,17 @@ fi
 
 ac_safe=`echo "readline/readline.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for readline/readline.h""... $ac_c" 1>&6
-echo "configure:1750: checking for readline/readline.h" >&5
+echo "configure:1802: checking for readline/readline.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1755 "configure"
+#line 1807 "configure"
 #include "confdefs.h"
 #include <readline/readline.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1779,7 +1831,7 @@ readline_h=no
 fi
 
 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
-echo "configure:1783: checking for readline in -lreadline" >&5
+echo "configure:1835: checking for readline in -lreadline" >&5
 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1787,7 +1839,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lreadline "-ltermcap" $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1791 "configure"
+#line 1843 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1798,7 +1850,7 @@ int main() {
 readline()
 ; return 0; }
 EOF
-if { (eval echo configure:1802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1827,17 +1879,17 @@ fi
 
 ac_safe=`echo "zlib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for zlib.h""... $ac_c" 1>&6
-echo "configure:1831: checking for zlib.h" >&5
+echo "configure:1883: checking for zlib.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1836 "configure"
+#line 1888 "configure"
 #include "confdefs.h"
 #include <zlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1841: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1860,7 +1912,7 @@ zlib_h=no
 fi
 
 echo $ac_n "checking for compress2 in -lz""... $ac_c" 1>&6
-echo "configure:1864: checking for compress2 in -lz" >&5
+echo "configure:1916: checking for compress2 in -lz" >&5
 ac_lib_var=`echo z'_'compress2 | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1868,7 +1920,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lz  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1872 "configure"
+#line 1924 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1879,7 +1931,7 @@ int main() {
 compress2()
 ; return 0; }
 EOF
-if { (eval echo configure:1883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1914,12 +1966,12 @@ fi
 for ac_func in err errx verr verrx vwarn vwarnx warn warnx realpath lchown
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1918: checking for $ac_func" >&5
+echo "configure:1970: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1923 "configure"
+#line 1975 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1942,7 +1994,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1967,12 +2019,12 @@ fi
 done
 
 echo $ac_n "checking for glob""... $ac_c" 1>&6
-echo "configure:1971: checking for glob" >&5
+echo "configure:2023: checking for glob" >&5
 if eval "test \"`echo '$''{'ac_cv_func_glob'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1976 "configure"
+#line 2028 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char glob(); below.  */
@@ -1995,7 +2047,7 @@ glob();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_glob=yes"
 else
@@ -2015,9 +2067,11 @@ else
 fi
 
 
+echo $ac_n "checking for extended glob routines""... $ac_c" 1>&6
+echo "configure:2072: checking for extended glob routines" >&5
 if test "$ac_cv_func_glob" = "yes"; then
        cat > conftest.$ac_ext <<EOF
-#line 2021 "configure"
+#line 2075 "configure"
 #include "confdefs.h"
 
 #      include <glob.h>
@@ -2029,28 +2083,31 @@ EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "yes" >/dev/null 2>&1; then
   rm -rf conftest*
-  cat >> confdefs.h <<\EOF
+  
+       cat >> confdefs.h <<\EOF
 #define HAVE_GLOB 1
 EOF
 
+       echo "$ac_t""yes" 1>&6
+       
 else
   rm -rf conftest*
-  noglob=yes
+  
+       echo "$ac_t""no" 1>&6
+       echo "Your system does not support extended glob, will use the internal routines"
+       
 fi
 rm -f conftest*
 
-       if test "$noglob" = "yes"; then
-               echo "Your system does not support extended glob, will use the internal routines"
-       fi
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2049: checking for ANSI C header files" >&5
+echo "configure:2106: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2054 "configure"
+#line 2111 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2058,7 +2115,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2075,7 +2132,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2079 "configure"
+#line 2136 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2093,7 +2150,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2097 "configure"
+#line 2154 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2114,7 +2171,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2118 "configure"
+#line 2175 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2125,7 +2182,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:2129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2149,12 +2206,12 @@ EOF
 fi
 
 echo $ac_n "checking for quad_t""... $ac_c" 1>&6
-echo "configure:2153: checking for quad_t" >&5
+echo "configure:2210: checking for quad_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_quad_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2158 "configure"
+#line 2215 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2182,12 +2239,12 @@ EOF
 fi
 
 echo $ac_n "checking for u_quad_t""... $ac_c" 1>&6
-echo "configure:2186: checking for u_quad_t" >&5
+echo "configure:2243: checking for u_quad_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_u_quad_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2191 "configure"
+#line 2248 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
index 768a92e20d1d927c2abb7fceb373dd6ea82b4720..cd3b5da7a02257b9577f4801a7d0ad9a1ef02a41 100644 (file)
@@ -273,6 +273,28 @@ if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
        AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs)
 fi
 
+dnl
+dnl Check for ext2_ino_t type
+dnl
+AC_MSG_CHECKING(for ext2_ino_t type in ext2 headers)
+AC_TRY_COMPILE([#include <stdio.h>
+#include <linux/ext2_fs.h>
+#include <ext2fs/ext2fs.h>], 
+[ext2_ino_t ino = 0;], 
+[AC_DEFINE(HAVE_EXT2_INO_T), AC_MSG_RESULT(yes)],
+AC_MSG_RESULT(no))
+
+dnl
+dnl Check for s_journal_inum field in ext2_super_block struct
+dnl
+AC_MSG_CHECKING(for s_journal_inum field in ext2_super_block struct)
+AC_TRY_COMPILE([#include <stdio.h>
+#include <linux/ext2_fs.h>
+#include <ext2fs/ext2fs.h>],
+[struct ext2_super_block es; es.s_journal_inum = 0;],
+[AC_DEFINE(HAVE_EXT2_JOURNAL_INUM), AC_MSG_RESULT(yes)],
+AC_MSG_RESULT(no))
+
 dnl
 dnl Check for termcap libraries
 dnl
@@ -316,6 +338,7 @@ AC_CHECK_FUNC(glob)
 dnl
 dnl Check for GLOB_ALTDIRFUNC
 dnl
+AC_MSG_CHECKING(for extended glob routines)
 if test "$ac_cv_func_glob" = "yes"; then
        AC_EGREP_CPP(yes, 
        [
@@ -323,10 +346,15 @@ if test "$ac_cv_func_glob" = "yes"; then
 #      ifdef GLOB_ALTDIRFUNC
        yes
 #      endif
-       ], AC_DEFINE(HAVE_GLOB), noglob=yes)
-       if test "$noglob" = "yes"; then
-               echo "Your system does not support extended glob, will use the internal routines"
-       fi
+       ], 
+       [
+       AC_DEFINE(HAVE_GLOB)
+       AC_MSG_RESULT(yes)
+       ],
+       [
+       AC_MSG_RESULT(no)
+       echo "Your system does not support extended glob, will use the internal routines"
+       ])
 fi
 
 dnl
index 0a81d9801e07fec93fa16a11a95330773de1c9e4..81d8dc7e7b85b34c2594d13f24006c39070bebbe 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: itime.c,v 1.17 2001/03/20 09:14:58 stelian Exp $";
+       "$Id: itime.c,v 1.18 2001/03/21 09:37:13 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -240,8 +240,6 @@ putdumptime(void)
        if (ftruncate(fd, ftell(df)))
                quit("ftruncate (%s): %s\n", dumpdates, strerror(errno));
        (void) fclose(df);
-       msg("level %c dump on %s", level,
-               spcl.c_date == 0 ? "the epoch\n" : ctime4(&spcl.c_date));
 }
 
 static void
index 8e4a6b6e347f18857eb0ef982340677f3cfda0d9..4bf70d5ddf8565d819ab4bfd7a05ff0438e1280a 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: traverse.c,v 1.28 2001/03/20 10:02:48 stelian Exp $";
+       "$Id: traverse.c,v 1.29 2001/03/21 09:37:13 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -102,13 +102,14 @@ static    int exclude_ino __P((dump_ino_t ino));
 extern dump_ino_t iexclude_list[IEXCLUDE_MAXNUM];      /* the inode exclude list */
 extern int iexclude_num;                       /* number of elements in list */
 
-/* Temporary fix waiting for Andreas fixes... */
-#ifdef HAS_EXT2FS_EXT2_FS
+#ifdef HAVE_EXT2_JOURNAL_INUM
 #define ext2_journal_ino(sb) (sb->s_journal_inum)
 #else
-#define ext2_ino_t __u32
 #define ext2_journal_ino(sb) (*((__u32 *)sb + 0x38))
 #endif
+#ifndef HAVE_EXT2_INO_T
+#define ext2_ino_t __u32
+#endif
 
 #ifndef EXT3_FEATURE_COMPAT_HAS_JOURNAL
 #define EXT3_FEATURE_COMPAT_HAS_JOURNAL                0x0004