aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2012-10-11 11:30:57 -0400
committerJeff Mahoney <jeffm@suse.com>2012-10-11 11:30:57 -0400
commit3078c83c48bdf4691d6d2ce3818dfe82d5dc2c3b (patch)
treecab847ec4b823a2f290c8d24b9bd1eeeb91cbd4b
parent18057cdad6cf2a0c5e9cef6f14a87b2697e91d1b (diff)
downloadreiserfsprogs-3078c83c48bdf4691d6d2ce3818dfe82d5dc2c3b.tar.gz
Imported reiserfsprogs-3.6.18v3.6.18
-rw-r--r--CREDITS6
-rw-r--r--ChangeLog43
-rw-r--r--Makefile.in54
-rw-r--r--aclocal.m4169
-rwxr-xr-xconfig.guess1417
-rwxr-xr-xconfig.sub1501
-rwxr-xr-xconfigure2152
-rw-r--r--configure.in190
-rw-r--r--debugreiserfs/Makefile.am5
-rw-r--r--debugreiserfs/Makefile.in52
-rw-r--r--debugreiserfs/corruption.c4
-rw-r--r--debugreiserfs/debugreiserfs.868
-rw-r--r--debugreiserfs/debugreiserfs.c64
-rw-r--r--debugreiserfs/debugreiserfs.h45
-rw-r--r--debugreiserfs/pack.c16
-rw-r--r--debugreiserfs/recover.c6
-rw-r--r--debugreiserfs/scan.c234
-rw-r--r--debugreiserfs/unpack.c56
-rwxr-xr-xdepcomp59
-rw-r--r--fsck/Makefile.in28
-rw-r--r--fsck/check_tree.c118
-rw-r--r--fsck/fsck.h28
-rw-r--r--fsck/main.c22
-rw-r--r--fsck/pass0.c14
-rw-r--r--fsck/pass1.c11
-rw-r--r--fsck/reiserfsck.861
-rw-r--r--fsck/semantic_check.c8
-rw-r--r--fsck/semantic_rebuild.c2
-rw-r--r--fsck/super.c6
-rw-r--r--fsck/ufile.c59
-rw-r--r--fsck/uobjectid.c10
-rw-r--r--fsck/ustree.c34
-rw-r--r--include/Makefile.in26
-rw-r--r--include/config.h.in44
-rw-r--r--include/io.h16
-rw-r--r--include/misc.h70
-rw-r--r--include/reiserfs_fs.h23
-rw-r--r--include/reiserfs_lib.h12
-rw-r--r--include/swab.h63
-rw-r--r--lib/Makefile.in28
-rw-r--r--lib/io.c50
-rw-r--r--lib/misc.c118
-rw-r--r--mkreiserfs/Makefile.in28
-rw-r--r--mkreiserfs/mkreiserfs.897
-rw-r--r--mkreiserfs/mkreiserfs.c34
-rw-r--r--reiserfscore/Makefile.in28
-rw-r--r--reiserfscore/ibalance.c10
-rw-r--r--reiserfscore/includes.h19
-rw-r--r--reiserfscore/journal.c92
-rw-r--r--reiserfscore/lbalance.c6
-rw-r--r--reiserfscore/node_formats.c6
-rw-r--r--reiserfscore/prints.c6
-rw-r--r--reiserfscore/reiserfslib.c54
-rw-r--r--reiserfscore/stree.c4
-rw-r--r--reiserfsprogs.spec4
-rw-r--r--resize_reiserfs/Makefile.in28
-rw-r--r--resize_reiserfs/do_shrink.c6
-rw-r--r--resize_reiserfs/resize.h28
-rw-r--r--resize_reiserfs/resize_reiserfs.813
-rw-r--r--resize_reiserfs/resize_reiserfs.c2
-rw-r--r--tune/Makefile.in28
-rw-r--r--tune/reiserfstune.831
-rw-r--r--tune/tune.c25
-rw-r--r--tune/tune.h24
64 files changed, 6501 insertions, 1064 deletions
diff --git a/CREDITS b/CREDITS
index 66c5d36..8e47774 100644
--- a/CREDITS
+++ b/CREDITS
@@ -79,9 +79,9 @@ for much of the previous version 3 work, and is paying for Chris and Jeff to do
V3 maintenance. Reiserfs integration in their distro is consistently solid, and
they were key to our becoming widely used.
-Lycos (www.lycos.com) has a support contract with us that consistently comes in
-just when we would otherwise miss payroll, and that they keep doubling every
-year. Much thanks to them.
+Lycos Europe (www.lycos-europe.com) had a support contract with us that
+consistently came in just when we would otherwise have missed payroll, and that
+they kept doubling every year. Much thanks to them.
Many persons came to www.namesys.com/support.html, and got a question answered
for $25, or just gave us a small donation there.
diff --git a/ChangeLog b/ChangeLog
index 9b5845b..c9bae76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,46 @@
+2004-08-03
+ 3.6.18 release.
+2004-06-18
+ Make the oid map code endian safe.
+2004-05-27
+ Syncing host & journal devices after replaing every transaction.
+2004-05-26
+ Do not left uninitialized fields in item headers before insertion.
+2004-05-25
+ Fixes in unaligned access to unformatted block pointers.
+2004-05-24
+ Make reiserfsck to handle suse's block allocator changes correctly.
+2004-05-04
+ 3.6.17 release.
+2004-04-30
+ a few minor bugs were fixed:
+ - mark changed leaves as dirty;
+ - overflow at the huge hole insertion.
+2004-04-05
+ man pages were rewritten.
+2004-03-22
+ move 'unpack' program to 'debugreiserfs -u'.
+2004-03-18
+ 3.6.14 & 3.6.15-pre1 releases.
+2004-03-16
+ reiserfsprogs
+ a few bugs were fixed:
+ in the journal replay code;
+ in the balancing code when removing items from broken leaves;
+ in the mount entry detection code with mtab handling.
+2004-03-04
+ reiserfsprogs
+ a fix for the cross compiling when generating include/credits.h
+2004-02-27
+ reiserfsprogs
+ a bug in the spec file was fixed.
+2004-02-26
+ reiserfsck
+ a bug with setting the file size limit was fixed.
+2004-02-17
+ reiserfsprogs
+ make bynaries to be 'position independent' when dynamically
+ linked to libc.
2004-02-17
3.6.13 release.
2004-02-13
diff --git a/Makefile.in b/Makefile.in
index 214770e..5b4b0f1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.7.2 from Makefile.am.
+# Makefile.in generated by automake 1.7.6 from Makefile.am.
# @configure_input@
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,7 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+host_triplet = @host@
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
+am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
+build = @build@
build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
@@ -125,8 +139,8 @@ RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
- Makefile.in NEWS aclocal.m4 configure configure.in depcomp \
- install-sh missing mkinstalldirs
+ Makefile.in NEWS aclocal.m4 config.guess config.sub configure \
+ configure.in depcomp install-sh missing mkinstalldirs
DIST_SUBDIRS = $(SUBDIRS)
all: all-recursive
@@ -134,18 +148,18 @@ all: all-recursive
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
-$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): configure.in
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
uninstall-info-am:
@@ -229,9 +243,15 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
+ if (etags --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ else \
+ include_option=--include; \
+ fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
- test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ test -f $$subdir/TAGS && \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -345,12 +365,12 @@ distcheck: dist
$(am__remove_distdir)
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
chmod -R a-w $(distdir); chmod a+w $(distdir)
- mkdir $(distdir)/=build
- mkdir $(distdir)/=inst
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
chmod a-w $(distdir)
- dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
- && cd $(distdir)/=build \
+ && cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
@@ -377,7 +397,7 @@ distcheck: dist
@echo "$(distdir).tar.gz is ready for distribution" | \
sed 'h;s/./=/g;p;x;p;x'
distuninstallcheck:
- cd $(distuninstallcheck_dir) \
+ @cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
@@ -386,11 +406,11 @@ distuninstallcheck:
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
- if test '$(srcdir)' = . ; then \
+ @if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
- test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
@@ -452,7 +472,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf autom4te.cache
+ -rm -rf $(top_srcdir)/autom4te.cache
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
diff --git a/aclocal.m4 b/aclocal.m4
index 057771e..6a91c51 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.7.2 -*- Autoconf -*-
+# generated automatically by aclocal 1.7.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
@@ -16,7 +16,7 @@
# This macro actually does too much some checks are only needed if
# your package does certain things. But this isn't really a big deal.
-# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -34,14 +34,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
-# serial 8
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
+# serial 10
AC_PREREQ([2.54])
@@ -86,8 +79,8 @@ m4_ifval([$2],
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
- AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
- AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
@@ -108,6 +101,7 @@ AM_PROG_INSTALL_STRIP
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
@@ -130,7 +124,16 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[_am_stamp_count=`expr ${_am_stamp_count-0} + 1`
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $1 | $1:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
# Copyright 2002 Free Software Foundation, Inc.
@@ -160,7 +163,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
- [AM_AUTOMAKE_VERSION([1.7.2])])
+ [AM_AUTOMAKE_VERSION([1.7.6])])
# Helper functions for option handling. -*- Autoconf -*-
@@ -446,9 +449,42 @@ fi
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# serial 4 -*- Autoconf -*-
+# -*- Autoconf -*-
+# Copyright (C) 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
-# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 1
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# serial 5 -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -509,18 +545,32 @@ AC_CACHE_CHECK([dependency style of $depcc],
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
- echo '#include "conftest.h"' > conftest.c
- echo 'int i;' > conftest.h
- echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ : > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
case $depmode in
nosideeffect)
@@ -538,13 +588,20 @@ AC_CACHE_CHECK([dependency style of $depcc],
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this.
if depmode=$depmode \
- source=conftest.c object=conftest.o \
- depfile=conftest.Po tmpdepfile=conftest.TPo \
- $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 &&
- grep conftest.h conftest.Po > /dev/null 2>&1 &&
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- am_cv_$1_dependencies_compiler_type=$depmode
- break
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored.
+ if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
fi
done
@@ -566,16 +623,8 @@ AM_CONDITIONAL([am__fastdep$1], [
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
-[rm -f .deps 2>/dev/null
-mkdir .deps 2>/dev/null
-if test -d .deps; then
- DEPDIR=.deps
-else
- # MS-DOS does not allow filenames that begin with a dot.
- DEPDIR=_deps
-fi
-rmdir .deps 2>/dev/null
-AC_SUBST([DEPDIR])
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
@@ -679,7 +728,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -704,8 +753,9 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
-doit:
+am__doit:
@echo done
+.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
@@ -733,9 +783,9 @@ if test "$am__include" = "#"; then
_am_result=BSD
fi
fi
-AC_SUBST(am__include)
-AC_SUBST(am__quote)
-AC_MSG_RESULT($_am_result)
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
@@ -783,6 +833,45 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.])
fi])])
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
+
+# Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 2
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
diff --git a/config.guess b/config.guess
new file mode 100755
index 0000000..c8fc683
--- /dev/null
+++ b/config.guess
@@ -0,0 +1,1417 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2003-07-02'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+case "${UNAME_MACHINE}" in
+ i?86)
+ test -z "$VENDOR" && VENDOR=pc
+ ;;
+ *)
+ test -z "$VENDOR" && VENDOR=unknown
+ ;;
+esac
+test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit 0 ;;
+ amiga:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hp300:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ macppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvmeppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ pmax:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sgi:OpenBSD:*:*)
+ echo mipseb-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ wgrisc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:OpenBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ alpha:OSF1:*:*)
+ if test $UNAME_RELEASE = "V4.0"; then
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ fi
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit 0 ;;
+ Alpha*:OpenVMS:*:*)
+ echo alpha-hp-vms
+ exit 0 ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit 0 ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit 0 ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit 0;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit 0 ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit 0 ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit 0 ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit 0;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit 0;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit 0 ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit 0 ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit 0 ;;
+ DRS?6000:UNIX_SV:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7 && exit 0 ;;
+ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ i86pc:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit 0 ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit 0 ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit 0 ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit 0 ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit 0 ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit 0 ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c \
+ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && exit 0
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit 0 ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit 0 ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit 0 ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit 0 ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit 0 ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit 0 ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit 0 ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit 0 ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit 0 ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo rs6000-ibm-aix3.2.5
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit 0 ;;
+ *:AIX:*:[45])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit 0 ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit 0 ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit 0 ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit 0 ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit 0 ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit 0 ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit 0 ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ # avoid double evaluation of $set_cc_for_build
+ test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo unknown-hitachi-hiuxwe2
+ exit 0 ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit 0 ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit 0 ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit 0 ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit 0 ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit 0 ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit 0 ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit 0 ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ *:UNICOS/mp:*:*)
+ echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
+ # Determine whether the default compiler uses glibc.
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #if __GLIBC__ >= 2
+ LIBC=gnu
+ #else
+ LIBC=
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ # GNU/FreeBSD systems have a "k" prefix to indicate we are using
+ # FreeBSD's kernel, but not the complete OS.
+ case ${LIBC} in gnu) kernel_only='k' ;; esac
+ echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+ exit 0 ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit 0 ;;
+ i*:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit 0 ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit 0 ;;
+ x86:Interix*:[34]*)
+ echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+ exit 0 ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit 0 ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit 0 ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit 0 ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit 0 ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ *:GNU:*:*)
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit 0 ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit 0 ;;
+ arm*:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux
+ exit 0 ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux
+ exit 0 ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux
+ exit 0 ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux
+ exit 0 ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-${VENDOR}-linux" && exit 0
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-${VENDOR}-linux" && exit 0
+ ;;
+ ppc:Linux:*:*)
+ echo powerpc-${VENDOR}-linux
+ exit 0 ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-${VENDOR}-linux
+ exit 0 ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="-libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-${VENDOR}-linux${LIBC}
+ exit 0 ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-${VENDOR}-linux ;;
+ PA8*) echo hppa2.0-${VENDOR}-linux ;;
+ *) echo hppa-${VENDOR}-linux ;;
+ esac
+ exit 0 ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-${VENDOR}-linux
+ exit 0 ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit 0 ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux
+ exit 0 ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux
+ exit 0 ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux
+ exit 0 ;;
+ x86_64:Linux:*:*)
+ echo x86_64-${VENDOR}-linux
+ exit 0 ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported targets: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-${VENDOR}-linux"
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-${VENDOR}-linuxaout"
+ exit 0 ;;
+ coff-i386)
+ echo "${UNAME_MACHINE}-${VENDOR}-linuxcoff"
+ exit 0 ;;
+ "")
+ # Either a pre-BFD a.out linker (linuxoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-${VENDOR}-linuxoldld"
+ exit 0 ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #ifdef __INTEL_COMPILER
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}" | sed 's/linux-gnu/linux/' && exit 0
+ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit 0 ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit 0 ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit 0 ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit 0 ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit 0 ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit 0 ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit 0 ;;
+ i*86:*:5:[78]*)
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit 0 ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit 0 ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit 0 ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit 0 ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit 0 ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit 0 ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit 0 ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit 0 ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit 0 ;;
+ M68*:*:R3V[567]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+ 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4 && exit 0 ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit 0 ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit 0 ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit 0 ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit 0 ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit 0 ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit 0 ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit 0 ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit 0 ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit 0 ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit 0 ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit 0 ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit 0 ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Darwin:*:*)
+ case `uname -p` in
+ *86) UNAME_PROCESSOR=i686 ;;
+ powerpc) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit 0 ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit 0 ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit 0 ;;
+ NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit 0 ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit 0 ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit 0 ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit 0 ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit 0 ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit 0 ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit 0 ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit 0 ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit 0 ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit 0 ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit 0 ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ c34*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ c38*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ c4*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config.sub b/config.sub
new file mode 100755
index 0000000..9952c14
--- /dev/null
+++ b/config.sub
@@ -0,0 +1,1501 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2003-07-04'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit 0;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis)
+ os=
+ basic_machine=$1
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k \
+ | m32r | m68000 | m68k | m88k | mcore \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64vr | mips64vrel \
+ | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | msp430 \
+ | ns16k | ns32k \
+ | openrisc | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+ | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xscale | xstormy16 | xtensa \
+ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* \
+ | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* \
+ | m32r-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | mcore-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | msp430-* \
+ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+ | xtensa-* \
+ | ymp-* \
+ | z8k-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ mmix*)
+ basic_machine=mmix-knuth
+ os=-mmixware
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nv1)
+ basic_machine=nv1-cray
+ os=-unicosmp
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ or32 | or32-*)
+ basic_machine=or32-unknown
+ os=-coff
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparc | sparcv9 | sparcv9b)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/configure b/configure
index aca5f06..f83fa19 100755
--- a/configure
+++ b/configure
@@ -308,7 +308,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB UUID_LIBS CPP EGREP LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB UUID_LIBS CPP EGREP LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -834,6 +834,10 @@ Program names:
--program-prefix=PREFIX prepend PREFIX to installed program names
--program-suffix=SUFFIX append SUFFIX to installed program names
--program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
_ACEOF
fi
@@ -844,8 +848,12 @@ if test -n "$ac_init_help"; then
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
--disable-dependency-tracking Speeds up one-time builds
--enable-dependency-tracking Do not reject slow dependency extractors
+ --enable-debug enable extra checks
+ --disable-largefile omit support for large files
--enable-io-failure-emulation Never use that. It is for debugging only
Some influential environment variables:
@@ -1263,11 +1271,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-am__api_version="1.7"
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
@@ -1293,6 +1296,68 @@ ac_config_guess="$SHELL $ac_aux_dir/config.guess"
ac_config_sub="$SHELL $ac_aux_dir/config.sub"
ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+ ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+ ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+
+
+
+
+
+
+
+am__api_version="1.7"
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
@@ -1511,6 +1576,15 @@ echo "${ECHO_T}no" >&6
SET_MAKE="MAKE=${MAKE-make}"
fi
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
# test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
@@ -1531,7 +1605,7 @@ fi
# Define the identity of the package.
PACKAGE=reiserfsprogs
- VERSION=3.6.13
+ VERSION=3.6.18
cat >>confdefs.h <<_ACEOF
@@ -1657,6 +1731,30 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi;
+ echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
+
+
+if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
ac_config_headers="$ac_config_headers include/config.h"
@@ -1665,6 +1763,7 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
PRESET_CFLAGS=$CFLAGS
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2532,24 +2631,16 @@ ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-rm -f .deps 2>/dev/null
-mkdir .deps 2>/dev/null
-if test -d .deps; then
- DEPDIR=.deps
-else
- # MS-DOS does not allow filenames that begin with a dot.
- DEPDIR=_deps
-fi
-rmdir .deps 2>/dev/null
-
+DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
am_make=${MAKE-make}
cat > confinc << 'END'
-doit:
+am__doit:
@echo done
+.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
@@ -2624,18 +2715,32 @@ else
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
am_cv_CC_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
fi
for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
- echo '#include "conftest.h"' > conftest.c
- echo 'int i;' > conftest.h
- echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ : > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
case $depmode in
nosideeffect)
@@ -2653,13 +2758,20 @@ else
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this.
if depmode=$depmode \
- source=conftest.c object=conftest.o \
- depfile=conftest.Po tmpdepfile=conftest.TPo \
- $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 &&
- grep conftest.h conftest.Po > /dev/null 2>&1 &&
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- am_cv_CC_dependencies_compiler_type=$depmode
- break
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored.
+ if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
fi
done
@@ -2687,8 +2799,161 @@ else
fi
-if test "x" = "x$PRESET_CFLAGS"; then
- CFLAGS="${RPM_OPT_FLAGS} $CFLAGS -Wall"
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$AWK" && break
+done
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\_ACEOF
+all:
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ SET_MAKE=
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ SET_MAKE="MAKE=${MAKE-make}"
fi
if test -n "$ac_tool_prefix"; then
@@ -3465,6 +3730,334 @@ fi
done
+echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5
+echo $ECHO_N "checking whether sys/types.h defines makedev... $ECHO_C" >&6
+if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+int
+main ()
+{
+return makedev(0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 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_header_sys_types_h_makedev=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_sys_types_h_makedev=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5
+echo "${ECHO_T}$ac_cv_header_sys_types_h_makedev" >&6
+
+if test $ac_cv_header_sys_types_h_makedev = no; then
+if test "${ac_cv_header_sys_mkdev_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5
+echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_mkdev_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5
+echo $ECHO_N "checking sys/mkdev.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <sys/mkdev.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5
+echo $ECHO_N "checking sys/mkdev.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/mkdev.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5
+echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_mkdev_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_sys_mkdev_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6
+
+fi
+if test $ac_cv_header_sys_mkdev_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define MAJOR_IN_MKDEV 1
+_ACEOF
+
+fi
+
+
+
+ if test $ac_cv_header_sys_mkdev_h = no; then
+ if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5
+echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5
+echo $ECHO_N "checking sys/sysmacros.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <sys/sysmacros.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5
+echo $ECHO_N "checking sys/sysmacros.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/sysmacros.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5
+echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_sys_sysmacros_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6
+
+fi
+if test $ac_cv_header_sys_sysmacros_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define MAJOR_IN_SYSMACROS 1
+_ACEOF
+
+fi
+
+
+ fi
+fi
+
echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
@@ -3778,6 +4371,1327 @@ fi
+# Check whether --enable-debug or --disable-debug was given.
+if test "${enable_debug+set}" = set; then
+ enableval="$enable_debug"
+ enable_debug=yes
+else
+ enable_debug=no
+
+fi;
+
+echo "$as_me:$LINENO: checking whether -fPIC works" >&5
+echo $ECHO_N "checking whether -fPIC works... $ECHO_C" >&6
+if test "${pic+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="-fPIC -DPIC"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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
+ pic=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+pic=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="$saved_CPPFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $pic" >&5
+echo "${ECHO_T}$pic" >&6
+
+# Checking for compiler warning options
+echo "$as_me:$LINENO: checking whether -Wuninitialized works" >&5
+echo $ECHO_N "checking whether -Wuninitialized works... $ECHO_C" >&6
+if test "${uninitialized+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="-O1 -Wuninitialized"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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
+ uninitialized=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+uninitialized=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="$saved_CPPFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $uninitialized" >&5
+echo "${ECHO_T}$uninitialized" >&6
+
+echo "$as_me:$LINENO: checking whether -Wno-unused-parameter works" >&5
+echo $ECHO_N "checking whether -Wno-unused-parameter works... $ECHO_C" >&6
+if test "${no_unused_parameter+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="-Wno-unused-parameter"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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
+ no_unused_parameter=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+no_unused_parameter=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="$saved_CPPFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $no_unused_parameter" >&5
+echo "${ECHO_T}$no_unused_parameter" >&6
+
+echo "$as_me:$LINENO: checking whether -Wredundant-decls works" >&5
+echo $ECHO_N "checking whether -Wredundant-decls works... $ECHO_C" >&6
+if test "${redundant_decls+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="-Wredundant-decls"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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
+ redundant_decls=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+redundant_decls=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="$saved_CPPFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $redundant_decls" >&5
+echo "${ECHO_T}$redundant_decls" >&6
+
+# Check for large file
+# Check whether --enable-largefile or --disable-largefile was given.
+if test "${enable_largefile+set}" = set; then
+ enableval="$enable_largefile"
+
+fi;
+if test "$enable_largefile" != no; then
+
+ echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
+echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_largefile_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext
+ CC="$CC -n32"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_sys_largefile_CC=' -n32'; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
+echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ while :; do
+ ac_cv_sys_file_offset_bits=no
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_sys_file_offset_bits=64; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ break
+done
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
+echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
+if test "$ac_cv_sys_file_offset_bits" != no; then
+
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+
+fi
+rm -f conftest*
+ echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
+echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_large_files+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ while :; do
+ ac_cv_sys_large_files=no
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_sys_large_files=1; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ break
+done
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
+echo "${ECHO_T}$ac_cv_sys_large_files" >&6
+if test "$ac_cv_sys_large_files" != no; then
+
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+
+fi
+rm -f conftest*
+fi
+
+
+if test -z "${ac_cv_sys_file_offset_bits}"; then
+ { echo "$as_me:$LINENO: WARNING: Can't detect right _FILE_OFFSET_BITS. Will be forced to 64bit." >&5
+echo "$as_me: WARNING: Can't detect right _FILE_OFFSET_BITS. Will be forced to 64bit." >&2;}
+ ac_cv_sys_file_offset_bits=64
+fi
+
+echo "$as_me:$LINENO: checking for off_t" >&5
+echo $ECHO_N "checking for off_t... $ECHO_C" >&6
+if test "${ac_cv_type_off_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
+
+int
+main ()
+{
+if ((off_t *) 0)
+ return 0;
+if (sizeof (off_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_type_off_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_off_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+echo "${ECHO_T}$ac_cv_type_off_t" >&6
+
+echo "$as_me:$LINENO: checking size of off_t" >&5
+echo $ECHO_N "checking size of off_t... $ECHO_C" >&6
+if test "${ac_cv_sizeof_off_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$ac_cv_type_off_t" = yes; then
+ # The cast to unsigned long works around a bug in the HP C Compiler
+ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+ # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+ # This bug is HP SR number 8606223364.
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (off_t))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (off_t))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_hi=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (off_t))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (off_t))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_lo=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo= ac_hi=
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (off_t))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_hi=$ac_mid
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_off_t=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (off_t), 77
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; } ;;
+esac
+else
+ if test "$cross_compiling" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
+
+long longval () { return (long) (sizeof (off_t)); }
+unsigned long ulongval () { return (long) (sizeof (off_t)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ exit (1);
+ if (((long) (sizeof (off_t))) < 0)
+ {
+ long i = longval ();
+ if (i != ((long) (sizeof (off_t))))
+ exit (1);
+ fprintf (f, "%ld\n", i);
+ }
+ else
+ {
+ unsigned long i = ulongval ();
+ if (i != ((long) (sizeof (off_t))))
+ exit (1);
+ fprintf (f, "%lu\n", i);
+ }
+ exit (ferror (f) || fclose (f) != 0);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./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_sizeof_off_t=`cat conftest.val`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (off_t), 77
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+else
+ ac_cv_sizeof_off_t=0
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5
+echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
+_ACEOF
+
+
+
+echo "$as_me:$LINENO: checking for blkcnt_t" >&5
+echo $ECHO_N "checking for blkcnt_t... $ECHO_C" >&6
+if test "${ac_cv_type_blkcnt_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
+
+int
+main ()
+{
+if ((blkcnt_t *) 0)
+ return 0;
+if (sizeof (blkcnt_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_type_blkcnt_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_blkcnt_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_blkcnt_t" >&5
+echo "${ECHO_T}$ac_cv_type_blkcnt_t" >&6
+
+echo "$as_me:$LINENO: checking size of blkcnt_t" >&5
+echo $ECHO_N "checking size of blkcnt_t... $ECHO_C" >&6
+if test "${ac_cv_sizeof_blkcnt_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$ac_cv_type_blkcnt_t" = yes; then
+ # The cast to unsigned long works around a bug in the HP C Compiler
+ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+ # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+ # This bug is HP SR number 8606223364.
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (blkcnt_t))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (blkcnt_t))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_hi=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (blkcnt_t))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (blkcnt_t))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_lo=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo= ac_hi=
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (blkcnt_t))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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_hi=$ac_mid
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_blkcnt_t=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (blkcnt_t), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (blkcnt_t), 77
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; } ;;
+esac
+else
+ if test "$cross_compiling" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
+
+long longval () { return (long) (sizeof (blkcnt_t)); }
+unsigned long ulongval () { return (long) (sizeof (blkcnt_t)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ exit (1);
+ if (((long) (sizeof (blkcnt_t))) < 0)
+ {
+ long i = longval ();
+ if (i != ((long) (sizeof (blkcnt_t))))
+ exit (1);
+ fprintf (f, "%ld\n", i);
+ }
+ else
+ {
+ unsigned long i = ulongval ();
+ if (i != ((long) (sizeof (blkcnt_t))))
+ exit (1);
+ fprintf (f, "%lu\n", i);
+ }
+ exit (ferror (f) || fclose (f) != 0);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./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_sizeof_blkcnt_t=`cat conftest.val`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (blkcnt_t), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (blkcnt_t), 77
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+else
+ ac_cv_sizeof_blkcnt_t=0
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_blkcnt_t" >&5
+echo "${ECHO_T}$ac_cv_sizeof_blkcnt_t" >&6
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_BLKCNT_T $ac_cv_sizeof_blkcnt_t
+_ACEOF
+
+
+
if test $ac_cv_c_compiler_gnu = yes; then
echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
@@ -4221,7 +6135,15 @@ done
-for ac_func in strerror strstr strtol
+
+
+
+
+
+
+
+for ac_func in strerror strstr strtol register_printf_function statfs getmntent\
+ hasmntopt memset time uname
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -4305,6 +6227,7 @@ fi
done
+
# Check whether --enable-io-failure-emulation or --disable-io-failure-emulation was given.
if test "${enable_io_failure_emulation+set}" = set; then
enableval="$enable_io_failure_emulation"
@@ -4319,111 +6242,73 @@ _ACEOF
fi;
-
-
-
-
-echo "$as_me:$LINENO: checking for CREDITS" >&5
-echo $ECHO_N "checking for CREDITS... $ECHO_C" >&6
-
-if test "$cross_compiling" = yes; then
- echo $ac_n "cross compiling; assumed OK... $ac_c"
-
+credits="./CREDITS"
+echo "$as_me:$LINENO: checking for $credits" >&5
+echo $ECHO_N "checking for $credits... $ECHO_C" >&6
+if test -r $credits ; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-
-int main (void) {
- FILE *fin, *fout;
- char *line = NULL;
- unsigned int len = 0;
- int start, count;
-
- if ((fin = fopen("CREDITS", "r")) == NULL) {
- fprintf(stderr, "Error occured while openning the file 'CREDITS': "
- "%s.\n", strerror(errno));
-
- return 1;
- }
-
- if ((fout = fopen("include/credits.h", "w")) == NULL) {
- fprintf(stderr, "Error occured while openning the file 'credits.h': "
- "%s.\n", strerror(errno));
-
- return 1;
- }
-
- /* Replicate the header. */
- while (getline(&line, &len, fin) != -1) {
- fprintf(fout, line);
-
- if (!strcmp(line, "\n"))
- break;
- }
-
- fprintf(fout, "char *credits[] = {\n");
+ { { echo "$as_me:$LINENO: error: Missing file $credits" >&5
+echo "$as_me: error: Missing file $credits" >&2;}
+ { (exit 1); exit 1; }; }
+fi
- start = 2; count = 0;
+$AWK '
+BEGIN {in_header = 1; start = 2; count = 0}
- while (getline(&line, &len, fin) != -1) {
- if (!strcmp(line, "\n") || strlen(line) < 1) {
+{
+ if (in_header) {
+ print $0
+ if ($0 == "") {
+ in_header = 0;
+ printf "char *credits[] = {\n"
+ }
+ } else {
+ if (($0 == "") || (length($0) < 1)) {
start = 1;
count++;
} else {
if (!start)
- fprintf(fout, "\\t\\\\\\n");
+ printf "\t\\\n"
else if (start == 1)
- fprintf(fout, ",\n\n");
-
- line[strlen(line) - 1] = 0;
- fprintf(fout, "\t\"%s\\\n\"", line);
+ printf ",\n\n"
+ printf "\t\"" $0 "\\n\""
start = 0;
}
}
+}
+END { print "\n};\n#define CREDITS_COUNT " count }
+' $credits > include/credits.h
- fprintf(fout, "\n};\n");
- fprintf(fout, "#define CREDITS_COUNT %d\n", count);
+if test x$enable_debug = xyes; then
+ if test "x" = "x$PRESET_CFLAGS"; then
+ CFLAGS="-g -Wall"
+ fi
- free(line);
- fclose(fin);
- fclose(fout);
+ if test x$no_unused_parameter = xyes; then
+ CFLAGS="$CFLAGS -Wno-unused-parameter"
+ else
+ CFLAGS="$CFLAGS -Wno-unused"
+ fi
- return 0;
-}
+ if test x$redundant_decls = xyes; then
+ CFLAGS="$CFLAGS -Wredundant-decls"
+ fi
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./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
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+ if test x$uninitialized = xyes; then
+ CFLAGS="$CFLAGS -Wuninitialized -O1"
+ else
+ CFLAGS="$CFLAGS -O2"
+ fi
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6 ; exit
+ if test "x" = "x$PRESET_CFLAGS"; then
+ CFLAGS="-g -Wall -O2"
+ fi
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+
+if test x$pic = xyes; then
+ CFLAGS="$CFLAGS -fPIC -DPIC"
fi
ac_config_files="$ac_config_files include/Makefile mkreiserfs/Makefile resize_reiserfs/Makefile fsck/Makefile lib/Makefile Makefile reiserfscore/Makefile debugreiserfs/Makefile tune/Makefile"
@@ -4518,6 +6403,13 @@ LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
@@ -5071,6 +6963,14 @@ s,@ECHO_C@,$ECHO_C,;t t
s,@ECHO_N@,$ECHO_N,;t t
s,@ECHO_T@,$ECHO_T,;t t
s,@LIBS@,$LIBS,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
s,@INSTALL_DATA@,$INSTALL_DATA,;t t
@@ -5089,6 +6989,10 @@ s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
s,@AWK@,$AWK,;t t
s,@SET_MAKE@,$SET_MAKE,;t t
+s,@am__leading_dot@,$am__leading_dot,;t t
+s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
+s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
+s,@MAINT@,$MAINT,;t t
s,@CC@,$CC,;t t
s,@CFLAGS@,$CFLAGS,;t t
s,@LDFLAGS@,$LDFLAGS,;t t
@@ -5105,6 +7009,7 @@ s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
s,@CCDEPMODE@,$CCDEPMODE,;t t
s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@LN_S@,$LN_S,;t t
s,@RANLIB@,$RANLIB,;t t
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
s,@UUID_LIBS@,$UUID_LIBS,;t t
@@ -5537,7 +7442,16 @@ echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
cat $tmp/config.h
rm -f $tmp/config.h
fi
-_am_stamp_count=`expr ${_am_stamp_count-0} + 1`
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $ac_file | $ac_file:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X$ac_file : 'X\(//\)[^/]' \| \
diff --git a/configure.in b/configure.in
index 3d60c03..7968634 100644
--- a/configure.in
+++ b/configure.in
@@ -1,9 +1,13 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(version.h)
+AC_CANONICAL_HOST
+AC_PREREQ(2.50)
AH_TEMPLATE([HAVE_LIBUUID], [Define for enable libuuid using.])
+AH_TEMPLATE([ENABLE_DEBUG], [Define for enable debug info.])
-AM_INIT_AUTOMAKE(reiserfsprogs, 3.6.13)
+AM_INIT_AUTOMAKE(reiserfsprogs, 3.6.18)
+AM_MAINTAINER_MODE
dnl We install in /sbin, the utils are to be available on boot
dnl AC_PREFIX(/)
@@ -13,16 +17,14 @@ AM_CONFIG_HEADER(include/config.h)
AC_SUBST(sbindir)
PRESET_CFLAGS=$CFLAGS
-AC_PROG_CC
-if test "x" = "x$PRESET_CFLAGS"; then
- CFLAGS="${RPM_OPT_FLAGS} $CFLAGS -Wall"
-fi
dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_AWK
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
AC_PROG_RANLIB
-dnl AC_PROG_AWK
-dnl AC_PROG_INSTALL
-dnl AC_PROG_LN_S
dnl Checks for libraries.
@@ -34,6 +36,7 @@ AC_SUBST(UUID_LIBS)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/ioctl.h unistd.h uuid/uuid.h)
+AC_HEADER_MAJOR
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@@ -41,12 +44,69 @@ AC_C_INLINE
AC_TYPE_SIZE_T
AC_STRUCT_ST_RDEV
+AC_ARG_ENABLE(debug, [ --enable-debug enable extra checks],
+ enable_debug=yes,
+ enable_debug=no
+)
+
+dnl Check for the compiler pic option.
+AC_CACHE_CHECK([whether -fPIC works], [pic], [
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="-fPIC -DPIC"
+ AC_TRY_COMPILE(, , [pic=yes], [pic=no])
+ CPPFLAGS="$saved_CPPFLAGS"
+])
+
+# Checking for compiler warning options
+AC_CACHE_CHECK([whether -Wuninitialized works], [uninitialized], [
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="-O1 -Wuninitialized"
+ AC_TRY_COMPILE(, , [uninitialized=yes], [uninitialized=no])
+ CPPFLAGS="$saved_CPPFLAGS"
+])
+
+AC_CACHE_CHECK([whether -Wno-unused-parameter works], [no_unused_parameter], [
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="-Wno-unused-parameter"
+ AC_TRY_COMPILE(, , [no_unused_parameter=yes], [no_unused_parameter=no])
+ CPPFLAGS="$saved_CPPFLAGS"
+ ])
+
+AC_CACHE_CHECK([whether -Wredundant-decls works], [redundant_decls], [
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="-Wredundant-decls"
+ AC_TRY_COMPILE(, , [redundant_decls=yes], [redundant_decls=no])
+ CPPFLAGS="$saved_CPPFLAGS"
+])
+
+# Check for large file
+AC_SYS_LARGEFILE
+
+if test -z "${ac_cv_sys_file_offset_bits}"; then
+ AC_MSG_WARN(Can't detect right _FILE_OFFSET_BITS. Will be forced to 64bit.)
+ ac_cv_sys_file_offset_bits=64
+fi
+
+AC_CHECK_SIZEOF(off_t, 64, [
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+])
+
+AC_CHECK_SIZEOF(blkcnt_t, 64, [
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+])
+
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(strerror strstr strtol)
+AC_CHECK_FUNCS(strerror strstr strtol register_printf_function statfs getmntent\
+ hasmntopt memset time uname)
+
dnl Never enable this. It is for debugging only
AC_ARG_ENABLE(io-failure-emulation,
@@ -57,78 +117,70 @@ AC_ARG_ENABLE(io-failure-emulation,
fi
])
-AC_DEFUN(AC_PREPARE_CREDITS,
-[
-
-AC_MSG_CHECKING(for CREDITS)
-
-AC_TRY_RUN([
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-
-int main (void) {
- FILE *fin, *fout;
- char *line = NULL;
- unsigned int len = 0;
- int start, count;
-
- if ((fin = fopen("CREDITS", "r")) == NULL) {
- fprintf(stderr, "Error occured while openning the file 'CREDITS': "
- "%s.\n", strerror(errno));
+credits="./CREDITS"
+AC_MSG_CHECKING(for $credits)
+if test -r $credits ; then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_ERROR(Missing file $credits)
+fi
- return 1;
- }
+$AWK ['
+BEGIN {in_header = 1; start = 2; count = 0}
- if ((fout = fopen("include/credits.h", "w")) == NULL) {
- fprintf(stderr, "Error occured while openning the file 'credits.h': "
- "%s.\n", strerror(errno));
-
- return 1;
- }
-
- /* Replicate the header. */
- while (getline(&line, &len, fin) != -1) {
- fprintf(fout, line);
-
- if (!strcmp(line, "\n"))
- break;
- }
-
- fprintf(fout, "char *credits[] = {\n");
-
- start = 2; count = 0;
-
- while (getline(&line, &len, fin) != -1) {
- if (!strcmp(line, "\n") || strlen(line) < 1) {
+{
+ if (in_header) {
+ print $0
+ if ($0 == "") {
+ in_header = 0;
+ printf "char *credits[] = {\n"
+ }
+ } else {
+ if (($0 == "") || (length($0) < 1)) {
start = 1;
count++;
} else {
if (!start)
- fprintf(fout, "\\t\\\\\\n");
+ printf "\t\\\n"
else if (start == 1)
- fprintf(fout, ",\n\n");
-
- line[strlen(line) - 1] = 0;
- fprintf(fout, "\t\"%s\\\n\"", line);
+ printf ",\n\n"
+ printf "\t\"" $0 "\\n\""
start = 0;
}
}
-
- fprintf(fout, "\n};\n");
- fprintf(fout, "#define CREDITS_COUNT %d\n", count);
-
- free(line);
- fclose(fin);
- fclose(fout);
-
- return 0;
}
-], AC_MSG_RESULT(yes), AC_MSG_RESULT(no) ; exit,
- [echo $ac_n "cross compiling; assumed OK... $ac_c"]
-)])
+END { print "\n};\n#define CREDITS_COUNT " count }
+'] $credits > include/credits.h
+
+if test x$enable_debug = xyes; then
+ if test "x" = "x$PRESET_CFLAGS"; then
+ CFLAGS="-g -Wall"
+ fi
+
+ if test x$no_unused_parameter = xyes; then
+ CFLAGS="$CFLAGS -Wno-unused-parameter"
+ else
+ CFLAGS="$CFLAGS -Wno-unused"
+ fi
+
+ if test x$redundant_decls = xyes; then
+ CFLAGS="$CFLAGS -Wredundant-decls"
+ fi
+
+ if test x$uninitialized = xyes; then
+ CFLAGS="$CFLAGS -Wuninitialized -O1"
+ else
+ CFLAGS="$CFLAGS -O2"
+ fi
+else
+ if test "x" = "x$PRESET_CFLAGS"; then
+ CFLAGS="-g -Wall -O2"
+ fi
+fi
-AC_PREPARE_CREDITS()
+if test x$pic = xyes; then
+ CFLAGS="$CFLAGS -fPIC -DPIC"
+fi
AC_OUTPUT(
include/Makefile
diff --git a/debugreiserfs/Makefile.am b/debugreiserfs/Makefile.am
index 2d8f9af..c06296a 100644
--- a/debugreiserfs/Makefile.am
+++ b/debugreiserfs/Makefile.am
@@ -1,7 +1,6 @@
-sbin_PROGRAMS = debugreiserfs unpack
+sbin_PROGRAMS = debugreiserfs
-debugreiserfs_SOURCES = debugreiserfs.c pack.c stat.c corruption.c scan.c recover.c
-unpack_SOURCES = unpack.c pack.c debugreiserfs.h
+debugreiserfs_SOURCES = debugreiserfs.c pack.c unpack.c stat.c corruption.c scan.c recover.c debugreiserfs.h
man_MANS = debugreiserfs.8
EXTRA_DIST = $(man_MANS)
diff --git a/debugreiserfs/Makefile.in b/debugreiserfs/Makefile.in
index 50037fa..7c23b92 100644
--- a/debugreiserfs/Makefile.in
+++ b/debugreiserfs/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.7.2 from Makefile.am.
+# Makefile.in generated by automake 1.7.6 from Makefile.am.
# @configure_input@
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,7 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+host_triplet = @host@
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
+am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
+build = @build@
build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
@@ -105,35 +119,29 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
-sbin_PROGRAMS = debugreiserfs unpack
+sbin_PROGRAMS = debugreiserfs
-debugreiserfs_SOURCES = debugreiserfs.c pack.c stat.c corruption.c scan.c recover.c
-unpack_SOURCES = unpack.c pack.c debugreiserfs.h
+debugreiserfs_SOURCES = debugreiserfs.c pack.c unpack.c stat.c corruption.c scan.c recover.c debugreiserfs.h
man_MANS = debugreiserfs.8
EXTRA_DIST = $(man_MANS)
LDADD = $(top_srcdir)/lib/libmisc.a $(top_srcdir)/reiserfscore/libcore.a
subdir = debugreiserfs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES =
-sbin_PROGRAMS = debugreiserfs$(EXEEXT) unpack$(EXEEXT)
+sbin_PROGRAMS = debugreiserfs$(EXEEXT)
PROGRAMS = $(sbin_PROGRAMS)
am_debugreiserfs_OBJECTS = debugreiserfs.$(OBJEXT) pack.$(OBJEXT) \
- stat.$(OBJEXT) corruption.$(OBJEXT) scan.$(OBJEXT) \
- recover.$(OBJEXT)
+ unpack.$(OBJEXT) stat.$(OBJEXT) corruption.$(OBJEXT) \
+ scan.$(OBJEXT) recover.$(OBJEXT)
debugreiserfs_OBJECTS = $(am_debugreiserfs_OBJECTS)
debugreiserfs_LDADD = $(LDADD)
debugreiserfs_DEPENDENCIES = $(top_srcdir)/lib/libmisc.a \
$(top_srcdir)/reiserfscore/libcore.a
debugreiserfs_LDFLAGS =
-am_unpack_OBJECTS = unpack.$(OBJEXT) pack.$(OBJEXT)
-unpack_OBJECTS = $(am_unpack_OBJECTS)
-unpack_LDADD = $(LDADD)
-unpack_DEPENDENCIES = $(top_srcdir)/lib/libmisc.a \
- $(top_srcdir)/reiserfscore/libcore.a
-unpack_LDFLAGS =
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -146,21 +154,21 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-DIST_SOURCES = $(debugreiserfs_SOURCES) $(unpack_SOURCES)
+DIST_SOURCES = $(debugreiserfs_SOURCES)
NROFF = nroff
MANS = $(man_MANS)
DIST_COMMON = Makefile.am Makefile.in
-SOURCES = $(debugreiserfs_SOURCES) $(unpack_SOURCES)
+SOURCES = $(debugreiserfs_SOURCES)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu debugreiserfs/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@@ -189,9 +197,6 @@ clean-sbinPROGRAMS:
debugreiserfs$(EXEEXT): $(debugreiserfs_OBJECTS) $(debugreiserfs_DEPENDENCIES)
@rm -f debugreiserfs$(EXEEXT)
$(LINK) $(debugreiserfs_LDFLAGS) $(debugreiserfs_OBJECTS) $(debugreiserfs_LDADD) $(LIBS)
-unpack$(EXEEXT): $(unpack_OBJECTS) $(unpack_DEPENDENCIES)
- @rm -f unpack$(EXEEXT)
- $(LINK) $(unpack_LDFLAGS) $(unpack_OBJECTS) $(unpack_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core
@@ -213,7 +218,7 @@ distclean-depend:
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@@ -224,7 +229,7 @@ distclean-depend:
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@@ -371,7 +376,6 @@ all-am: Makefile $(PROGRAMS) $(MANS)
installdirs:
$(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
-
install: install-am
install-exec: install-exec-am
install-data: install-data-am
diff --git a/debugreiserfs/corruption.c b/debugreiserfs/corruption.c
index 981cde6..eb77345 100644
--- a/debugreiserfs/corruption.c
+++ b/debugreiserfs/corruption.c
@@ -4,6 +4,7 @@
*/
#include "debugreiserfs.h"
+#include <time.h>
extern struct reiserfs_fsstat g_stat_info;
@@ -488,7 +489,8 @@ void do_one_corruption_in_one_block (reiserfs_filsys_t * fs,
"not so many unfm ptrs in it\n");
return;
}
- * ((__u32 *)B_I_PITEM (bh, ih) + pos_in_item) = get_sb_block_count (fs->fs_ondisk_sb) + 100;
+ d32_put((__u32 *)B_I_PITEM (bh, ih), pos_in_item,
+ get_sb_block_count (fs->fs_ondisk_sb) + 100);
break;
case 'D': /* delete item */
diff --git a/debugreiserfs/debugreiserfs.8 b/debugreiserfs/debugreiserfs.8
index fe8da4f..80ddb7d 100644
--- a/debugreiserfs/debugreiserfs.8
+++ b/debugreiserfs/debugreiserfs.8
@@ -1,13 +1,13 @@
.\" -*- nroff -*-
.\" Copyright 1996-2004 Hans Reiser.
.\"
-.TH DEBUGREISERFS 8 "February 2004" "Reiserfsprogs 3.6.13"
+.TH DEBUGREISERFS 8 "February 2004" "Reiserfsprogs 3.6.18"
.SH NAME
-debugreiserfs \- debugging tool for the ReiserFS filesystem
+debugreiserfs \- The debugging tool for the ReiserFS filesystem.
.SH SYNOPSIS
.B debugreiserfs
[
-.B -dDJmoqpS
+.B -dDJmoqpuSV
] [
.B -j \fIdevice
] [
@@ -21,69 +21,77 @@ debugreiserfs \- debugging tool for the ReiserFS filesystem
.\" ] [
.I device
.SH DESCRIPTION
-It helps sometimes to solve problems with reiserfs filesystems. Being
-called without options it prints super block of reiserfs filesystem found
+\fBdebugreiserfs\fR sometimes helps to solve problems with reiserfs filesystems.
+When run without options it prints the super block of the ReiserFS filesystem found
on the \fIdevice\fR.
.TP
.I device
is the special file corresponding to the device (e.g /dev/hdXX for
-IDE disk partition or /dev/sdXX for SCSI disk partition).
+an IDE disk partition or /dev/sdXX for a SCSI disk partition).
.SH OPTIONS
.TP
\fB-j\fR \fIdevice\fR
-print contents of journal. Also with the option -p it allows to pack
-journal into archive with other metadata
+prints the contents of the journal. The option -p allows it to pack the journal
+with other metadata into the archive.
.TP
\fB-J\fR
-print journal header.
+prints the journal header.
.TP
.B -d
-print formatted nodes of the internal tree of the filesystem
+prints the formatted nodes of the internal tree of the filesystem.
.TP
.B -D
-print formatted nodes of all used blocks of the filesystem
+prints the formatted nodes of all used blocks of the filesystem.
.TP
.B -m
-print contents of bitmap (not very useful)
+prints the contents of the bitmap (slightly useful).
.TP
.B -o
-print objectid map (not very useful)
+prints the objectid map (slightly useful).
.TP
\fB-B\fR \fIfile\fR
-extract the filesystem list of bad blocks to the specified file.
+takes the list of bad blocks stored in the internal ReiserFS tree and translates it
+into an ascii list written to the specified file.
.TP
\fB-1\fR \fIblocknumber\fR
-print specified block of the filesystem
+prints the specified block of the filesystem.
.TP
.\" \fB-s
.\" scans the partition and prints a line when any kind of reiserfs
.\" formatted nodes found. Can be used to find specific key in the filesystem.
.\" .TP
.B -p
-Makes \fBdebugreiserfs\fR to find filesystem metadata This option
-exists to help reiserfsck debugging. If reiserfsck fails - you may
-extract filesystem metadata with \fBdebugreiserfs\fR -p
-/dev/xxx |gzip -c > xxx.gz. We download that data and make the
-filesystem similar to your with gunzip -c xxx.gz | unpack /dev/xxx
-(unpack is included into reiserfsprogs package). This usually allows
-to reproduce and debug the problem quickly. When data file is not too
-large.
+extracts the filesystem's metadata with \fBdebugreiserfs\fR -p /dev/xxx | gzip -c >
+xxx.gz. None of your data are packed unless a filesystem corruption presents when
+the whole block having this corruption is packed. You send us the output, and we use
+it to create a filesystem with the same strucure as yours using \fBdebugreiserfs -u\fR.
+When the data file is not too large, this usually allows us to quickly reproduce
+and debug the problem.
+.TP
+.B -u
+builds the ReiserFS filesystem image with gunzip -c xxx.gz | \fBdebugreiserfs\fR
+-u /dev/image of the previously packed metadata with \fBdebugreiserfs -p\fR. The
+result image is not the same as the original filesystem, because mostly only metadata
+were packed with \fBdebugreiserfs -p\fR, but the filesystem structure is completely
+recreated.
.TP
.B -S
When -S is not specified -p
.\" and -s
-deals with blocks marked used in the
-filesystem bitmap. With this option set they will work with whole
-device.
+deals with blocks marked used in the filesystem bitmap only. With this option
+set \fBdebugreiserfs\fR will work with the entire device.
.TP
.B -q
-Suppress showing speed of progress when
+When
.\" -s or
--p is in use
+-p is in use, suppress showing the speed of progress.
.SH AUTHOR
-This version of \fBdebugreiserfs\fR has been written by Hans Reiser <reiser@namesys.com>.
+This version of \fBdebugreiserfs\fR has been written by Vitaly Fertman
+<vitaly@namesys.com>.
.SH BUGS
-There are probably few of them. Please, report bugs to ReiserFS mail-list <reiserfs-list@namesys.com>.
+Please report bugs to the ReiserFS developers <reiserfs-dev@namesys.com>, providing
+as much information as possible--your hardware, kernel, patches, settings, all printed
+messages; check the syslog file for any related information.
.SH SEE ALSO
.BR reiserfsck (8),
.BR mkreiserfs (8)
diff --git a/debugreiserfs/debugreiserfs.c b/debugreiserfs/debugreiserfs.c
index a1da13a..5a5f74f 100644
--- a/debugreiserfs/debugreiserfs.c
+++ b/debugreiserfs/debugreiserfs.c
@@ -16,11 +16,13 @@ Options:\n\
-m\t\tprint bitmap blocks\n\
-o\t\tprint objectid map\n\n\
-J\t\tprint journal header\n\
- -j journal_device\n\t\tprint journal\n\
+ -j filename\n\t\tprint journal located on the device 'filename'\n\
+ \t\tstores the journal in the specified file 'filename.\n\
-p\t\tsend filesystem metadata to stdout\n\
+ -u\t\tread stdin and unpack the metadata\n\
-S\t\thandle all blocks, not only used\n\
-1 block\tblock to print\n\
- -q\t\tno speed info (for -p, -s and -n)\n\
+ -q\t\tno speed info\n\
-V\t\tprint version and exit\n\n", argv[0]);\
exit (16);\
}
@@ -29,18 +31,29 @@ Options:\n\
Undocumented options:
-a map_file\n\tstore to the file the map of file. Is used with -n, -N, -r, -f\n
- -f creates a file map.\n
- -S\t\tgo through whole device when running -p, -s or -n\n\
- -U\t\tgo through unused blocks only when running -p, -s or -n\n\
+ -f \tprints the file map specified by -a.\n
+ -n name\n\stcan device for specific name in reiserfs directories\n\
+ -N \tscan tree for specific key in reiserfs directories\n\
+ -k \tscan device either for specific key or for any metadata\n\
+ -r name\n\trecovers the file spacified by -a to the 'name' file.\n\
+
+ -S\t\tgo through whole device when running -p, -k or -n\n\
+ -U\t\tgo through unused blocks only when running -p, -k or -n\n\
-D\t\tprint blocks details scanning the device, not the tree as -d does\n\
- -b bitmap_file\n\t\trunning -p, -s or -n read blocks marked in this bitmap only\n\
- -n\tscan device for specific name in reiserfs directories\n\
- -N\tscan tree for specific key in reiserfs directories\n\
- -s\tscan device either for specific key or for any metadata\n\
+ -b bitmap_file\n\t\trunning -p, -k or -n read blocks marked in this bitmap only\n\
-C\tallow to change reiserfs metadata\n\
- -r\tprint map file content.\n\
-J\tsearch block numbers in the journal\n\
-t\tstat the device\n\
+ -v\tverboes unpack, prints the block number of every block being unpacked\n\
+
+ To build a map of a file blocks by name:
+ debugreiserfs device -a mapfile -n filename
+
+ To build a map of a file blocks by key:
+ debugreiserfs device -a mapfile -k
+
+ To extract some:
+ debugreiserfs device -a mapfile -r filename > backup
*/
#if 1
@@ -98,11 +111,9 @@ static void print_disk_tree (reiserfs_filsys_t * fs, unsigned long block_nr)
for (i = 0; i < count; i++, ih++) {
if (is_indirect_ih(ih)) {
__u32 * ind_item = (__u32 *)B_I_PITEM (bh, ih);
- __u32 unfm_ptr;
for (j = 0; j < (int)I_UNFM_NUM (ih); j ++) {
- unfm_ptr = le32_to_cpu (ind_item [j]);
- if (unfm_ptr) {
+ if (d32_get (ind_item, j)) {
g_stat_info.nr_unformatted += 1;
}
}
@@ -229,7 +240,7 @@ static char * parse_options (struct debugreiserfs_data * data, int argc, char *
else
program_name = argv[ 0 ];
- while ((c = getopt (argc, argv, "a:b:C:F:SU1:psn:Nfr:dDomj:JqtZl:LVB:")) != EOF) {
+ while ((c = getopt (argc, argv, "a:b:C:F:SU1:pkn:Nfr:dDomj:JqtZl:LVB:uv")) != EOF) {
switch (c) {
case 'a': /* -r will read this, -n and -N will write to it */
asprintf (&data->map_file, "%s", optarg);
@@ -237,18 +248,18 @@ static char * parse_options (struct debugreiserfs_data * data, int argc, char *
case 'b':
/* will load bitmap from a file and read only blocks
- marked in it. This is for -p and -s */
+ marked in it. This is for -p and -k */
asprintf (&data->input_bitmap, "%s", optarg);
data->scan_area = EXTERN_BITMAP;
break;
case 'S':
- /* have debugreiserfs -p or -s to read all the device */
+ /* have debugreiserfs -p or -k to read all the device */
data->scan_area = ALL_BLOCKS;
break;
case 'U':
- /* have debugreiserfs -p or -s to read unused blocks only */
+ /* have debugreiserfs -p or -k to read unused blocks only */
data->scan_area = UNUSED_BLOCKS;
break;
@@ -277,11 +288,15 @@ static char * parse_options (struct debugreiserfs_data * data, int argc, char *
data->mode = DO_PACK;
break;
+ case 'u':
+ data->mode = DO_UNPACK;
+ break;
+
case 't':
data->mode = DO_STAT;
break;
- case 's':
+ case 'k':
/* read the device and print reiserfs blocks which contain defined key */
data->mode = DO_SCAN;
break;
@@ -366,6 +381,9 @@ static char * parse_options (struct debugreiserfs_data * data, int argc, char *
case 'V':
data->mode = DO_NOTHING;
break;
+ case 'v':
+ data->options |= BE_VERBOSE;
+ break;
}
}
@@ -527,8 +545,8 @@ static void callback_badblock_print(reiserfs_filsys_t *fs,
tmp_ih = get_ih(badblock_path);
ind_item = (__u32 *)get_item(badblock_path);
- for (i = 0; i < I_UNFM_NUM(tmp_ih); i++, ind_item++)
- fprintf (fd, "%u\n", le32_to_cpu (*ind_item));
+ for (i = 0; i < I_UNFM_NUM(tmp_ih); i++)
+ fprintf (fd, "%u\n", d32_get (ind_item, i));
pathrelse (badblock_path);
}
@@ -639,6 +657,12 @@ int main (int argc, char * argv[])
data = getmem (sizeof (struct debugreiserfs_data));
file_name = parse_options (data, argc, argv);
+ if (data->mode == DO_UNPACK) {
+ do_unpack(file_name, data->journal_device_name,
+ data->input_bitmap, data->options & BE_VERBOSE);
+ return 0;
+ }
+
fs = reiserfs_open (file_name, O_RDONLY, &error, data, 0);
if (no_reiserfs_found (fs)) {
diff --git a/debugreiserfs/debugreiserfs.h b/debugreiserfs/debugreiserfs.h
index 0b74e22..c60a99d 100644
--- a/debugreiserfs/debugreiserfs.h
+++ b/debugreiserfs/debugreiserfs.h
@@ -2,27 +2,21 @@
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
-
#define _GNU_SOURCE
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <time.h>
-#include <malloc.h>
-#include <sys/types.h>
-#include <asm/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
+#ifndef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include "io.h"
#include "misc.h"
#include "reiserfs_lib.h"
-#include "../include/config.h"
+
#include "../version.h"
+#include <string.h>
+#include <errno.h>
+
extern reiserfs_filsys_t * fs;
@@ -38,14 +32,15 @@ extern reiserfs_filsys_t * fs;
#define DO_RECOVER 6
#define DO_TEST 7
#define DO_PACK 8 /* -p extract meta data of reiserfs filesystem */
-#define DO_STAT 9
-#define DO_SCAN_FOR_NAME 10 /* -n */
-#define DO_LOOK_FOR_NAME 11 /* -N */
-#define DO_SCAN_JOURNAL 12 /* -J */
-#define DO_EXTRACT_BADBLOCKS 13
-#define DO_FILE_MAP 14
-#define DO_ZERO_BITMAP 15
-#define DO_NOTHING 16
+#define DO_UNPACK 9 /* -u create the fs by the givem metadata */
+#define DO_STAT 10
+#define DO_SCAN_FOR_NAME 11 /* -n */
+#define DO_LOOK_FOR_NAME 12 /* -N */
+#define DO_SCAN_JOURNAL 13 /* -J */
+#define DO_EXTRACT_BADBLOCKS 14
+#define DO_FILE_MAP 15
+#define DO_ZERO_BITMAP 16
+#define DO_NOTHING 17
/*first bits are in reiserfs_fs.b*/
@@ -54,6 +49,7 @@ extern reiserfs_filsys_t * fs;
#define PRINT_BITMAP 0x40
#define PRINT_OBJECTID_MAP 0x80
#define BE_QUIET 0x100
+#define BE_VERBOSE 0x200
/* these moved to reiserfs_fs.h */
//#define PRINT_TREE_DETAILS
@@ -272,13 +268,16 @@ void do_scan (reiserfs_filsys_t * fs);
/* journal.c */
void scan_journal (reiserfs_filsys_t * fs);
+/* unpack.c */
+extern int do_unpack(char *host, char *j_filename, char *filename, int verbose);
+
void print_map(reiserfs_filsys_t * fs);
struct saved_item {
struct item_head si_ih;
unsigned long si_block;
- int si_item_num;
- struct saved_item * si_next; /* list of items having the same key */
+ int si_item_num, si_entry_pos;
+ struct saved_item *si_next; /* list of items having the same key */
};
/*
diff --git a/debugreiserfs/pack.c b/debugreiserfs/pack.c
index 6e278b4..b390399 100644
--- a/debugreiserfs/pack.c
+++ b/debugreiserfs/pack.c
@@ -114,7 +114,7 @@ static void pack_direct (struct packed_item * pi, struct buffer_head * bh,
set_pi_mask (pi, get_pi_mask (pi) | IH_FREE_SPACE);
if (get_pi_mask(pi) & SAFE_LINK)
- set_key_dirid(&ih->ih_key, le32_to_cpu(*(__u32 *)B_I_PITEM (bh, ih)) );
+ set_key_dirid(&ih->ih_key, d32_get((__u32 *)B_I_PITEM (bh, ih), 0) );
/* send key components which are to be sent */
pack_ih (pi, ih);
@@ -127,8 +127,9 @@ static int should_pack_indirect (__u32 * ind_item, int unfm_num)
int i, len;
for (i = 1, len = 1; i < unfm_num; i ++) {
- if ((ind_item [i] == 0 && ind_item [i - 1] == 0) || /* hole continues */
- le32_to_cpu (ind_item [i]) == le32_to_cpu (ind_item [i - 1]) + 1) { /* subsequent blocks */
+ if ((d32_get(ind_item, i) == 0 && d32_get(ind_item, i - 1) == 0) ||
+ d32_get(ind_item, i) == d32_get(ind_item, i - 1) + 1)
+ {
len ++;
if (len > 2)
return 1;
@@ -161,7 +162,7 @@ static void pack_indirect (struct packed_item * pi, struct buffer_head * bh,
if (get_pi_mask(pi) & SAFE_LINK)
- set_key_dirid(&ih->ih_key, le32_to_cpu(*ind_item) );
+ set_key_dirid(&ih->ih_key, d32_get(ind_item, 0));
pack_ih (pi, ih);
@@ -177,12 +178,13 @@ static void pack_indirect (struct packed_item * pi, struct buffer_head * bh,
fwrite32 (&ind_item [0]);
for (i = 1, len = 1; i < I_UNFM_NUM (ih); i ++) {
- if ((ind_item [i] == 0 && ind_item [i - 1] == 0) || /* hole continues */
- ind_item [i] == ind_item[ i - 1] + 1) { /* subsequent blocks */
+ if ((d32_get(ind_item, i) == 0 && d32_get(ind_item, i - 1) == 0) ||
+ d32_get(ind_item, i) == d32_get(ind_item, i - 1) + 1)
+ {
len ++;
} else {
fwrite_le16 (&len);
- fwrite32 (&ind_item[i]);
+ fwrite32 ((char *)(ind_item + i));
len = 1;
}
}
diff --git a/debugreiserfs/recover.c b/debugreiserfs/recover.c
index 2d35673..f5130e9 100644
--- a/debugreiserfs/recover.c
+++ b/debugreiserfs/recover.c
@@ -265,7 +265,7 @@ static void recover_items(FILE *fp, reiserfs_filsys_t * fs, FILE *target_file) {
int size = sizeof(struct saved_item) - sizeof(struct saved_item *);
struct saved_item *map = NULL;
__u32 map_size = 0;
- int start = 0;
+ int start = -1;
unsigned int i, j;
__u64 offset = 0, length;
long int result = 0;
@@ -293,7 +293,7 @@ static void recover_items(FILE *fp, reiserfs_filsys_t * fs, FILE *target_file) {
}
start = -1;
- } else if (is_direntry_ih(&(cur - 1)->si_ih)) {
+ } else if (is_direntry_ih(&(cur - 1)->si_ih) || is_stat_data_ih(&(cur - 1)->si_ih)) {
brelse(bh);
continue;
} else {
@@ -339,7 +339,7 @@ static void recover_items(FILE *fp, reiserfs_filsys_t * fs, FILE *target_file) {
fwrite(B_I_PITEM(bh, ih), (map + result)->si_ih.ih2_item_len, 1, target_file);
} else if (is_indirect_ih(ih)) {
for (j = 0; j < I_UNFM_NUM (ih); j ++) {
- unfm_ptr = le32_to_cpu (((__u32 *)B_I_PITEM(bh, ih))[j]);
+ unfm_ptr = d32_get((__u32 *)B_I_PITEM(bh, ih), j);
if (!unfm_ptr) {
fseek(target_file, fs->fs_blocksize, SEEK_CUR);
continue;
diff --git a/debugreiserfs/scan.c b/debugreiserfs/scan.c
index 1a5f747..ab39f3e 100644
--- a/debugreiserfs/scan.c
+++ b/debugreiserfs/scan.c
@@ -51,7 +51,7 @@ struct saved_name {
/* attach item to every name in the list */
static void store_item (struct saved_name * name, struct buffer_head * bh,
- struct item_head * ih)
+ struct item_head * ih, int pos)
{
struct saved_item * new;
void * vp;
@@ -62,6 +62,7 @@ static void store_item (struct saved_name * name, struct buffer_head * bh,
new->si_block = bh->b_blocknr;
new->si_item_num = ih - B_N_PITEM_HEAD (bh, 0);
new->si_next = 0;
+ new->si_entry_pos = pos;
vp = tfind (new, &name->items, comp_keys);
if (vp) {
@@ -122,8 +123,10 @@ static int name_found (struct saved_name * name, struct saved_name ** name_in)
cur = *name_in;
while (cur) {
if (!not_of_one_file (&name->dirid, &cur->dirid) &&
- !not_of_one_file (&name->parent_dirid, &cur->parent_dirid)) {
+ !not_of_one_file (&name->parent_dirid, &cur->parent_dirid))
+ {
cur->count ++;
+ *name_in = cur;
return 1;
}
cur = cur->name_next;
@@ -251,12 +254,86 @@ static void scan_for_name (struct buffer_head * bh)
return;
}
+static struct saved_name *scan_for_key(struct key *key) {
+ char *name;
+ struct saved_name * new, *name_in;
+
+ asprintf (&name, "%u_%u", get_key_dirid (key), get_key_objectid (key));
+ new = obstack_alloc (&name_store, sizeof (struct saved_name) + strlen(name));
+
+ /* pointed object */
+ new->dirid = get_key_dirid (key);
+ new->objectid = get_key_objectid (key);
+
+ /* pointer to first name which points the same key */
+ new->first_name = 0;
+
+ /* where this name is from */
+
+ new->parent_dirid = 0;
+ new->parent_objectid = 0;
+ new->block = 0;
+ new->count = 1;
+ new->items = 0;
+
+ /* name */
+ new->name_len = strlen(name);
+ memcpy (new->name, name, new->name_len);
+ new->name [new->name_len] = 0;
+ new->name_next = 0;
+
+ free(name);
+
+ if (name_found (new, &name_in)) {
+ /* there was already exactly this name */
+ obstack_free (&name_store, new);
+ return name_in;
+ }
+
+ saved_names ++;
+ add_name (new, name_in);
+
+ return new;
+}
+
+static int comp_token_key(struct buffer_head *bh, struct item_head *ih, struct key *key) {
+ struct reiserfs_de_head * deh;
+ int j, ih_entry_count = 0;
+ int min_entry_size = 1;
+
+ if ((get_key_dirid(&ih->ih_key) == get_key_dirid(key) ||
+ get_key_dirid(key) == ~(__u32)0) &&
+ (get_key_objectid(&ih->ih_key) == get_key_objectid(key) ||
+ get_key_objectid(key) == ~(__u32)0))
+ return -1;
+
+ if (!is_direntry_ih (ih))
+ return 0;
+
+ deh = B_I_DEH (bh, ih);
+
+ if ( (get_ih_entry_count (ih) > (get_ih_item_len(ih) / (DEH_SIZE + min_entry_size))) ||
+ (get_ih_entry_count (ih) == 0))
+ ih_entry_count = get_ih_item_len(ih) / (DEH_SIZE + min_entry_size);
+ else
+ ih_entry_count = get_ih_entry_count (ih);
+
+
+ for (j = 0; j < ih_entry_count; j ++, deh ++) {
+ if ((get_deh_dirid (deh) == get_key_dirid (key) || (int)get_key_dirid (key) == -1) &&
+ (get_deh_objectid (deh) == get_key_objectid (key) || (int)get_key_objectid (key) == -1))
+ {
+ return j;
+ }
+ }
+
+ return 0;
+}
/* take every item, look for its key in the key index, if it is found - store
item in the sorted list of items of a file */
-static void scan_items (struct buffer_head * bh)
-{
- int i, i_num;
+static void scan_items (struct buffer_head * bh, struct key *key) {
+ int i, i_num, pos;
struct item_head * ih;
struct saved_name * name_in_store;
void * res;
@@ -265,15 +342,21 @@ static void scan_items (struct buffer_head * bh)
ih = B_N_PITEM_HEAD (bh, 0);
i_num = leaf_item_number_estimate(bh);
for (i = 0; i < i_num; i ++, ih ++) {
- res = tfind (&ih->ih_key, &key_index, comp_pointed);
- if (!res)
- /* there were no names pointing to this key */
- continue;
+ if (key) {
+ if (!(pos = comp_token_key(bh, ih, key)))
+ continue;
- /* name pointing to this key found */
- name_in_store = *(struct saved_name **)res;
+ name_in_store = scan_for_key(&ih->ih_key);
+ } else {
+ if (!(res = tfind (&ih->ih_key, &key_index, comp_pointed)))
+ continue;
+
+ /* name pointing to this key found */
+ name_in_store = *(struct saved_name **)res;
+ pos = -1;
+ }
- store_item (name_in_store, bh, ih);
+ store_item (name_in_store, bh, ih, pos);
}
}
@@ -674,7 +757,21 @@ static void save_items(const void *nodep, VISIT value, int level) {
item = *(struct saved_item **)nodep;
while (item) {
- fwrite(item, sizeof(struct saved_item) - sizeof(struct saved_item *), 1, fp);
+ if (fp) {
+ fwrite(item, sizeof(struct saved_item) - sizeof(struct saved_item *), 1, fp);
+ } else {
+ if (is_direntry_ih (&item->si_ih) && item->si_entry_pos != -1) {
+ reiserfs_warning(log_to, "block %lu, item %d (%H): entry %d\n",
+ item->si_block, item->si_item_num,
+ &item->si_ih, item->si_entry_pos);
+ } else {
+ reiserfs_warning(log_to, "block %lu, item %d belongs to file %K: %H\n",
+ item->si_block, item->si_item_num, &item->si_ih.ih_key,
+ &item->si_ih);
+
+ }
+ }
+
item = item->si_next;
}
}
@@ -688,23 +785,27 @@ static void make_map(const void *nodep, VISIT value, int level) {
if (value == leaf || value == postorder) {
while (name) {
- asprintf(&file_name, "%s.%d", map_file(fs), ++nr);
- reiserfs_warning (log_to, "%d - (%d): [%K]:\"%s\": stored in the %s\n",
- nr, name->count, &name->parent_dirid, name->name, file_name);
-
- if (fp == 0) {
- fp = fopen (file_name, "w+");
- if (!fp)
- reiserfs_panic ("could open %s: %m", file_name);
+ if (map_file(fs)) {
+ asprintf(&file_name, "%s.%d", map_file(fs), ++nr);
+ reiserfs_warning (log_to, "%d - (%d): [%K]:\"%s\": stored in the %s\n",
+ nr, name->count, &name->parent_dirid, name->name, file_name);
+
+ if (fp == 0) {
+ fp = fopen (file_name, "w+");
+ if (!fp)
+ reiserfs_panic ("could open %s: %m", file_name);
+ }
}
-
+
if (name->items)
twalk (name->items, save_items);
name = name->name_next;
- fclose(fp);
- fp = NULL;
- free(file_name);
+ if (fp) {
+ fclose(fp);
+ fp = NULL;
+ free(file_name);
+ }
}
}
}
@@ -807,6 +908,7 @@ static void look_for_name (reiserfs_filsys_t * fs)
}
}
+#if 0
static void scan_for_key (struct buffer_head * bh, struct key * key)
{
int i, j, i_num;
@@ -849,8 +951,7 @@ static void scan_for_key (struct buffer_head * bh, struct key * key)
}
return;
}
-
-
+#endif
void do_scan (reiserfs_filsys_t * fs)
{
@@ -900,8 +1001,40 @@ void do_scan (reiserfs_filsys_t * fs)
reiserfs_warning (stderr, "looking for (%K)\n", &key);
}
+ if (debug_mode (fs) == DO_SCAN_FOR_NAME) {
+ done = 0;
+ for (i = 0; i < get_sb_block_count (fs->fs_ondisk_sb); i ++) {
+ if (!reiserfs_bitmap_test_bit (input_bitmap (fs), i))
+ continue;
+ bh = bread (fs->fs_dev, i, fs->fs_blocksize);
+ if (!bh) {
+ printf ("could not read block %lu\n", i);
+ continue;
+ }
+ type = who_is_this (bh->b_data, bh->b_size);
+ if (type == THE_LEAF || type == HAS_IH_ARRAY)
+ scan_for_name (bh);
+ else
+ reiserfs_bitmap_clear_bit (input_bitmap (fs), i);
+ brelse (bh);
+ print_how_far (stderr, &done, total, 1, be_quiet (fs));
+ }
+ }
+
+ fprintf (stderr, "\n");
+ if (debug_mode (fs) == DO_SCAN_FOR_NAME)
+ fprintf (stderr, "There were found %d names matching the pattern \"%s\", %d names skipped\n",
+ saved_names, name_pattern (fs), skipped_names);
+ fflush (stderr);
+
+
+ /* step 2: */
done = 0;
+ total = reiserfs_bitmap_ones (input_bitmap (fs));
+ printf ("%ld bits set in bitmap\n", total);
for (i = 0; i < get_sb_block_count (fs->fs_ondisk_sb); i ++) {
+ int type;
+
if (!reiserfs_bitmap_test_bit (input_bitmap (fs), i))
continue;
bh = bread (fs->fs_dev, i, fs->fs_blocksize);
@@ -914,68 +1047,23 @@ void do_scan (reiserfs_filsys_t * fs)
case THE_JDESC:
if (!get_key_dirid (&key))
printf ("block %lu is journal descriptor\n", i);
- reiserfs_bitmap_clear_bit (input_bitmap (fs), i);
break;
case THE_SUPER:
if (!get_key_dirid (&key))
printf ("block %lu is reiserfs super block\n", i);
- reiserfs_bitmap_clear_bit (input_bitmap (fs), i);
break;
case THE_INTERNAL:
if (!get_key_dirid (&key))
printf ("block %lu is reiserfs internal node\n", i);
- reiserfs_bitmap_clear_bit (input_bitmap (fs), i);
break;
case THE_LEAF:
case HAS_IH_ARRAY:
- if (debug_mode (fs) == DO_SCAN_FOR_NAME) {
- scan_for_name (bh);
- } else if (get_key_dirid (&key)) {
- scan_for_key (bh, &key);
- } else {
- printf ("block %lu is reiserfs leaf node\n", i);
- }
+ scan_items (bh, (debug_mode (fs) == DO_SCAN_FOR_NAME ? NULL : &key));
break;
default:
- reiserfs_bitmap_clear_bit (input_bitmap (fs), i);
break;
}
- brelse (bh);
- print_how_far (stderr, &done, total, 1, be_quiet (fs));
- }
-
- fprintf (stderr, "\n");
- if (debug_mode (fs) == DO_SCAN_FOR_NAME)
- fprintf (stderr, "There were found %d names matching the pattern \"%s\", %d names skipped\n",
- saved_names, name_pattern (fs), skipped_names);
- fflush (stderr);
-
-
- if (debug_mode (fs) != DO_SCAN_FOR_NAME)
- return;
-
- /* step 2: */
- done = 0;
- total = reiserfs_bitmap_ones (input_bitmap (fs));
- printf ("%ld bits set in bitmap\n", total);
- for (i = 0; i < get_sb_block_count (fs->fs_ondisk_sb); i ++) {
- int type;
-
- if (!reiserfs_bitmap_test_bit (input_bitmap (fs), i))
- continue;
- bh = bread (fs->fs_dev, i, fs->fs_blocksize);
- if (!bh) {
- printf ("could not read block %lu\n", i);
- continue;
- }
- type = who_is_this (bh->b_data, bh->b_size);
- if (type != THE_LEAF && type != HAS_IH_ARRAY) {
- brelse (bh);
- continue;
- }
- scan_items (bh);
-
brelse (bh);
print_how_far (stderr, &done, total, 1, be_quiet (fs));
}
diff --git a/debugreiserfs/unpack.c b/debugreiserfs/unpack.c
index d8d906c..c58e2ca 100644
--- a/debugreiserfs/unpack.c
+++ b/debugreiserfs/unpack.c
@@ -9,8 +9,8 @@
#define print_usage_and_exit() die ("Usage: %s [-v] [-b filename] device\n\
-v prints blocks number of every block unpacked\n\
--b filename makes unpack to save bitmap of blocks unpacked\n\
--j filename makes unpack to store journal in specified file\n", argv[0]);
+-b filename saves bitmap of blocks unpacked to filename\n\
+-j filename stores journal in the filename\n", argv[0]);
/* when super block gets unpacked for the first time - create a bitmap
@@ -235,7 +235,7 @@ static void unpack_indirect (struct packed_item * pi, struct buffer_head * bh,
ind_item = (__u32 *)B_I_PITEM (bh, ih);
if (get_pi_mask(pi) & SAFE_LINK) {
- *ind_item = cpu_to_le32(get_key_dirid(&ih->ih_key));
+ d32_put(ind_item, 0, get_key_dirid(&ih->ih_key));
set_key_dirid(&ih->ih_key, (__u32)-1);
return;
}
@@ -250,12 +250,12 @@ static void unpack_indirect (struct packed_item * pi, struct buffer_head * bh,
__u32 base;
fread32 (ind_item);
fread_le16 (&v16);
- base = le32_to_cpu(ind_item[0]);
+ base = d32_get(ind_item, 0);
for (i = 1; i < v16; i ++) {
- if (ind_item[0] != 0)
- ind_item [i] = cpu_to_le32(base + i);
+ if (base != 0)
+ d32_put(ind_item, i, base + i);
else
- ind_item [i] = 0;
+ d32_put(ind_item, i, 0);
}
ind_item += i;
}
@@ -274,7 +274,7 @@ static void unpack_direct (struct packed_item * pi, struct buffer_head * bh,
set_ih_entry_count (ih, 0xffff);
if (get_pi_mask(pi) & SAFE_LINK) {
- *d_item = cpu_to_le32(get_key_dirid(&ih->ih_key));
+ d32_put(d_item, 0, get_key_dirid(&ih->ih_key));
set_key_dirid(&ih->ih_key, (__u32)-1);
} else {
memset (d_item, 'a', get_pi_item_len(pi));
@@ -583,43 +583,27 @@ out:
}
-int main (int argc, char ** argv)
-{
+int do_unpack(char *host, char *j_filename, char *filename, int verbose) {
int fd, fdj = -2;
- int c;
- char * j_filename;
- char * filename = ".bitmap";
- struct rlimit lim = {0xffffffff, 0xffffffff};
-
- print_banner ("unpack");
+ struct rlimit lim = {RLIM_INFINITY, RLIM_INFINITY};
+ if (filename == NULL)
+ filename = ".bitmap";
+
+ if (j_filename)
+ Default_journal = 0;
+
/* with this 2.4.0-test9's file_write does not send SIGXFSZ */
if (setrlimit (RLIMIT_FSIZE, &lim)) {
fprintf (stderr, "sertlimit failed: %m\n");
}
- while ((c = getopt (argc, argv, "vb:j:")) != EOF) {
- switch (c) {
- case 'v':
- verbose = 1;
- break;
- case 'b':
- asprintf (&filename, "%s", optarg);
- break;
- case 'j':
- Default_journal = 0;
- asprintf (&j_filename, "%s", optarg);
- break;
- }
+ if (misc_device_mounted(host) > 0) {
+ fprintf(stderr, "%s seems mounted, umount it first\n", host);
+ return 0;
}
- if (optind != argc - 1)
- /* only one non-option argument is permitted */
- print_usage_and_exit();
-
- if (misc_device_mounted(argv[optind]) > 0)
- reiserfs_panic ("%s seems mounted, umount it first\n", argv[optind]);
- fd = open (argv[optind], O_RDWR | O_LARGEFILE);
+ fd = open (host, O_RDWR | O_LARGEFILE);
if (fd == -1) {
perror ("open failed");
return 0;
diff --git a/depcomp b/depcomp
index 807b991..aea3d00 100755
--- a/depcomp
+++ b/depcomp
@@ -206,6 +206,44 @@ aix)
rm -f "$tmpdepfile"
;;
+icc)
+ # Intel's C compiler understands `-MD -MF file'. However on
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using \ :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
@@ -265,9 +303,7 @@ dashmstdout)
shift
fi
- # Remove `-o $object'. We will use -o /dev/null later,
- # however we can't do the remplacement now because
- # `-o $object' might simply not be used
+ # Remove `-o $object'.
IFS=" "
for arg
do
@@ -287,7 +323,11 @@ dashmstdout)
done
test -z "$dashmflag" && dashmflag=-M
- "$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ # Require at least two characters before searching for `:'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
@@ -306,6 +346,13 @@ dashXmstdout)
makedepend)
"$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
# X makedepend
shift
cleared=no
@@ -318,7 +365,9 @@ makedepend)
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
- -*)
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
diff --git a/fsck/Makefile.in b/fsck/Makefile.in
index e97c663..53b6bcc 100644
--- a/fsck/Makefile.in
+++ b/fsck/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.7.2 from Makefile.am.
+# Makefile.in generated by automake 1.7.6 from Makefile.am.
# @configure_input@
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,7 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+host_triplet = @host@
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
+am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
+build = @build@
build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
@@ -117,6 +131,7 @@ EXTRA_DIST = $(man_MANS)
reiserfsck_LDADD = $(top_srcdir)/lib/libmisc.a $(top_srcdir)/reiserfscore/libcore.a
subdir = fsck
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES =
@@ -161,10 +176,10 @@ all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu fsck/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@@ -222,7 +237,7 @@ distclean-depend:
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@@ -233,7 +248,7 @@ distclean-depend:
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@@ -380,7 +395,6 @@ all-am: Makefile $(PROGRAMS) $(MANS)
installdirs:
$(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
-
install: install-am
install-exec: install-exec-am
install-data: install-data-am
diff --git a/fsck/check_tree.c b/fsck/check_tree.c
index 9688968..237dc35 100644
--- a/fsck/check_tree.c
+++ b/fsck/check_tree.c
@@ -5,6 +5,7 @@
#include "fsck.h"
+#if 0
struct check_relocated {
__u32 old_dir_id;
__u32 old_objectid;
@@ -82,6 +83,8 @@ void clear_relocated_list() {
}
}
+#endif
+
//
//
//
@@ -351,12 +354,11 @@ static int bad_stat_data (reiserfs_filsys_t * fs,
if (id_map_mark(proper_id_map (fs), objectid)) {
fsck_log ("bad_stat_data: The objectid (%lu) is shared by at least two "
- "files\n", objectid);
-
- if (fsck_mode (fs) == FSCK_FIX_FIXABLE)
- to_be_relocated (&ih->ih_key);
-
+ "files. Can be fixed with --rebuild-tree only.\n", objectid);
+#if 0
+ to_be_relocated (&ih->ih_key);
// one_more_corruption (fs, FIXABLE);
+#endif
}
return 0;
@@ -392,11 +394,11 @@ static int bad_direct_item (reiserfs_filsys_t * fs,
inline void handle_one_pointer (reiserfs_filsys_t * fs,
struct buffer_head * bh,
- __u32 * ptr)
+ __u32 * item, int offset)
{
if (fsck_mode (fs) == FSCK_FIX_FIXABLE) {
fsck_log (" - zeroed");
- *ptr = 0;
+ d32_put (item, offset, 0);
mark_buffer_dirty (bh);
} else {
one_more_corruption (fs, FIXABLE);
@@ -421,7 +423,7 @@ static int bad_badblocks_item (reiserfs_filsys_t * fs, struct buffer_head * bh,
return 0;
for (i = 0; i < I_UNFM_NUM (ih); i ++) {
- if (!le32_to_cpu (ind [i])) {
+ if (!d32_get (ind, i)) {
/* fsck_log ("%s: block %lu: badblocks item (%H) has zero pointer.",
__FUNCTION__, bh->b_blocknr, ih);
@@ -435,14 +437,14 @@ static int bad_badblocks_item (reiserfs_filsys_t * fs, struct buffer_head * bh,
}
/* check list of badblocks pointers */
- if (le32_to_cpu (ind [i]) >= get_sb_block_count (fs->fs_ondisk_sb)) {
+ if (d32_get (ind, i) >= get_sb_block_count (fs->fs_ondisk_sb)) {
fsck_log ("%s: badblock pointer (block %lu) points out of disk spase (%lu)",
- __FUNCTION__, bh->b_blocknr, le32_to_cpu (ind [i]));
- handle_one_pointer (fs, bh, &ind[i]);
+ __FUNCTION__, bh->b_blocknr, d32_get (ind, i));
+ handle_one_pointer (fs, bh, ind, i);
fsck_log ("\n");
}
- if (did_we_meet_it (le32_to_cpu (ind [i]))) {
+ if (did_we_meet_it (d32_get (ind, i))) {
/* it can be
1. not_data_block
delete pointer
@@ -450,23 +452,23 @@ static int bad_badblocks_item (reiserfs_filsys_t * fs, struct buffer_head * bh,
advice to run fix-fixable if there is no fatal errors
with list of badblocks, say that it could fix it. */
- if (not_data_block (fs, le32_to_cpu (ind [i]))) {
+ if (not_data_block (fs, d32_get (ind, i))) {
fsck_log ("%s: badblock pointer (block %lu) points on fs metadata (%lu)",
- __FUNCTION__, bh->b_blocknr, le32_to_cpu (ind [i]));
- handle_one_pointer (fs, bh, &ind[i]);
+ __FUNCTION__, bh->b_blocknr, d32_get (ind, i));
+ handle_one_pointer (fs, bh, ind, i);
fsck_log ("\n");
} else {
one_more_corruption(fs, FIXABLE);
fsck_log ("%s: badblock pointer (block %lu) points to a block (%lu) "
"which is in the tree already. Use badblock option (-B) to"
" fix the problem\n", __FUNCTION__, bh->b_blocknr,
- le32_to_cpu(ind[i]));
+ d32_get (ind, i));
}
continue;
}
- we_met_it(le32_to_cpu(ind[i]));
+ we_met_it(d32_get(ind, i));
}
return 0;
@@ -488,33 +490,31 @@ static int bad_indirect_item (reiserfs_filsys_t * fs, struct buffer_head * bh,
}
for (i = 0; i < I_UNFM_NUM (ih); i ++) {
-// __u32 unfm_ptr;
fsck_check_stat (fs)->unfm_pointers ++;
-// unfm_ptr = le32_to_cpu (ind [i]);
- if (!le32_to_cpu (ind [i])) {
+ if (!d32_get (ind, i)) {
fsck_check_stat (fs)->zero_unfm_pointers ++;
continue;
}
/* check unformatted node pointer and mark it used in the
control bitmap */
- if (bad_block_number (fs, le32_to_cpu (ind [i]))) {
+ if (bad_block_number (fs, d32_get (ind, i))) {
fsck_log ("%s: block %lu: The item %k has the bad pointer (%d) to "
"the block (%lu)", __FUNCTION__, bh->b_blocknr,
- &ih->ih_key, i, le32_to_cpu (ind [i]));
+ &ih->ih_key, i, d32_get (ind, i));
- handle_one_pointer (fs, bh, &ind[i]);
+ handle_one_pointer (fs, bh, ind, i);
fsck_log ("\n");
continue;
}
- if (got_already (fs, le32_to_cpu (ind [i]))) {
+ if (got_already (fs, d32_get (ind, i))) {
fsck_log ("%s: block %lu: The item (%H) has the bad pointer (%d) "
"to the block (%lu), which is in tree already",
- __FUNCTION__, bh->b_blocknr, ih, i, le32_to_cpu(ind[i]));
+ __FUNCTION__, bh->b_blocknr, ih, i, d32_get (ind, i));
- handle_one_pointer (fs, bh, &ind [i]);
+ handle_one_pointer (fs, bh, ind, i);
fsck_log ("\n");
continue;
}
@@ -856,6 +856,72 @@ static inline int h_to_level (reiserfs_filsys_t * fs, int h)
return get_sb_tree_height (fs->fs_ondisk_sb) - h - 1;
}
+#if 0
+int dc_fix(struct buffer_head *bh, int pos, __u32 block) {
+ if (!bh || !bh->b_data)
+ return -1;
+
+ if (B_NR_ITEMS(bh) < pos)
+ return -1;
+
+ set_dc_child_blocknr(B_N_CHILD(bh,pos), block);
+
+ mark_buffer_dirty(bh);
+ bwrite(bh);
+
+ return 0;
+}
+
+/* Removes @N-th key and @(N+1) pointer. */
+int internal_remove(struct buffer_head *bh, int pos) {
+ char *delete;
+ __u32 nr;
+
+ if (!bh || !bh->b_data)
+ return -1;
+
+ if (B_NR_ITEMS(bh) < pos)
+ return -1;
+
+ delete = (char *)B_N_CHILD(bh, pos + 2);
+ memmove(delete - DC_SIZE, delete,
+ bh->b_size - (delete - bh->b_data));
+
+ delete = (char *)B_N_PDELIM_KEY(bh, pos + 1);
+ memmove(delete - KEY_SIZE, delete,
+ bh->b_size - (delete - bh->b_data));
+
+ nr = B_NR_ITEMS(bh) - 1;
+
+ set_blkh_nr_items(B_BLK_HEAD(bh), nr);
+ set_blkh_free_space(B_BLK_HEAD(bh), bh->b_size -
+ (BLKH_SIZE + KEY_SIZE * nr + DC_SIZE * (nr + 1)));
+
+ mark_buffer_dirty(bh);
+ bwrite(bh);
+
+ return 0;
+}
+
+int leaf_fix_key_oid(struct buffer_head *bh, int pos, __u32 oid) {
+ struct item_head * ih;
+
+
+ if (!bh || !bh->b_data)
+ return -1;
+
+ if (B_NR_ITEMS(bh) < pos)
+ return -1;
+
+ ih = B_N_PITEM_HEAD (bh, pos);
+ set_key_objectid(&ih->ih_key, oid);
+
+ mark_buffer_dirty(bh);
+ bwrite(bh);
+
+ return 0;
+}
+#endif
/* bh must be formatted node. blk_level must be tree_height - h + 1 */
static int bad_node (reiserfs_filsys_t * fs, struct buffer_head ** path, int h)
diff --git a/fsck/fsck.h b/fsck/fsck.h
index bc7e79c..16648a5 100644
--- a/fsck/fsck.h
+++ b/fsck/fsck.h
@@ -5,24 +5,19 @@
#define _GNU_SOURCE
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <asm/types.h>
-#include <sys/vfs.h>
-#include <errno.h>
-#include <time.h>
-#include <asm/types.h>
-#include <assert.h>
+#ifndef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include "io.h"
#include "misc.h"
#include "reiserfs_lib.h"
-#include "../include/config.h"
+#include <string.h>
+#include <errno.h>
+#include <time.h>
+#include <assert.h>
+
#include "../version.h"
/* main.c */
@@ -210,9 +205,11 @@ void do_clean_attributes (reiserfs_filsys_t * fs);
int bad_pair (reiserfs_filsys_t *, struct buffer_head * bh, int i);
int bad_leaf_2 (reiserfs_filsys_t *, struct buffer_head * bh);
+#if 0
extern int should_be_relocated (struct key * key);
extern void to_be_relocated (struct key * key);
extern void clear_relocated_list(void);
+#endif
/* ustree.c */
void reiserfsck_paste_into_item (struct path * path, const char * body, int size);
@@ -231,10 +228,6 @@ typedef int do_after_read_t (reiserfs_filsys_t *, struct buffer_head **, int h);
typedef int do_on_full_path_t (reiserfs_filsys_t *, struct buffer_head **, int);
void pass_through_tree (reiserfs_filsys_t *, do_after_read_t, do_on_full_path_t, int depth);
-//int comp_keys_3 (void * key1, void * key2);
-//int comp_dir_entries (void * key1, void * key2);
-
-
/* bitmap.c */
int reiserfsck_reiserfs_new_blocknrs (reiserfs_filsys_t * fs,
unsigned long * pblocknrs,
@@ -250,7 +243,6 @@ int is_block_uninsertable (unsigned long block);
/* objectid.c */
int comp_ids(const void *p1, const void *p2);
-int is_objectid_used (reiserfs_filsys_t *, __u32 objectid);
typedef struct id_map {
void **index;
diff --git a/fsck/main.c b/fsck/main.c
index 801a84e..9c179d7 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -7,6 +7,7 @@
#include <getopt.h>
#include <sys/resource.h>
#include <sys/mman.h>
+#include <signal.h>
extern int screen_width;
extern int screen_savebuffer_len;
@@ -334,7 +335,7 @@ void warn_what_will_be_done (char * file_name, struct fsck_data * data)
{
FILE * warn_to;
- warn_to = (data->progress ?: stderr);
+ warn_to = (data->progress ? data->progress : stderr);
if (data->mode == FSCK_REBUILD)
reiserfs_warning (warn_to, REBUILD_WARNING, file_name);
@@ -412,7 +413,7 @@ void warn_what_will_be_done (char * file_name, struct fsck_data * data)
reiserfs_warning (warn_to, "Will put log info to '%s'\n",
(data->log == stdout) ? "stdout" :
- (data->log_file_name ? : "fsck.run"));
+ (data->log_file_name ? data->log_file_name : "fsck.run"));
if (!(data->options & OPT_YES) && !user_confirmed (warn_to, "\nDo you want to "
"run this program?[N/Yes] (note need to type Yes if you do):", "Yes\n"))
@@ -801,11 +802,6 @@ static void prepare_fs_for_check(reiserfs_filsys_t * fs) {
fsck_progress ("Filesystem seems mounted read-only. Skipping journal "
"replay.\n");
-
- if (fsck_mode (fs) == FSCK_FIX_FIXABLE) {
- fsck_progress ("--fix-fixable ignored\n");
- fsck_mode (fs) = FSCK_CHECK;
- }
} else if (!fsck_skip_journal (fs)) {
if (reiserfs_journal_params_check(fs)) {
reiserfs_close (fs);
@@ -1115,7 +1111,7 @@ static void check_fs (reiserfs_filsys_t * fs)
reiserfs_close (fs);
close_rollback_file ();
- clear_relocated_list();
+ //clear_relocated_list();
time (&t);
fsck_progress ("###########\n"
@@ -1190,10 +1186,10 @@ int main (int argc, char * argv [])
{
char * file_name;
struct fsck_data * data;
- struct rlimit rlim = {0xffffffff, 0xffffffff};
+ struct rlimit rlim = {RLIM_INFINITY, RLIM_INFINITY};
char *width;
int retval;
- int errno;
+ int error;
width = getenv("COLUMNS");
if ( width )
@@ -1257,14 +1253,14 @@ int main (int argc, char * argv [])
if (open_devices_for_rollback (file_name, data) == -1)
exit(EXIT_OPER);
} else {
- fs = reiserfs_open (file_name, O_RDONLY, &errno, data,
+ fs = reiserfs_open (file_name, O_RDONLY, &error, data,
data->mode != FSCK_SB);
if (data->mode != FSCK_SB) {
if (no_reiserfs_found (fs)) {
- if (errno) {
+ if (error) {
die ("Failed to open the device '%s': %s\n\n",
- file_name, strerror(errno));
+ file_name, strerror(error));
} else {
die ("Failed to open the filesystem.\n\n"
"If the partition table has not been changed, and the partition is\n"
diff --git a/fsck/pass0.c b/fsck/pass0.c
index 17d3bcc..3e4b9e3 100644
--- a/fsck/pass0.c
+++ b/fsck/pass0.c
@@ -263,7 +263,10 @@ static int verify_directory_item (reiserfs_filsys_t * fs, struct buffer_head * b
if ( (get_ih_entry_count (ih) > (get_ih_item_len(ih) / (DEH_SIZE + min_entry_size))) ||
(get_ih_entry_count (ih) == 0))
+ {
set_ih_entry_count (ih, (int)get_ih_item_len(ih) / (DEH_SIZE + min_entry_size));
+ mark_buffer_dirty (bh);
+ }
if (get_ih_entry_count (ih) == 0) {
delete_item (fs, bh, item_num);
@@ -561,7 +564,8 @@ static int is_wrong_short_key (struct key * key) {
if (get_key_dirid (key) == 0 || get_key_objectid (key) == 0 || get_key_objectid (key) == 1 ||
get_key_dirid (key) == ~(__u32)0 || get_key_objectid (key) == ~(__u32)0 ||
get_key_dirid (key) == get_key_objectid (key) ||
- (get_key_dirid (key) == 1 && get_key_objectid (key) != 2) ||
+ /* the alloc=packing_groups used to allow dirid = 1
+ (get_key_dirid (key) == 1 && get_key_objectid (key) != 2) || */
(get_key_dirid (key) != 1 && get_key_objectid (key) == 2) )
return 1;
@@ -1285,7 +1289,7 @@ static void pass0_correct_leaf (reiserfs_filsys_t * fs,
*/
ind_item = (__u32 *)B_I_PITEM (bh, ih);
for (j = 0; j < (int)I_UNFM_NUM (ih); j ++) {
- unfm_ptr = le32_to_cpu (ind_item [j]);
+ unfm_ptr = d32_get (ind_item, j);
if (!unfm_ptr)
continue;
#if 0
@@ -1309,7 +1313,7 @@ static void pass0_correct_leaf (reiserfs_filsys_t * fs,
fsck_log ("pass0: %d-th pointer (%lu) in item %k (leaf block %lu) is wrong\n",
j, unfm_ptr, &ih->ih_key, bh->b_blocknr);
*/
- ind_item [j] = 0;
+ d32_put(ind_item, j, 0);
dirty = 1;
continue;
}
@@ -1436,10 +1440,10 @@ static int is_bad_indirect (struct item_head * ih, char * item, int dev, int blo
for (i = 0; i < I_UNFM_NUM (ih); i ++) {
__u32 * ind = (__u32 *)item;
- if (le32_to_cpu (ind[i]) >= blocks) {
+ if (d32_get (ind, i) >= blocks) {
bad ++;
fsck_log ("is_bad_indirect: %d-th pointer of item %H looks bad (%lu)\n",
- i, ih, le32_to_cpu (ind [i]));
+ i, ih, d32_get (ind, i));
continue;
}
}
diff --git a/fsck/pass1.c b/fsck/pass1.c
index b279f89..15a338b 100644
--- a/fsck/pass1.c
+++ b/fsck/pass1.c
@@ -4,7 +4,6 @@
*/
#include "fsck.h"
-#include <stdlib.h>
reiserfs_bitmap_t * bad_unfm_in_tree_once_bitmap;
@@ -106,7 +105,7 @@ static void indirect_in_tree (struct buffer_head * bh,
unp = (__u32 *)B_I_PITEM (bh, ih);
for (i = 0; i < I_UNFM_NUM (ih); i ++) {
- unfm_ptr = le32_to_cpu (unp[i]);
+ unfm_ptr = d32_get (unp, i);
if (unfm_ptr == 0)
continue;
if ((ret = still_bad_unfm_ptr_1 (unfm_ptr)))
@@ -395,8 +394,8 @@ static void pass1_correct_leaf (reiserfs_filsys_t * fs,
/* correct indirect items */
ind_item = (__u32 *)B_I_PITEM (bh, ih);
- for (j = 0; j < I_UNFM_NUM (ih); j ++, ind_item ++) {
- unfm_ptr = le32_to_cpu (*ind_item);
+ for (j = 0; j < I_UNFM_NUM (ih); j ++) {
+ unfm_ptr = d32_get (ind_item, j);
if (!unfm_ptr)
continue;
@@ -410,7 +409,7 @@ static void pass1_correct_leaf (reiserfs_filsys_t * fs,
/* 1. zero slots pointing to a leaf */
if (is_used_leaf (unfm_ptr)) {
dirty ++;
- *ind_item = 0;
+ d32_put (ind_item, j, 0);
pass_1_stat (fs)->pointed_leaves ++;
continue;
}
@@ -425,7 +424,7 @@ static void pass1_correct_leaf (reiserfs_filsys_t * fs,
else {
/* Yes, we have seen this pointer already, zero other pointers to it. */
dirty ++;
- *ind_item = 0;
+ d32_put (ind_item, j, 0);
pass_1_stat (fs)->non_unique_pointers ++;
continue;
}
diff --git a/fsck/reiserfsck.8 b/fsck/reiserfsck.8
index 79cb612..078fc86 100644
--- a/fsck/reiserfsck.8
+++ b/fsck/reiserfsck.8
@@ -1,9 +1,9 @@
.\" -*- nroff -*-
.\" Copyright 1996-2004 Hans Reiser.
.\"
-.TH REISERFSCK 8 "February 2004" "Reiserfsprogs-3.6.13"
+.TH REISERFSCK 8 "February 2004" "Reiserfsprogs-3.6.18"
.SH NAME
-reiserfsck \- checking tool for the ReiserFS filesystem
+reiserfsck \- The checking tool for the ReiserFS filesystem.
.SH SYNOPSIS
.B reiserfsck
[ \fB-afprVy\fR ]
@@ -28,20 +28,24 @@ reiserfsck \- checking tool for the ReiserFS filesystem
any necessary transactions, and either checks or repairs the file system.
.TP
.I device
-is the special file corresponding to the device or partition (e.g /dev/hdXX
-for IDE disk partition or /dev/sdXX for SCSI disk partition).
+is the special file corresponding to a device or to a partition (e.g
+/dev/hdXX for an IDE disk partition or /dev/sdXX for a SCSI disk partition).
.SH OPTIONS
.TP
.B --rebuild-sb
This option recovers the superblock on a Reiserfs partition. Normally you
only need this option if mount reports "read_super_block: can't find
a reiserfs file system" and you are sure that a Reiserfs file system is
-there.
+there. But remember that if you have used some partition editor program and
+now you cannot find a filesystem, probably something has gone wrong while
+repartitioning and the start of the partition has been changed. If so,
+instead of rebuilding the super block on a wrong place you should find the
+correct start of the partition first.
.TP
.B --check
-This default action checks file system consistency and reports but
+This default action checks filesystem consistency and reports, but
does not repair any corruption that it finds. This option may be
-used on a read-only file system mount.
+used on a read-only file system mount.
.TP
.B --fix-fixable
This option recovers certain kinds of corruption that do not require
@@ -63,7 +67,12 @@ filesystem will be left in the unmountable state to avoid subsequent
data corruptions.
.TP
.B --clean-attributes
-This option cleans reserved fields of Stat-Data items.
+This option cleans reserved fields of Stat-Data items. There were days when
+there were no extended attributes in reiserfs. When they were implemented old
+partitions needed to be cleaned first -- reiserfs code in the kernel did not
+care about not used fields in its strutures. Thus if you have used one of the
+old (pre-attrbutes) kernels with a ReiserFS filesystem and you want to use
+extented attribues there, you should clean the filesystem first.
.TP
.B \fB--journal \fIdevice \fR, \fB-j \fIdevice \fR
This option supplies the device name of the current file system journal.
@@ -79,18 +88,18 @@ This option causes \fBreiserfsck\fR to correct file sizes that
are larger than the offset of the last discovered byte. This
implies that holes at the end of a file will be removed. File
sizes that are smaller than the offset of the last discovered
-byte are corrected by --fix-fixable.
+byte are corrected by \fB--fix-fixable\fR.
.TP
\fB--badblocks \fIfile\fR, \fB-B \fI file\fR
This option sets the badblock list to be the list of blocks specified in
the given `file`. The filesystem badblock list is cleared before the new
-list is added. Can be used with \fB--fix-fixable\fR to fix the list of
-badblocks (see debugreiserfs -B) and must be given with \fB--rebuild-tree\fR
-option every time if the block device has bad blocks.
+list is added. It can be used with \fB--fix-fixable\fR to fix the list of
+badblocks (see \fBdebugreiserfs -B\fR). If the device has bad blocks, every
+time it must be given with the \fB--rebuild-tree\fR option.
.TP
\fB--logfile \fIfile\fR, \fB-l \fI file\fR
This option causes \fBreiserfsck\fR to report any corruption it finds
-to the specified log file rather than stderr.
+to the specified log file rather than to stderr.
.TP
.B --nolog, -n
This option prevents \fBreiserfsck\fR from reporting any kinds of corruption.
@@ -100,24 +109,24 @@ This option prevents \fBreiserfsck\fR from reporting its rate of progress.
.TP
.B --yes, -y
This option inhibits \fBreiserfsck\fR from asking you for confirmation after
-telling you what it is going to do, assuming yes. For safety, it does not
-work with the \fB--rebuild-tree\fR option.
+telling you what it is going to do. It will assuem you confirm. For safety,
+it does not work with the \fB--rebuild-tree\fR option.
.TP
\fB-a\fR, \fB-p\fR
These options are usually passed by fsck -A during the automatic checking
of those partitions listed in /etc/fstab. These options cause \fBreiserfsck\fR
-to print some information about the specified file system, check if error
-flags in the superblock are set and do some light-weight checks. If these
+to print some information about the specified filesystem, to check if error
+flags in the superblock are set and to do some light-weight checks. If these
checks reveal a corruption or the flag indicating a (possibly fixable)
corruption is found set in the superblock, then \fBreiserfsck\fR switches
to the fix-fixable mode. If the flag indicating a fatal corruption is found
set in the superblock, then \fBreiserfsck\fR finishes with an error.
.TP
.B -V
-This option prints the reiserfsprogs version and exit.
+This option prints the reiserfsprogs version and then exit.
.TP
\fB-r\fR, \fB-f\fR
-These options are ignored.
+These options are not yet operational and therefore are ignored.
.SH EXPERT OPTIONS
DO NOT USE THESE OPTIONS UNLESS YOU KNOW WHAT YOU ARE DOING.
WE ARE NOT RESPONSIBLE IF YOU LOSE DATA AS A RESULT OF THESE
@@ -130,9 +139,9 @@ the main data device. NOTE: after this operation you must use \fBreiserfstune\fR
to specify a new journal device.
.TP
.B --scan-whole-partition, -S
-This option causes \fB--rebuild-tree\fR to scan the whole partition, not only
-used space on the partition.
-.SH EXAMPLE OF USING
+This option causes \fB--rebuild-tree\fR to scan the whole partition but not only
+the used space on the partition.
+.SH AN EXAMPLE OF USING reiserfsck
1. You think something may be wrong with a reiserfs partition on /dev/hda1
or you would just like to perform a periodic disk check.
@@ -154,7 +163,8 @@ the whole partition before proceeding. Then run \fBreiserfsck --rebuild-tree
6. If the \fBreiserfsck --rebuild-tree\fR step fails or does not recover what
you expected, please submit this as a bug report. Try to provide as much
-information as possible and we will try to help solve the problem.
+information as possible including your platform and Linux kernel version. We
+will try to help solve the problem.
.SH EXIT CODES
\fBreiserfsck\fR uses the following exit codes:
.br
@@ -179,8 +189,9 @@ information as possible and we will try to help solve the problem.
.SH AUTHOR
This version of \fBreiserfsck\fR has been written by Vitaly Fertman <vitaly@namesys.com>.
.SH BUGS
-There are likely to be some bugs. Please report bugs to the ReiserFS mail-list
-<reiserfs-list@namesys.com>.
+Please report bugs to the ReiserFS developers <reiserfs-dev@namesys.com>, providing
+as much information as possible--your hardware, kernel, patches, settings, all printed
+messages, the logfile; check the syslog file for any related information.
.SH TODO
Faster recovering, signal handling.
.SH SEE ALSO
diff --git a/fsck/semantic_check.c b/fsck/semantic_check.c
index 96a5f96..73881ce 100644
--- a/fsck/semantic_check.c
+++ b/fsck/semantic_check.c
@@ -398,6 +398,7 @@ static int check_semantic_pass (struct key * key, struct key * parent, int dot_d
/* It seems quite difficult to relocate objects on fix-fixable -
* rewrite_file calls reiserfs_file_write which can convert tails
* to unfm, plus unreachable, was_tail flags, etc. */
+#if 0
if ((/* relocate = */ should_be_relocated(&ih->ih_key))) {
/*
if (fsck_mode(fs) == FSCK_CHECK)
@@ -405,6 +406,7 @@ static int check_semantic_pass (struct key * key, struct key * parent, int dot_d
*/
one_more_corruption(fs, FATAL);
}
+#endif
if (fix_obviously_wrong_sd_mode (&path)) {
one_more_corruption (fs, FIXABLE);
@@ -699,7 +701,7 @@ int check_safe_links ()
reiserfs_panic ("Safe Link %k cannot be of the size %d",
&tmp_ih->ih_key, get_ih_item_len (tmp_ih));
- set_key_dirid(&key, le32_to_cpu(*(__u32 *)get_item(&safe_link_path)));
+ set_key_dirid(&key, d32_get((__u32 *)get_item(&safe_link_path), 0));
set_key_objectid(&key, get_key_objectid(&tmp_ih->ih_key));
if ((rkey = reiserfs_next_key(&safe_link_path)) == NULL)
set_key_dirid (&safe_link_key, 0);
@@ -715,7 +717,7 @@ int check_safe_links ()
} else if (fsck_mode(fs) == FSCK_FIX_FIXABLE) {
fsck_log ("Invalid safe link %k: cannot find the pointed object (%K) - "
"safe link was deleted\n", &tmp_ih->ih_key, &key);
- *(__u32 *)get_item(&safe_link_path) = (__u32)0;
+ d32_put((__u32 *)get_item(&safe_link_path), 0, 0);
pathrelse (&path);
reiserfsck_delete_item (&safe_link_path, 0);
continue;
@@ -732,7 +734,7 @@ int check_safe_links ()
} else if (fsck_mode(fs) == FSCK_FIX_FIXABLE) {
fsck_log ("Invalid 'truncate' safe link %k, cannot happen for "
"a directory (%K) - safe link was deleted\n", &tmp_ih->ih_key, &key);
- *(__u32 *)get_item(&safe_link_path) = (__u32)0;
+ d32_put((__u32 *)get_item(&safe_link_path), 0, 0);
pathrelse (&path);
reiserfsck_delete_item (&safe_link_path, 0);
continue;
diff --git a/fsck/semantic_rebuild.c b/fsck/semantic_rebuild.c
index dbe696a..05e977d 100644
--- a/fsck/semantic_rebuild.c
+++ b/fsck/semantic_rebuild.c
@@ -174,7 +174,7 @@ int wrong_st_blocks (struct key * key, __u32 * blocks, __u32 sd_blocks, __u16 mo
if (S_ISREG (mode) || S_ISLNK (mode) || S_ISDIR (mode)) {
if (*blocks != sd_blocks) {
fsck_log ("vpf-10680: The %s %K has the wrong block count in the StatData "
- "(%u)%s(%u)\n", S_ISDIR (mode) ? "directory" : "file", key, sd_blocks,
+ "(%u)%s(%u)\n", S_ISDIR (mode) ? "directory" : S_ISREG (mode) ? "file" : "link", key, sd_blocks,
fsck_mode(fs) == FSCK_CHECK ? ", should be " : " - corrected to ", *blocks);
ret = 1;
}
diff --git a/fsck/super.c b/fsck/super.c
index 26371da..2870d4e 100644
--- a/fsck/super.c
+++ b/fsck/super.c
@@ -4,8 +4,6 @@
*/
#include "fsck.h"
-#include <stdlib.h>
-#include <errno.h>
#if defined(HAVE_LIBUUID) && defined(HAVE_UUID_UUID_H)
# include <uuid/uuid.h>
@@ -190,7 +188,7 @@ void rebuild_sb (reiserfs_filsys_t * fs, char * filename, struct fsck_data * dat
char * answer = 0;
size_t n = 0;
- struct stat64 stat_buf;
+ struct stat stat_buf;
int retval, exit_code = EXIT_OK;
#if defined(HAVE_LIBUUID) && defined(HAVE_UUID_UUID_H)
@@ -574,7 +572,7 @@ void rebuild_sb (reiserfs_filsys_t * fs, char * filename, struct fsck_data * dat
/* Check that specified non-standard journal device exists. */
journal_dev_name = fsck_data (fs)->journal_dev_name;
- retval = stat64(journal_dev_name, &stat_buf);
+ retval = stat(journal_dev_name, &stat_buf);
if (retval == -1)
reiserfs_exit (EXIT_USER, "rebuild_sb: error while detecting the "
diff --git a/fsck/ufile.c b/fsck/ufile.c
index 2d8110c..65a8533 100644
--- a/fsck/ufile.c
+++ b/fsck/ufile.c
@@ -36,7 +36,6 @@ static unsigned long indirect_to_direct (struct path * path, __u64 len, int syml
struct buffer_head * unfm_bh = 0;
struct item_head ins_ih;
char * buf;
- __u32 * indirect;
char bad_drct[fs->fs_blocksize];
/* direct item to insert */
@@ -53,8 +52,7 @@ static unsigned long indirect_to_direct (struct path * path, __u64 len, int syml
TYPE_DIRECT);
// we do not know what length this item should be
- indirect = get_item (path);
- unfm_ptr = le32_to_cpu (indirect [I_UNFM_NUM (ih) - 1]);
+ unfm_ptr = d32_get ((__u32 *)get_item (path), I_UNFM_NUM (ih) - 1);
if (unfm_ptr && (unfm_bh = bread (bh->b_dev, unfm_ptr, bh->b_size))) {
/* we can read the block */
buf = unfm_bh->b_data;
@@ -302,7 +300,7 @@ int are_file_items_correct (struct item_head * sd_ih, void * sd, __u64 * size, _
for (i = 0; i < I_UNFM_NUM (ih); i ++) {
__u32 * ind = (__u32 *)get_item(&path);
- if (ind[i] != 0)
+ if (d32_get(ind, i) != 0)
*blocks += (fs->fs_blocksize >> 9);
}
} else if (get_type (&ih->ih_key) == TYPE_DIRECT) {
@@ -332,7 +330,7 @@ int are_file_items_correct (struct item_head * sd_ih, void * sd, __u64 * size, _
/* DEBUG message.
fsck_log ("are_file_items_correct: The indirect item is converted back to direct %K\n", &ih->ih_key);
*/
- if (ind [I_UNFM_NUM (ih) - 1] == 0)
+ if (d32_get(ind, I_UNFM_NUM (ih) - 1) == 0)
*blocks += (fs->fs_blocksize >> 9);
/* path is released here. */
@@ -536,10 +534,10 @@ static int create_first_item_of_file (struct item_head * ih, char * item, struct
copy_key (&(indih.ih_key), &(ih->ih_key));
set_ih_item_len (&indih, UNFM_P_SIZE);
+ set_ih_free_space (&indih, 0);
if (get_offset (&ih->ih_key) > fs->fs_blocksize) {
/* insert indirect item containing 0 unfm pointer */
unfm_ptr = 0;
- set_ih_free_space (&indih, 0);
retval = 0;
} else {
if (is_direct_ih (ih)) {
@@ -551,9 +549,10 @@ static int create_first_item_of_file (struct item_head * ih, char * item, struct
unfm_ptr = cpu_to_le32 (unbh->b_blocknr);
memcpy (unbh->b_data + get_offset (&ih->ih_key) - 1, item, len);
- set_ih_free_space (&indih, fs->fs_blocksize - len - (get_offset (&ih->ih_key) - 1));
+ set_ih_free_space (&indih, fs->fs_blocksize -
+ len - (get_offset (&ih->ih_key) - 1));
+
mark_ih_was_tail (&indih);
-
mark_buffer_dirty (unbh);
mark_buffer_uptodate (unbh, 1);
brelse (unbh);
@@ -569,10 +568,10 @@ static int create_first_item_of_file (struct item_head * ih, char * item, struct
if (!was_in_tree) {
for (i = 0; i < I_UNFM_NUM (ih); i++) {
- if (still_bad_unfm_ptr_2 (le32_to_cpu (ni[i])))
+ if (still_bad_unfm_ptr_2 (d32_get(ni, i)))
reiserfs_panic ("create_first_item_of_file: The file %K has a pointer to the bad block (%u)",
- &ih->ih_key, le32_to_cpu (unfm_ptr));
- mark_block_used (le32_to_cpu (ni[i]), 0);
+ &ih->ih_key, d32_get(ni, i));
+ mark_block_used (d32_get(ni, i), 0);
}
}
@@ -604,6 +603,7 @@ static unsigned long block_to_start (struct path * path)
{
struct buffer_head * bh;
struct item_head * ih;
+ __u32 blk;
bh = PATH_PLAST_BUFFER (path);
ih = PATH_PITEM_HEAD (path);
@@ -611,7 +611,8 @@ static unsigned long block_to_start (struct path * path)
return bh->b_blocknr;
ih --;
- return (B_I_POS_UNFM_POINTER (bh, ih, I_UNFM_NUM (ih) - 1)) ?: bh->b_blocknr;
+ blk = d32_get((__u32 *)B_I_PITEM(bh, ih), I_UNFM_NUM (ih) - 1);
+ return (blk ? blk : bh->b_blocknr);
}
@@ -637,7 +638,7 @@ static void direct2indirect2 (unsigned long unfm, struct path * path)
die ("direct2indirect: can not find first part of tail");
}
- unbh = reiserfsck_get_new_buffer (le32_to_cpu (unfm) ? le32_to_cpu (unfm) : block_to_start (path));
+ unbh = reiserfsck_get_new_buffer (unfm ? unfm : block_to_start (path));
memset (unbh->b_data, 0, unbh->b_size);
/* delete parts of tail coping their contents to new buffer */
@@ -717,7 +718,7 @@ static int append_to_unformatted_node (struct item_head * comingih, struct item_
int zero_number;
bh = PATH_PLAST_BUFFER (path);
- unfm_ptr = le32_to_cpu (B_I_POS_UNFM_POINTER (bh, ih, I_UNFM_NUM (ih) - 1));
+ unfm_ptr = d32_get ((__u32 *)B_I_PITEM(bh, ih), I_UNFM_NUM (ih) - 1);
/* append to free space of the last unformatted node of indirect item ih */
free_space = get_offset (&ih->ih_key) + fs->fs_blocksize * I_UNFM_NUM (ih) - get_offset (&comingih->ih_key);
@@ -749,7 +750,7 @@ static int append_to_unformatted_node (struct item_head * comingih, struct item_
/*if (unfm_ptr == 0 || unfm_ptr >= SB_BLOCK_COUNT (fs)) {*/
unbh = reiserfsck_get_new_buffer (bh->b_blocknr);
memset (unbh->b_data, 0, unbh->b_size);
- B_I_POS_UNFM_POINTER (bh, ih, I_UNFM_NUM (ih) - 1) = unbh->b_blocknr;
+ d32_put ((__u32 *)B_I_PITEM(bh, ih), I_UNFM_NUM (ih) - 1, unbh->b_blocknr);
/*mark_block_unformatted (unbh->b_blocknr);*/
mark_buffer_dirty (bh);
}
@@ -802,7 +803,7 @@ int reiserfsck_append_file (struct item_head * comingih, char * item, int pos, s
mark_buffer_uptodate (unbh, 1);
ni = getmem (UNFM_P_SIZE);
- *ni = cpu_to_le32 (unbh->b_blocknr);
+ d32_put (ni, 0, unbh->b_blocknr);
count = 1;
brelse (unbh);
@@ -823,9 +824,9 @@ int reiserfsck_append_file (struct item_head * comingih, char * item, int pos, s
if (!was_in_tree) {
for (i = 0; i < count; i++ ) {
- if (still_bad_unfm_ptr_2 (le32_to_cpu (ni[i])))
- die ("reiserfsck_append_file: Trying to insert a pointer to illegal block (%u)", le32_to_cpu (ni[i]));
- mark_block_used (le32_to_cpu (ni[i]), 0);
+ if (still_bad_unfm_ptr_2 (d32_get (ni, i)))
+ die ("reiserfsck_append_file: Trying to insert a pointer to illegal block (%u)", d32_get (ni, i));
+ mark_block_used (d32_get (ni, i), 0);
}
}
@@ -837,7 +838,7 @@ int reiserfsck_append_file (struct item_head * comingih, char * item, int pos, s
return retval;
}
-int must_there_be_a_hole (struct item_head * comingih, struct path * path)
+long long int must_there_be_a_hole (struct item_head * comingih, struct path * path)
{
struct item_head * ih = PATH_PITEM_HEAD (path);
@@ -857,10 +858,10 @@ int must_there_be_a_hole (struct item_head * comingih, struct path * path)
}
-int reiserfs_append_zero_unfm_ptr (struct path * path, int p_count)
+int reiserfs_append_zero_unfm_ptr (struct path * path, long long int p_count)
{
__u32 * ni;
- int count;
+ long long int count;
if (is_direct_ih (PATH_PITEM_HEAD (path)))
/* convert direct item to indirect */
@@ -894,7 +895,7 @@ static int overwrite_by_direct_item (struct item_head * comingih, char * item, s
bh = PATH_PLAST_BUFFER (path);
ih = PATH_PITEM_HEAD (path);
- unfm_ptr = le32_to_cpu (B_I_POS_UNFM_POINTER (bh, ih, path->pos_in_item));
+ unfm_ptr = d32_get ((__u32 *)B_I_PITEM(bh, ih), path->pos_in_item);
unbh = 0;
if (unfm_ptr != 0 && unfm_ptr < get_sb_block_count (fs->fs_ondisk_sb)) {
@@ -910,7 +911,7 @@ static int overwrite_by_direct_item (struct item_head * comingih, char * item, s
if (unfm_ptr == 0 || unfm_ptr >= get_sb_block_count (fs->fs_ondisk_sb)) {
if ((unbh = reiserfsck_get_new_buffer (bh->b_blocknr)) != NULL) {
memset (unbh->b_data, 0, unbh->b_size);
- B_I_POS_UNFM_POINTER (bh, ih, path->pos_in_item) = cpu_to_le32 (unbh->b_blocknr);
+ d32_put ((__u32 *)B_I_PITEM(bh, ih), path->pos_in_item, unbh->b_blocknr);
mark_buffer_dirty (bh);
} else {
die ("overwrite_by_direct_item: Could not allocate a new block for new data");
@@ -1017,11 +1018,11 @@ static int overwrite_by_indirect_item (struct item_head * comingih, __u32 * comi
}
for (i = 0; i < to_copy; i ++) {
- if (coming_item[i] != 0 && item_in_tree[i] == 0) {
+ if (d32_get (coming_item, i) != 0 && d32_get (item_in_tree, i) == 0) {
/* overwrite holes only by correct a pointer in the coming item
which must be correct */
- item_in_tree[i] = coming_item[i];
- mark_block_used (le32_to_cpu (coming_item[i]), 0);
+ d32_put (item_in_tree, i, d32_get (coming_item, i));
+ mark_block_used (d32_get (coming_item, i), 0);
dirty ++;
}
}
@@ -1051,7 +1052,7 @@ static int reiserfsck_overwrite_file (struct item_head * comingih, char * item,
reiserfs_panic ("reiserfsck_overwrite_file: The second part of the tail %k can not"
" be overwritten by indirect item %k", &ih->ih_key, &comingih->ih_key);
/* use pointer from coming indirect item */
- unfm_ptr = le32_to_cpu (*(__u32 *)(item + *pos_in_coming_item * UNFM_P_SIZE));
+ unfm_ptr = d32_get ((__u32 *)item, *pos_in_coming_item);
if (!was_in_tree) {
if (still_bad_unfm_ptr_2 (unfm_ptr))
die ("reiserfsck_overwrite_file: The pointer to the unformatted block (%u)"
@@ -1080,7 +1081,7 @@ static int reiserfsck_overwrite_file (struct item_head * comingih, char * item,
int reiserfsck_file_write (struct item_head * ih, char * item, int was_in_tree) {
struct path path;
int count, pos_in_coming_item;
- int retval, written;
+ long long int retval, written;
struct key key;
int file_format = KEY_FORMAT_UNDEFINED;
int relocated = 0;
diff --git a/fsck/uobjectid.c b/fsck/uobjectid.c
index 5aa82dc..118cc6b 100644
--- a/fsck/uobjectid.c
+++ b/fsck/uobjectid.c
@@ -211,10 +211,12 @@ void id_map_flush(struct id_map * map, reiserfs_filsys_t * fs) {
max = ((fs->fs_blocksize - size) >> 3 << 1);
set_sb_oid_maxsize (fs->fs_ondisk_sb, max);
- sb_objectid_map[0] = id = 1;
+ id = 1;
+ sb_objectid_map[0] = cpu_to_le32(1);
- for (i = 1; i < max - 1; i++) {
- sb_objectid_map[i] = id = id_map_next_bound(map, id);
+ for (i = 1; i < max - 1; i++) {
+ id = id_map_next_bound(map, id);
+ sb_objectid_map[i] = cpu_to_le32(id);
if (id == 0) {
if (i % 2)
die ("%s: Used interval is not closed on flushing.", __FUNCTION__);
@@ -256,7 +258,7 @@ void id_map_flush(struct id_map * map, reiserfs_filsys_t * fs) {
prev_id++;
}
- sb_objectid_map[max - 1] = prev_id + map->last_used * BM_INTERVAL;
+ sb_objectid_map[max - 1] = cpu_to_le32(prev_id + map->last_used * BM_INTERVAL);
} else {
i--;
memset(sb_objectid_map + i, 0, (max - i) * sizeof (__u32));
diff --git a/fsck/ustree.c b/fsck/ustree.c
index 1323b39..7204a07 100644
--- a/fsck/ustree.c
+++ b/fsck/ustree.c
@@ -5,23 +5,6 @@
#include "fsck.h"
-
-/* key1 and key2 are pointer to deh_offset of the struct reiserfs_de_head */
-int comp_dir_entries (void * key1, void * key2)
-{
- __u32 off1, off2;
-
- off1 = le32_to_cpu (*(__u32 *)key1);
- off2 = le32_to_cpu (*(__u32 *)key2);
-
- if (off1 < off2)
- return -1;
- if (off1 > off2)
- return 1;
- return 0;
-}
-
-
struct tree_balance * cur_tb = 0;
void reiserfsck_paste_into_item (struct path * path, const char * body, int size)
@@ -54,19 +37,21 @@ static void free_unformatted_nodes (struct item_head * ih, struct buffer_head *
__u32 * punfm = (__u32 *)B_I_PITEM (bh, ih);
unsigned int i;
- for (i = 0; i < I_UNFM_NUM (ih); i ++, punfm ++)
- if (*punfm != 0) {
+ for (i = 0; i < I_UNFM_NUM (ih); i ++) {
+ __u32 unfm = d32_get (punfm, i);
+ if (unfm != 0) {
struct buffer_head * to_be_forgotten;
- to_be_forgotten = find_buffer (fs->fs_dev, le32_to_cpu (*punfm), fs->fs_blocksize);
+ to_be_forgotten = find_buffer (fs->fs_dev, unfm, fs->fs_blocksize);
if (to_be_forgotten) {
//atomic_inc(&to_be_forgotten->b_count);
to_be_forgotten->b_count ++;
bforget (to_be_forgotten);
}
- reiserfs_free_block (fs, le32_to_cpu (*punfm));
+ reiserfs_free_block (fs, unfm);
}
+ }
}
void reiserfsck_delete_item (struct path * path, int temporary)
@@ -95,17 +80,18 @@ void reiserfsck_cut_from_item (struct path * path, int cut_size)
die ("reiserfsck_cut_from_item: cut size == %d", cut_size);
if (is_indirect_ih (ih = PATH_PITEM_HEAD (path))) {
- __u32 unfm_ptr = B_I_POS_UNFM_POINTER (PATH_PLAST_BUFFER (path), ih, I_UNFM_NUM (ih) - 1);
+ struct buffer_head *bh = PATH_PLAST_BUFFER (path);
+ __u32 unfm_ptr = d32_get ((__u32 *)B_I_PITEM(bh, ih), I_UNFM_NUM (ih) - 1);
if (unfm_ptr != 0) {
struct buffer_head * to_be_forgotten;
- to_be_forgotten = find_buffer (fs->fs_dev, le32_to_cpu (unfm_ptr), fs->fs_blocksize);
+ to_be_forgotten = find_buffer (fs->fs_dev, unfm_ptr, fs->fs_blocksize);
if (to_be_forgotten) {
//atomic_inc(&to_be_forgotten->b_count);
to_be_forgotten->b_count ++;
bforget (to_be_forgotten);
}
- reiserfs_free_block (fs, le32_to_cpu (unfm_ptr));
+ reiserfs_free_block (fs, unfm_ptr);
}
}
diff --git a/include/Makefile.in b/include/Makefile.in
index d0ebba9..cdcccba 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.7.2 from Makefile.am.
+# Makefile.in generated by automake 1.7.6 from Makefile.am.
# @configure_input@
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,7 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+host_triplet = @host@
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
+am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
+build = @build@
build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
@@ -107,6 +121,7 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
noinst_HEADERS = io.h misc.h reiserfs_fs.h reiserfs_lib.h swab.h
subdir = include
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
@@ -118,10 +133,10 @@ all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu include/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
config.h: stamp-h1
@@ -134,7 +149,7 @@ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status include/config.h
-$(srcdir)/config.h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOHEADER)
touch $(srcdir)/config.h.in
@@ -232,7 +247,6 @@ check: check-am
all-am: Makefile $(HEADERS) config.h
installdirs:
-
install: install-am
install-exec: install-exec-am
install-data: install-data-am
diff --git a/include/config.h.in b/include/config.h.in
index eb2d040..5c60a71 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -1,11 +1,20 @@
/* include/config.h.in. Generated from configure.in by autoheader. */
+/* Define for enable debug info. */
+#undef ENABLE_DEBUG
+
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
+/* Define to 1 if you have the `getmntent' function. */
+#undef HAVE_GETMNTENT
+
+/* Define to 1 if you have the `hasmntopt' function. */
+#undef HAVE_HASMNTOPT
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -21,6 +30,15 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
+/* Define to 1 if you have the `memset' function. */
+#undef HAVE_MEMSET
+
+/* Define to 1 if you have the `register_printf_function' function. */
+#undef HAVE_REGISTER_PRINTF_FUNCTION
+
+/* Define to 1 if you have the `statfs' function. */
+#undef HAVE_STATFS
+
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@@ -61,6 +79,12 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
+/* Define to 1 if you have the `time' function. */
+#undef HAVE_TIME
+
+/* Define to 1 if you have the `uname' function. */
+#undef HAVE_UNAME
+
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
@@ -73,6 +97,14 @@
/* gets set when configure --enable-io-failure-emulation */
#undef IO_FAILURE_EMULATION
+/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
+ */
+#undef MAJOR_IN_MKDEV
+
+/* Define to 1 if `major', `minor', and `makedev' are declared in
+ <sysmacros.h>. */
+#undef MAJOR_IN_SYSMACROS
+
/* Name of package */
#undef PACKAGE
@@ -91,12 +123,24 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
+/* The size of a `blkcnt_t', as computed by sizeof. */
+#undef SIZEOF_BLKCNT_T
+
+/* The size of a `off_t', as computed by sizeof. */
+#undef SIZEOF_OFF_T
+
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
diff --git a/include/io.h b/include/io.h
index 167b941..ae9af4c 100644
--- a/include/io.h
+++ b/include/io.h
@@ -3,6 +3,20 @@
* reiserfsprogs/README
*/
+#ifndef REISERFSPROGS_IO_H
+#define REISERFSPROGS_IO_H
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include "misc.h"
+
struct buffer_head {
unsigned long b_blocknr;
int b_dev;
@@ -66,3 +80,5 @@ void do_fsck_rollback (int fd_device, int fd_journal_device, FILE * log);
void flush_buffers (int);
void free_buffers (void);
void invalidate_buffers (int);
+
+#endif
diff --git a/include/misc.h b/include/misc.h
index 939d2ce..6891b59 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -5,18 +5,29 @@
/* nothing abount reiserfs here */
-#ifndef REISERFS_MISC_H
-#define REISERFS_MISC_H
+#ifndef REISERFSPROGS_MISC_H
+#define REISERFSPROGS_MISC_H
-#include <endian.h>
-#include "swab.h"
-#include <linux/major.h>
-#include <signal.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <fcntl.h>
-#include <sys/ioctl.h>
+#include <stdlib.h>
-#include <sys/types.h>
+#include <linux/major.h>
+
+#if MAJOR_IN_MKDEV
+# include <sys/mkdev.h>
+#elif MAJOR_IN_SYSMACROS
+# include <sys/sysmacros.h>
+#endif
+
+#include "swab.h"
#define POSITION_FOUND 8
#define POSITION_NOT_FOUND 9
@@ -53,7 +64,7 @@ void misc_print_credit(FILE *out);
typedef struct dma_info {
int fd;
- struct stat64 stat;
+ struct stat st;
int support_type;
int dma;
__u64 speed;
@@ -80,45 +91,21 @@ extern inline unsigned long long misc_find_first_zero_bit (const void *vaddr, un
extern inline unsigned long long misc_find_next_zero_bit (const void *vaddr, unsigned long long size, unsigned long long offset);
extern inline unsigned long long misc_find_next_set_bit(const void *vaddr, unsigned long long size, unsigned long long offset);
extern inline unsigned long long misc_find_first_set_bit (const void *vaddr, unsigned long long size);
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-
-# define cpu_to_le16(val) (val)
-# define le16_to_cpu(val) (val)
-# define cpu_to_le32(val) (val)
-# define le32_to_cpu(val) (val)
-# define cpu_to_le64(val) (val)
-# define le64_to_cpu(val) (val)
-
-#elif __BYTE_ORDER == __BIG_ENDIAN
-
-# define cpu_to_le16(val) __swab16(val)
-# define le16_to_cpu(val) __swab16(val)
-# define cpu_to_le32(val) __swab32(val)
-# define le32_to_cpu(val) __swab32(val)
-# define cpu_to_le64(val) __swab64(val)
-# define le64_to_cpu(val) __swab64(val)
-
-#else
-# error "nuxi/pdp-endian archs are not supported"
-#endif
#define STAT_FIELD_H(Field, Type) \
inline Type misc_device_##Field(char *device);
STAT_FIELD_H(mode, mode_t);
STAT_FIELD_H(rdev, dev_t);
-STAT_FIELD_H(size, off64_t);
-STAT_FIELD_H(blocks, blkcnt64_t);
+STAT_FIELD_H(size, off_t);
+STAT_FIELD_H(blocks, blkcnt_t);
-/* these are to access bitfield in endian safe manner */
__u16 mask16 (int from, int count);
__u32 mask32 (int from, int count);
__u64 mask64 (int from, int count);
-
int reiserfs_bin_search (void * key, void * base, __u32 num, int width,
- __u32 *ppos, comparison_fn_t comp_func);
+ __u32 *ppos, __compar_fn_t comp_func);
struct block_handler {
__u32 blocknr;
@@ -168,10 +155,12 @@ int blockdev_list_compare (const void * block1, const void * block2);
return tmp;
-#ifndef MAJOR
-#define MAJOR(rdev) ((rdev)>>8)
-#define MINOR(rdev) ((rdev) & 0xff)
-#endif /* MAJOR */
+#ifndef major
+#define major(rdev) ((rdev)>>8)
+#define minor(rdev) ((rdev) & 0xff)
+#endif /* major */
+
+
#ifndef SCSI_DISK_MAJOR
#define SCSI_DISK_MAJOR(maj) ((maj) == SCSI_DISK0_MAJOR || \
@@ -196,4 +185,5 @@ int blockdev_list_compare (const void * block1, const void * block2);
#endif /* IDE9_MAJOR */
#endif /* IDE_DISK_MAJOR */
+
#endif /* REISERFS_MISC_H */
diff --git a/include/reiserfs_fs.h b/include/reiserfs_fs.h
index 47c88c1..d108dde 100644
--- a/include/reiserfs_fs.h
+++ b/include/reiserfs_fs.h
@@ -29,12 +29,17 @@
*/
+#ifndef REISERFSPROGS_FS_H
+#define REISERFSPRIGS_FS_H
+
#ifndef NO_EXTERN_INLINE
# define extern_inline extern inline
#else
# define extern_inline
#endif
+#include <asm/unaligned.h>
+
#define get_leXX(xx,p,field) (le##xx##_to_cpu ((p)->field))
#define set_leXX(xx,p,field,val) do { (p)->field = cpu_to_le##xx(val); } while (0)
@@ -1420,6 +1425,16 @@ struct buffer_info {
( get_offset(&(p_s_ih)->ih_key) <= (n_offset) && \
get_offset(&(p_s_ih)->ih_key) + get_bytes_number(p_s_ih,n_blocksize) > (n_offset) )
+/* these operate on indirect items, where you've got an array of ints
+** at a possibly unaligned location. These are a noop on ia32
+**
+** p is the array of __u32, i is the index into the array, v is the value
+** to store there.
+*/
+#define d32_get(p, i) le32_to_cpu(get_unaligned((p) + (i)))
+#define d32_put(p, i, v) put_unaligned(cpu_to_le32(v), (p) + (i))
+
+
/* get the item header */
#define B_N_PITEM_HEAD(bh,item_num) ( (struct item_head * )((bh)->b_data + BLKH_SIZE) + (item_num) )
@@ -1446,13 +1461,6 @@ struct buffer_info {
#define MAX_DIRECT_ITEM_LEN(size) ((size) - BLKH_SIZE - 2*IH_SIZE - SD_SIZE - UNFM_P_SIZE)
#define MAX_INDIRECT_ITEM_LEN(size) MAX_ITEM_LEN(size)
-/* indirect items consist of entries which contain blocknrs, pos
- indicates which entry, and B_I_POS_UNFM_POINTER resolves to the
- blocknr contained by the entry pos points to */
-#define B_I_POS_UNFM_POINTER(bh,ih,pos) (*(((__u32 *)B_I_PITEM(bh,ih)) + (pos)))
-
-
-
/***************************************************************************/
/* FUNCTION DECLARATIONS */
/***************************************************************************/
@@ -1560,6 +1568,7 @@ extern unsigned int get_journal_new_start_must (reiserfs_filsys_t * fs);
extern unsigned int get_journal_start_must (reiserfs_filsys_t * fs);
/*extern hashf_t hashes [];*/
+#endif
/*
* Local variables:
diff --git a/include/reiserfs_lib.h b/include/reiserfs_lib.h
index 3a32987..4f15cf1 100644
--- a/include/reiserfs_lib.h
+++ b/include/reiserfs_lib.h
@@ -3,9 +3,8 @@
* reiserfsprogs/README
*/
-#ifndef REISERFS_LIB_H
-#define REISERFS_LIB_H
-
+#ifndef REISERFSPROGS_LIB_H
+#define REISERFSPROGS_LIB_H
#define BADBLOCK_DIRID 1
#define BADBLOCK_OBJID (__u32)-1
@@ -118,9 +117,6 @@ int reiserfs_find_entry (reiserfs_filsys_t *, struct key * dir, char * name,
int reiserfs_add_entry (reiserfs_filsys_t *, struct key * dir, char * name, int name_len,
struct key * key, __u16 fsck_need);
-
-/*int reiserfs_bin_search (void * key, void * base, int num, int width,
- int *ppos, comparison_fn_t comp_func);*/
struct key * uget_lkey (struct path * path);
struct key * uget_rkey (struct path * path);
int reiserfs_search_by_key_3 (reiserfs_filsys_t *, struct key * key,
@@ -407,6 +403,4 @@ int can_we_format_it (char * device_name, int force);
}\
-#endif /* REISERFS_LIB_H */
-
-
+#endif /* REISERFSPROGS_LIB_H */
diff --git a/include/swab.h b/include/swab.h
index a3a7a35..06ebceb 100644
--- a/include/swab.h
+++ b/include/swab.h
@@ -3,22 +3,65 @@
* reiserfsprogs/README
*/
-#ifndef _REISERFS_SWAB_H_
-#define _REISERFS_SWAB_H_
+#ifndef REISERFSPROGS_SWAB_H
+#define REISERFSPROGS_SWAB_H
#include <endian.h>
+#include <asm/types.h>
-#if __BYTE_ORDER == __BIG_ENDIAN
+#define __swab16(x) \
+({ \
+ __u16 __x = (x); \
+ ((__u16)( \
+ (((__u16)(__x) & (__u16)0x00ffU) << 8) | \
+ (((__u16)(__x) & (__u16)0xff00U) >> 8) )); \
+})
-#define extern static
-#define __BYTEORDER_HAS_U64__
-#include <linux/byteorder/swab.h>
-#undef extern
+#define __swab32(x) \
+({ \
+ __u32 __x = (x); \
+ ((__u32)( \
+ (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | \
+ (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | \
+ (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | \
+ (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); \
+})
-#else
+#define __swab64(x) \
+({ \
+ __u64 __x = (x); \
+ ((__u64)( \
+ (__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | \
+ (__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | \
+ (__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | \
+ (__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) | \
+ (__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) | \
+ (__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
+ (__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | \
+ (__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); \
+})
+
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
-#include <linux/byteorder/swab.h>
+# define cpu_to_le16(val) (val)
+# define le16_to_cpu(val) (val)
+# define cpu_to_le32(val) (val)
+# define le32_to_cpu(val) (val)
+# define cpu_to_le64(val) (val)
+# define le64_to_cpu(val) (val)
+#elif __BYTE_ORDER == __BIG_ENDIAN
+
+# define cpu_to_le16(val) __swab16(val)
+# define le16_to_cpu(val) __swab16(val)
+# define cpu_to_le32(val) __swab32(val)
+# define le32_to_cpu(val) __swab32(val)
+# define cpu_to_le64(val) __swab64(val)
+# define le64_to_cpu(val) __swab64(val)
+
+#else
+# error "nuxi/pdp-endian archs are not supported"
#endif
-#endif /* _REISERFS_SWAB_H_ */
+#endif /* REISERFS_SWAB_H */
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 9bc5362..675222a 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.7.2 from Makefile.am.
+# Makefile.in generated by automake 1.7.6 from Makefile.am.
# @configure_input@
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,7 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+host_triplet = @host@
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
+am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
+build = @build@
build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
@@ -109,6 +123,7 @@ noinst_LIBRARIES = libmisc.a
libmisc_a_SOURCES = io.c misc.c
subdir = lib
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES =
@@ -135,10 +150,10 @@ all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu lib/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
AR = ar
@@ -165,7 +180,7 @@ distclean-depend:
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@@ -176,7 +191,7 @@ distclean-depend:
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@@ -275,7 +290,6 @@ check: check-am
all-am: Makefile $(LIBRARIES)
installdirs:
-
install: install-am
install-exec: install-exec-am
install-data: install-data-am
diff --git a/lib/io.c b/lib/io.c
index 57fbd3d..158d28e 100644
--- a/lib/io.c
+++ b/lib/io.c
@@ -3,24 +3,12 @@
* reiserfsprogs/README
*/
-#define _FILE_OFFSET_BITS 64
-#define _GNU_SOURCE
+#include "io.h"
-#include <stdio.h>
-#include <unistd.h>
#include <string.h>
#include <errno.h>
-#include <stdlib.h>
#include <asm/types.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-
-#include "io.h"
-#include "misc.h"
-#include "config.h"
-
void check_memory_msg (void) {
fprintf(stderr,
"\nThe problem has occurred looks like a hardware problem (perhaps\n"
@@ -485,7 +473,7 @@ static int f_read(struct buffer_head * bh)
buffer_reads++ ;
offset = (unsigned long long)bh->b_size * bh->b_blocknr;
- if (lseek64 (bh->b_dev, offset, SEEK_SET) < 0)
+ if (lseek (bh->b_dev, offset, SEEK_SET) < 0)
return -1;
bytes = read (bh->b_dev, bh->b_data, bh->b_size);
@@ -545,12 +533,12 @@ static int rollback_blocksize;
void init_rollback_file (char * rollback_file, int *blocksize, FILE * log) {
char * string;
- struct stat64 buf;
+ struct stat buf;
if (rollback_file == NULL)
return;
- stat64(rollback_file, &buf);
+ stat(rollback_file, &buf);
s_rollback_file = fopen (rollback_file, "w+");
if (s_rollback_file == NULL) {
@@ -589,12 +577,12 @@ static void erase_rollback_file (char * rollback_file) {
int open_rollback_file (char * rollback_file, FILE * log) {
char string [28];
- struct stat64 buf;
+ struct stat buf;
if (rollback_file == NULL)
return -1;
- if (stat64(rollback_file, &buf)) {
+ if (stat(rollback_file, &buf)) {
fprintf (stderr, "Cannot stat rollback file (%s)\n", rollback_file);
return -1;
}
@@ -656,17 +644,17 @@ void close_rollback_file () {
}
void do_fsck_rollback (int fd_device, int fd_journal_device, FILE * progress) {
- loff_t offset;
+ long long int offset;
- struct stat64 buf;
+ struct stat buf;
int descriptor;
ssize_t retval;
int count_failed = 0;
int count_rollbacked = 0;
- dev_t b_dev;
- dev_t n_dev = 0;
- dev_t n_journal_dev = 0;
+ int b_dev;
+ int n_dev = 0;
+ int n_journal_dev = 0;
unsigned long total, done = 0;
if (fd_device == 0) {
@@ -675,14 +663,14 @@ void do_fsck_rollback (int fd_device, int fd_journal_device, FILE * progress) {
}
if (fd_journal_device) {
- if (!fstat64 (fd_journal_device, &buf)) {
+ if (!fstat (fd_journal_device, &buf)) {
n_journal_dev = buf.st_rdev;
} else {
fprintf(stderr, "rollback: specified journal device cannot be stated\n");
}
}
- if (!fstat64 (fd_device, &buf)) {
+ if (!fstat (fd_device, &buf)) {
n_dev = buf.st_rdev;
} else {
fprintf(stderr, "rollback: specified device cannot be stated, exit\n");
@@ -731,7 +719,7 @@ void do_fsck_rollback (int fd_device, int fd_journal_device, FILE * progress) {
continue;
}
- if (lseek64 (descriptor, offset, SEEK_SET) == (loff_t)-1) {
+ if (lseek (descriptor, offset, SEEK_SET) == (loff_t)-1) {
fprintf(stderr, "device cannot be lseeked, skip block\n");
count_failed ++;
continue;
@@ -739,7 +727,7 @@ void do_fsck_rollback (int fd_device, int fd_journal_device, FILE * progress) {
if (write (descriptor, rollback_data, rollback_blocksize) == -1) {
fprintf (stderr, "rollback: write %d bytes returned error "
- "(block=%lld, dev=%lld): %s\n", rollback_blocksize,
+ "(block=%lld, dev=%d): %s\n", rollback_blocksize,
offset/rollback_blocksize, b_dev, strerror (errno));
count_failed ++;
} else {
@@ -802,19 +790,19 @@ int bwrite (struct buffer_head * bh)
size = bh->b_size;
offset = (loff_t)size * (loff_t)bh->b_blocknr;
- if (lseek64 (bh->b_dev, offset, SEEK_SET) == (loff_t)-1){
+ if (lseek (bh->b_dev, offset, SEEK_SET) == (loff_t)-1){
fprintf (stderr, "bwrite: lseek to position %llu (block=%lu, dev=%d): %s\n",
offset, bh->b_blocknr, bh->b_dev, strerror(errno));
exit(8); /* File system errors left uncorrected */
}
if (s_rollback_file != NULL && bh->b_size == (unsigned long)rollback_blocksize) {
- struct stat64 buf;
+ struct stat buf;
__u32 position;
struct block_handler block_h;
/*log previous content into the log*/
- if (!fstat64 (bh->b_dev, &buf)) {
+ if (!fstat (bh->b_dev, &buf)) {
block_h.blocknr = bh->b_blocknr;
block_h.device = buf.st_rdev;
if (reiserfs_bin_search(&block_h, rollback_blocks_array,
@@ -844,7 +832,7 @@ int bwrite (struct buffer_head * bh)
exit(8);
}
- if (lseek64 (bh->b_dev, offset, SEEK_SET) == (loff_t)-1) {
+ if (lseek (bh->b_dev, offset, SEEK_SET) == (loff_t)-1) {
fprintf (stderr, "bwrite: lseek to position %llu (block=%lu, "
"dev=%d): %s\n", offset, bh->b_blocknr, bh->b_dev,
strerror(errno));
diff --git a/lib/misc.c b/lib/misc.c
index 47d8ceb..6959839 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -3,17 +3,14 @@
* reiserfsprogs/README
*/
-/* for stat64() */
-#define _FILE_OFFSET_BITS 64
-
-/* for getline() proto and _LARGEFILE64_SOURCE */
#define _GNU_SOURCE
+
+#include "misc.h"
+
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
-#include <asm/types.h>
-#include <stdlib.h>
#include <mntent.h>
#include <sys/vfs.h>
#include <time.h>
@@ -23,7 +20,9 @@
#include <dirent.h>
#include <assert.h>
-#include "misc.h"
+#include <sys/ioctl.h>
+#include <signal.h>
+
/* Debian modifications by Ed Boraas <ed@debian.org> */
#include <sys/mount.h>
@@ -42,8 +41,8 @@ inline Type misc_device_##Field(char *device) { \
STAT_FIELD(mode, mode_t);
STAT_FIELD(rdev, dev_t);
-STAT_FIELD(size, off64_t);
-STAT_FIELD(blocks, blkcnt64_t);
+STAT_FIELD(size, off_t);
+STAT_FIELD(blocks, blkcnt_t);
void die (char * fmt, ...)
{
@@ -185,19 +184,21 @@ typedef int (*func_t) (char *);
not correct. */
static struct mntent *misc_mntent_lookup(char *mntfile,
char *file,
- int fsname)
+ int path)
{
struct mntent *mnt;
+ int name_match = 0;
struct stat st;
dev_t rdev = 0;
dev_t dev = 0;
ino_t ino = 0;
+ char *name;
FILE *fp;
-
+
assert(mntfile != NULL);
assert(file != NULL);
- if (fsname && stat(file, &st) == 0) {
+ if (stat(file, &st) == 0) {
/* Devices is stated. */
if (S_ISBLK(st.st_mode)) {
rdev = st.st_rdev;
@@ -212,27 +213,45 @@ static struct mntent *misc_mntent_lookup(char *mntfile,
while ((mnt = getmntent(fp)) != NULL) {
/* Check if names match. */
- if (fsname) {
- if (strcmp(file, mnt->mnt_fsname) == 0)
- break;
- } else {
- if (strcmp(file, mnt->mnt_dir) == 0)
- break;
+ name = path ? mnt->mnt_dir : mnt->mnt_fsname;
+
+ if (strcmp(file, name) == 0)
+ name_match = 1;
+ if (stat(name, &st))
continue;
- }
-
- /* Check if stats match. */
- if (stat(mnt->mnt_fsname, &st) == 0) {
+
+ /* If names do not match, check if stats match. */
+ if (!name_match) {
if (rdev && S_ISBLK(st.st_mode)) {
- if (rdev == st.st_rdev)
- break;
+ if (rdev != st.st_rdev)
+ continue;
+ } else if (dev && !S_ISBLK(st.st_mode)) {
+ if (dev != st.st_dev ||
+ ino != st.st_ino)
+ continue;
} else {
- if (dev == st.st_dev &&
- ino == st.st_ino)
- break;
+ continue;
}
}
+
+ /* If not path and not block device do not check anything more. */
+ if (!path && !rdev)
+ break;
+
+ if (path) {
+ /* Either names or stats match. Make sure the st_dev of
+ the path is same as @mnt_fsname device rdev. */
+ if (stat(mnt->mnt_fsname, &st) == 0 &&
+ dev == st.st_rdev)
+ break;
+ } else {
+ /* Either names or stats match. Make sure the st_dev of
+ the mount entry is same as the given device rdev. */
+ if (stat(mnt->mnt_dir, &st) == 0 &&
+ rdev == st.st_dev)
+ break;
+ }
}
endmntent (fp);
@@ -288,10 +307,10 @@ struct mntent *misc_mntent(char *device) {
case as root entry can present as:
rootfs / rootfs rw 0 0
Look up the mount point in this case. */
- mnt = misc_mntent_lookup("/proc/mounts", "/", 0);
+ mnt = misc_mntent_lookup("/proc/mounts", "/", 1);
} else {
/* Lookup the @device /proc/mounts */
- mnt = misc_mntent_lookup("/proc/mounts", device, 1);
+ mnt = misc_mntent_lookup("/proc/mounts", device, 0);
}
if (mnt == INVAL_PTR)
@@ -311,9 +330,9 @@ struct mntent *misc_mntent(char *device) {
path = 1;
if (root) {
- mnt = misc_mntent_lookup(MOUNTED, "/", 0);
+ mnt = misc_mntent_lookup(MOUNTED, "/", 1);
} else {
- mnt = misc_mntent_lookup(MOUNTED, device, 1);
+ mnt = misc_mntent_lookup(MOUNTED, device, 0);
}
if (mnt == INVAL_PTR)
@@ -455,7 +474,7 @@ int valid_offset( int fd, loff_t offset) {
loff_t res;
/*res = reiserfs_llseek (fd, offset, 0);*/
- res = lseek64 (fd, offset, SEEK_SET);
+ res = lseek (fd, offset, SEEK_SET);
if (res < 0)
return 0;
@@ -657,16 +676,16 @@ void blocklist__insert_in_position (void *elem, void **base, __u32 *count,
/* 1 - xt drive */
/* 2 - ide drive */
static void get_dma_support(dma_info_t *dma_info){
- if (S_ISREG(dma_info->stat.st_mode))
- dma_info->stat.st_rdev = dma_info->stat.st_dev;
+ if (S_ISREG(dma_info->st.st_mode))
+ dma_info->st.st_rdev = dma_info->st.st_dev;
- if (IDE_DISK_MAJOR(MAJOR(dma_info->stat.st_rdev))) {
+ if (IDE_DISK_MAJOR(major(dma_info->st.st_rdev))) {
dma_info->support_type = 2;
return;
}
#ifdef XT_DISK_MAJOR
- if (MAJOR(dma_info->stat.st_rdev) == XT_DISK_MAJOR) {
+ if (major(dma_info->st.st_rdev) == XT_DISK_MAJOR) {
dma_info->support_type = 1;
return;
}
@@ -680,10 +699,11 @@ static void get_dma_support(dma_info_t *dma_info){
* 1 - preparation cannot be done
* -1 - preparation failed
*/
+
int prepare_dma_check(dma_info_t *dma_info) {
DIR *dir;
struct dirent *dirent;
- struct stat64 stat;
+ struct stat st;
dev_t rdev;
int rem;
char buf[256];
@@ -692,8 +712,8 @@ int prepare_dma_check(dma_info_t *dma_info) {
return -1;
#endif
- if (fstat64(dma_info->fd, &dma_info->stat))
- die("stat64 on device failed\n");
+ if (fstat(dma_info->fd, &dma_info->st))
+ die("stat on device failed\n");
get_dma_support(dma_info);
@@ -702,9 +722,9 @@ int prepare_dma_check(dma_info_t *dma_info) {
return 1;
if (dma_info->support_type == 2) {
- rdev = dma_info->stat.st_rdev;
+ rdev = dma_info->st.st_rdev;
- if ((rem = (MINOR(rdev) % 64)) != 0) {
+ if ((rem = (minor(rdev) % 64)) != 0) {
rdev -= rem;
if(!(dir = opendir("/dev/"))) {
dma_info->support_type = 1;
@@ -717,12 +737,18 @@ int prepare_dma_check(dma_info_t *dma_info) {
memset(buf, 0, 256);
strncat(buf, "/dev/", 5);
strncat(buf, dirent->d_name, strlen(dirent->d_name));
- if (stat64(buf, &stat))
- break;
- if (S_ISBLK(stat.st_mode) && stat.st_rdev == rdev)
+
+ if (stat(buf, &st))
+ break;
+
+ if (S_ISBLK(st.st_mode) && st.st_rdev == rdev)
{
- dma_info->stat = stat;
- dma_info->fd = open(buf, O_RDONLY | O_LARGEFILE);
+ dma_info->st = st;
+ dma_info->fd = open(buf, O_RDONLY
+#if defined(O_LARGEFILE)
+ | O_LARGEFILE
+#endif
+ );
closedir(dir);
return 0;
}
diff --git a/mkreiserfs/Makefile.in b/mkreiserfs/Makefile.in
index 8fa33f6..d7ab194 100644
--- a/mkreiserfs/Makefile.in
+++ b/mkreiserfs/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.7.2 from Makefile.am.
+# Makefile.in generated by automake 1.7.6 from Makefile.am.
# @configure_input@
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,7 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+host_triplet = @host@
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
+am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
+build = @build@
build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
@@ -113,6 +127,7 @@ EXTRA_DIST = $(man_MANS)
LDADD = $(top_srcdir)/lib/libmisc.a $(top_srcdir)/reiserfscore/libcore.a
subdir = mkreiserfs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES =
@@ -145,10 +160,10 @@ all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu mkreiserfs/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@@ -192,7 +207,7 @@ distclean-depend:
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@@ -203,7 +218,7 @@ distclean-depend:
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@@ -350,7 +365,6 @@ all-am: Makefile $(PROGRAMS) $(MANS)
installdirs:
$(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
-
install: install-am
install-exec: install-exec-am
install-data: install-data-am
diff --git a/mkreiserfs/mkreiserfs.8 b/mkreiserfs/mkreiserfs.8
index 2e428c7..506076b 100644
--- a/mkreiserfs/mkreiserfs.8
+++ b/mkreiserfs/mkreiserfs.8
@@ -1,9 +1,9 @@
.\" -*- nroff -*-
.\" Copyright 1996-2004 Hans Reiser.
.\"
-.TH MKREISERFS 8 "February 2004" "Reiserfsprogs-3.6.13"
+.TH MKREISERFS 8 "February 2004" "Reiserfsprogs-3.6.18"
.SH NAME
-mkreiserfs \- create tool for the Linux ReiserFS file system
+mkreiserfs \- The create tool for the Linux ReiserFS filesystem.
.SH SYNOPSIS
.B mkreiserfs
[ \fB-dfV\fR ]
@@ -20,94 +20,95 @@ mkreiserfs \- create tool for the Linux ReiserFS file system
[ \fB-B\fR | \fB--badblocks\fR \fIfile\fR ] \fI device\fR
[ \fIfilesystem-size\fR ]
.SH DESCRIPTION
-It creates a Linux ReiserFS file system on a device
-(usually a disk partition).
+\fBmkreiserfs\fR creates a Linux ReiserFS filesystem on a device (usually a disk
+partition).
.TP
.I device
-is the special file corresponding to the device (e.g /dev/hdXX for
-IDE disk partition or /dev/sdXX for SCSI disk partition).
+is the special file corresponding to a device or to a partition (e.g
+/dev/hdXX for an IDE disk partition or /dev/sdXX for a SCSI disk partition).
.TP
.I filesystem-size
-size of filesystem in blocks. If omitted, it will be
-determined by
-.B mkreiserfs
-automatically.
+is the size in blocks of the filesystem. If omitted, \fBmkreiserfs\fR will
+automatically set it.
.SH OPTIONS
.TP
\fB-b\fR | \fB--block-size \fIN\fR
-\fIN\fR is block size in bytes. 4096 only for now.
+\fIN\fR is block size in bytes. It may only be set to a power of 2 within the
+512-8192 interval.
.TP
\fB-h\fR | \fB--hash \fIHASH\fR
-\fIHASH\fR specifies the name of hash function file names in directories
-will be sorted with. Choose one of r5, rupasov, tea. r5 is default
+\fIHASH\fR specifies which hash function will sort the names in the directories.
+Choose from r5, rupasov, or tea. r5 is the default one.
.TP
\fB--format \fIFORMAT\fR
-\fIFORMAT\fR specifies a format new filsystem has to be of. Choose one
-of 3.5 and 3.6. If none is specified \fBmkreiserfs\fR will create format 3.6
-if running kernel is 2.4, 3.5 if 2.2 is running, and will refuse
-creation under other kernels.
+\fIFORMAT\fR specifies the format for the new filsystem. Choose format 3.5 or
+3.6. If none is specified \fBmkreiserfs\fR will create format 3.6 if running
+kernel is 2.4 or higher, and format 3.5 if kernel 2.2 is running, and will
+refuse creation under all other kernels.
.TP
\fB-u\fR | \fB--uuid \fIUUID\fR
-Set the universally unique identifier (\fB UUID \fR) of the filesystem to
-\fIUUID\fR (see also \fBuuidgen(8)\fR). The format of the UUID is a
-series of hex digits separated by hypthens, like this:
-"c1b9d5a2-f162-11cf-9ece-0020afc76f16". If the option skipped,
-\fBmkreiserfs\fR generates a new one.
+Sets the Universally Unique IDentifier of the filesystem to \fIUUID\fR
+(see also \fBuuidgen(8)\fR). The format of the \fIUUID\fR is a series
+of hex digits separated by hypthens, e.g.: "c1b9d5a2-f162-11cf-9ece-0020afc76f16".
+If the option is skipped, \fBmkreiserfs\fR will by default generate a new
+\fIUUID\fR.
.TP
\fB-l\fR | \fB--label \fILABEL\fR
-Set the volume label of the filesystem. \fILABEL\fR can be at most 16
-characters long; if it is longer than 16 characters, \fBmkreiserfs\fR will truncate it.
+Sets the volume label of the filesystem. \fILABEL\fR can at most be 16
+characters long; if it is longer than 16 characters, \fBmkreiserfs\fR will
+truncate it.
.TP
\fB-q\fR | \fB--quiet \fR
-Make \fBmkreiserfs\fR to work quiet without producing any message, progress and question.
-It is useful if you run \fBmkreiserfs\fR in a script. For use by end users only.
+Sets \fBmkreiserfs\fR to work quietly without producing messages, progress or
+questions. It is useful, but only for use by end users, if you run \fBmkreiserfs\fR
+in a script.
.TP
\fB-j\fR | \fB--journal-device \fIFILE\fR
-\fIFILE\fR is name of block device where the file system is to have
-journal on.
+\fIFILE\fR is the name of the block device on which is to be places the
+filesystem journal.
.TP
\fB-o\fR | \fB--journal-offset \fIN\fR
-\fIN\fR is an offset where journal starts when it is to be on a
-separate device. Default is 0. Makes no effect when journal is to be
-on a host device
+\fIN\fR is the offset where the journal starts when it is to be on a separate
+device. Default is 0. \fIN\fR has no effect when the journal is to be on the
+host device.
.TP
\fB-s\fR | \fB--journal-size \fIN
-\fIN\fR is size of journal in blocks. When journal is to be on a
-separate device - its size defaults to number of blocks that device
-has. When journal is to be on a host device - its size defaults 8193
-and maximal possible value is 32749 (for blocksize 4k). Minimun is 513
-for both cases.
+\fIN\fR is the size of the journal in blocks. When the journal is to be on a
+separate device, its size defaults to the number of blocks that the device has.
+When journal is to be on the host device, its size defaults to 8193 and the
+maximal possible size is 32749 (for blocksize 4k). The minimum size is 513 blocks
+(whether the journal is on the host or on a separate device).
.TP
\fB-t\fR | \fB--transaction-max-size \fIN
\fIN\fR is the maximum transaction size parameter for the journal. The
default, and max possible, value is 1024 blocks. It should be less
-than half the size of the journal. If specifed incorrectly, it will be
-adjusted.
+than half the size of the journal. If specified incorrectly, it will automatically
+be adjusted.
.TP
\fB-B\fR | \fB--badblocks \fIfile
-\fIFile\fR is the file name of the file that contains the list of blocks
-to be marked as bad on the filesystem. This list can be created by
+\fIFile\fR is the file name of the file that contains the list of blocks to be
+marked as bad on the filesystem. This list can be created by
\fB/sbin/badblocks -b block-size device\fR.
.TP
\fB-f\fR
-This forces \fBmkreiserfs\fR to continue even if device is either whole
-disk, or looks mounted or is not a block device. Specified more than
-once allows to avoid asking for confirmation.
+Forces \fBmkreiserfs\fR to continue even when the device is the whole disk,
+looks mounted, or is not a block device. If \fB-f\fR is specified more than
+once, it allows the user to avoid asking for confirmation.
.TP
\fB-d\fR
-This makes \fBmkreiserfs\fR to print debugging information during \fBmkreiserfs\fR.
+Sets \fBmkreiserfs\fR to print debugging information during \fBmkreiserfs\fR.
.TP
\fB-V\fR
-This prints version and exits.
+Prints the version and then exits.
.SH AUTHOR
This version of
.B mkreiserfs
has been written by Edward Shishkin <edward@namesys.com>.
.SH BUGS
-No other blocksizes but 4k are available.
-Please, report about other bugs to
-the ReiserFS mail-list <reiserfs-list@namesys.com>
+Please report bugs to the ReiserFS developers <reiserfs-dev@namesys.com>, providing
+as much information as possible--your hardware, kernel, patches, settings, all printed
+messages; check the syslog file for any related information.
.SH SEE ALSO
.BR reiserfsck (8),
.BR debugreiserfs (8),
diff --git a/mkreiserfs/mkreiserfs.c b/mkreiserfs/mkreiserfs.c
index fab25ff..37e6571 100644
--- a/mkreiserfs/mkreiserfs.c
+++ b/mkreiserfs/mkreiserfs.c
@@ -13,29 +13,22 @@
#define _GNU_SOURCE
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <asm/types.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/vfs.h>
-#include <time.h>
-#include <sys/mount.h>
-#include <sys/stat.h>
-#include <linux/kdev_t.h>
-#include <sys/utsname.h>
-#include <getopt.h>
-#include <stdarg.h>
+#ifndef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include "io.h"
#include "misc.h"
#include "reiserfs_lib.h"
-#include "../include/config.h"
+
#include "../version.h"
+#include <getopt.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/utsname.h>
+
#if defined(HAVE_LIBUUID) && defined(HAVE_UUID_UUID_H)
# include <uuid/uuid.h>
#endif
@@ -511,13 +504,8 @@ static int select_format (void)
}
reiserfs_warning(stdout, "Kernel %s is running.\n", sysinfo.release);
- if (!strncmp (sysinfo.release, "2.6", 3))
- return REISERFS_FORMAT_3_6;
-
- if (!strncmp (sysinfo.release, "2.5", 3))
- return REISERFS_FORMAT_3_6;
- if (!strncmp (sysinfo.release, "2.4", 3))
+ if (strncmp (sysinfo.release, "2.4", 3) >= 0)
return REISERFS_FORMAT_3_6;
if (strncmp (sysinfo.release, "2.2", 3)) {
diff --git a/reiserfscore/Makefile.in b/reiserfscore/Makefile.in
index 858dcd0..1d1f24a 100644
--- a/reiserfscore/Makefile.in
+++ b/reiserfscore/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.7.2 from Makefile.am.
+# Makefile.in generated by automake 1.7.6 from Makefile.am.
# @configure_input@
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,7 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+host_triplet = @host@
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
+am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
+build = @build@
build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
@@ -111,6 +125,7 @@ libcore_a_SOURCES = do_balan.c fix_node.c hashes.c ibalance.c lbalance.c prints.
stree.c node_formats.c reiserfslib.c bitmap.c journal.c includes.h
subdir = reiserfscore
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES =
@@ -145,10 +160,10 @@ all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu reiserfscore/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
AR = ar
@@ -184,7 +199,7 @@ distclean-depend:
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@@ -195,7 +210,7 @@ distclean-depend:
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@@ -294,7 +309,6 @@ check: check-am
all-am: Makefile $(LIBRARIES)
installdirs:
-
install: install-am
install-exec: install-exec-am
install-data: install-data-am
diff --git a/reiserfscore/ibalance.c b/reiserfscore/ibalance.c
index 38efff0..bd0d29e 100644
--- a/reiserfscore/ibalance.c
+++ b/reiserfscore/ibalance.c
@@ -6,16 +6,6 @@
#include "includes.h"
-/* this is one and only function that is used outside (do_balance.c) */
-int balance_internal (
- /*struct reiserfs_transaction_handle *th,*/
- struct tree_balance * ,
- int,
- int,
- struct item_head * ,
- struct buffer_head **
- );
-
/* modes of internal_shift_left, internal_shift_right and internal_insert_childs */
#define INTERNAL_SHIFT_FROM_S_TO_L 0
#define INTERNAL_SHIFT_FROM_R_TO_S 1
diff --git a/reiserfscore/includes.h b/reiserfscore/includes.h
index c5bd15e..ecb0676 100644
--- a/reiserfscore/includes.h
+++ b/reiserfscore/includes.h
@@ -3,22 +3,19 @@
* reiserfsprogs/README
*/
-#define _GNU_SOURCE
-#include <stdio.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "io.h"
+#include "misc.h"
+#include "reiserfs_lib.h"
+
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <asm/types.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include <malloc.h>
#include <sys/vfs.h>
-#include <unistd.h>
#include <time.h>
-#include "io.h"
-#include "misc.h"
-#include "reiserfs_lib.h"
-#include "swab.h"
-
-#include "../include/config.h"
diff --git a/reiserfscore/journal.c b/reiserfscore/journal.c
index a33f111..5a4fab4 100644
--- a/reiserfscore/journal.c
+++ b/reiserfscore/journal.c
@@ -3,15 +3,9 @@
* reiserfsprogs/README
*/
-#include "includes.h"
+#define _GNU_SOURCE
-/* this is provided for anybody who wants to deal with journal */
-int replay_one_transaction (reiserfs_filsys_t *, reiserfs_trans_t *);
-void for_each_transaction (reiserfs_filsys_t *, action_on_trans_t);
-void for_each_block (reiserfs_filsys_t *, reiserfs_trans_t *, action_on_block_t);
-int get_boundary_transactions (reiserfs_filsys_t *, reiserfs_trans_t *,
- reiserfs_trans_t *);
-int next_transaction (reiserfs_filsys_t *, reiserfs_trans_t *, reiserfs_trans_t);
+#include "includes.h"
/* compares description block with commit block. returns 0 if they differ, 1
if they match */
@@ -185,7 +179,6 @@ int get_boundary_transactions (reiserfs_filsys_t * fs,
}
#define TRANS_FOUND 1
-#define TRANS_LAST 2
#define TRANS_NOT_FOUND 0
/* trans is a valid transaction. Look for valid transaction with smallest
@@ -235,8 +228,6 @@ int next_transaction (reiserfs_filsys_t * fs, reiserfs_trans_t * trans, reiserfs
trans->commit_blocknr = commit_expected (fs, next_d_bh);
trans->next_trans_offset = next_desc_expected (fs, next_d_bh) - j_start;
found = TRANS_FOUND;
- if (break_trans.trans_id == get_desc_trans_id (next_d_bh))
- found = TRANS_LAST;
}
brelse (d_bh);
@@ -327,6 +318,7 @@ int replay_one_transaction (reiserfs_filsys_t * fs,
reiserfs_trans_t * trans)
{
for_each_block (fs, trans, read_journal_write_in_place);
+ fsync(fs->fs_dev);
return 0;
}
@@ -341,10 +333,7 @@ void for_each_transaction (reiserfs_filsys_t * fs, action_on_trans_t action)
while (1) {
action (fs, &oldest);
- if (ret == TRANS_LAST)
- break;
- ret = next_transaction (fs, &oldest, newest);
- if (ret == TRANS_NOT_FOUND)
+ if ((ret = next_transaction (fs, &oldest, newest)) == TRANS_NOT_FOUND)
break;
}
}
@@ -497,7 +486,11 @@ int reiserfs_open_journal (reiserfs_filsys_t * fs, char * j_filename, int flags)
}
}
- fs->fs_journal_dev = open (j_filename, flags | O_LARGEFILE);
+ fs->fs_journal_dev = open (j_filename, flags
+#if defined(O_LARGEFILE)
+ | O_LARGEFILE
+#endif
+ );
if (fs->fs_journal_dev == -1)
return -1;
@@ -624,7 +617,11 @@ int reiserfs_create_journal(
*/
}
- fs->fs_journal_dev = open (j_device, O_RDWR | O_LARGEFILE);
+ fs->fs_journal_dev = open (j_device, O_RDWR
+#if defined(O_LARGEFILE)
+ | O_LARGEFILE
+#endif
+ );
if (fs->fs_journal_dev == -1) {
reiserfs_warning (stderr, "reiserfs_create_journal: could not open "
"%s: %s\n", j_device, strerror(errno));
@@ -691,7 +688,11 @@ void reiserfs_reopen_journal (reiserfs_filsys_t * fs, int flag)
if (close (fs->fs_journal_dev))
die ("reiserfs_reopen_journal: closed failed: %s", strerror(errno));
- fs->fs_journal_dev = open (fs->fs_j_file_name, flag | O_LARGEFILE);
+ fs->fs_journal_dev = open (fs->fs_j_file_name, flag
+#if defined(O_LARGEFILE)
+ | O_LARGEFILE
+#endif
+ );
if (fs->fs_journal_dev == -1)
die ("reiserfs_reopen_journal: could not reopen journal device");
@@ -734,17 +735,21 @@ void reiserfs_close_journal (reiserfs_filsys_t * fs)
}
/* update journal header */
-static void update_journal_header (struct buffer_head * bh_jh, reiserfs_trans_t trans) {
+static void update_journal_header (reiserfs_filsys_t * fs,
+ struct buffer_head * bh_jh,
+ reiserfs_trans_t *trans)
+{
struct reiserfs_journal_header * j_head;
j_head = (struct reiserfs_journal_header *)(bh_jh->b_data);
/* update journal header */
- set_jh_last_flushed (j_head, trans.trans_id);
- set_jh_mount_id (j_head, trans.mount_id);
- set_jh_replay_start_offset (j_head, trans.next_trans_offset);
+ set_jh_last_flushed (j_head, trans->trans_id);
+ set_jh_mount_id (j_head, trans->mount_id);
+ set_jh_replay_start_offset (j_head, trans->next_trans_offset);
mark_buffer_dirty (bh_jh);
bwrite (bh_jh);
+ fsync(fs->fs_journal_dev);
}
/* fixme: what should be done when not all transactions can be replayed in proper order? */
@@ -780,29 +785,21 @@ int replay_journal (reiserfs_filsys_t * fs)
replayed = 0;
ret = TRANS_FOUND;
- while (cur.mount_id != control.mount_id || cur.trans_id != control.trans_id) {
- if (control.mount_id == cur.mount_id && control.trans_id == 0 &&
- control.desc_blocknr == 0)
+ /* Looking to the first valid not replayed transaction. */
+ while (1) {
+ if (cur.mount_id == control.mount_id &&
+ cur.trans_id > control.trans_id)
break;
-
- ret = next_transaction (fs, &cur, newest);
-
- if (ret != TRANS_FOUND)
+
+ if ((ret = next_transaction (fs, &cur, newest)) != TRANS_FOUND)
break;
}
-
+
while (ret == TRANS_FOUND) {
- if (control.mount_id != cur.mount_id || control.trans_id != 0 ||
- control.desc_blocknr != 0)
- {
- ret = next_transaction (fs, &cur, newest);
-
- if (ret == TRANS_NOT_FOUND)
- break;
-
- if (cur.mount_id != control.mount_id || cur.trans_id != control.trans_id + 1)
- break;
- }
+ /* If not the next transaction to be replayed, break out here. */
+ if ((cur.mount_id != control.mount_id) ||
+ (cur.trans_id != control.trans_id + 1 && control.trans_id))
+ break;
if (!transaction_check_content(fs, &cur)) {
reiserfs_warning (stderr, "Trans broken: mountid %lu, transid %lu, desc %lu, "
@@ -816,17 +813,24 @@ int replay_journal (reiserfs_filsys_t * fs)
cur.mount_id, cur.trans_id, cur.desc_blocknr, cur.trans_len,
cur.commit_blocknr, cur.next_trans_offset);
replay_one_transaction (fs, &cur);
- update_journal_header (bh, cur);
+ update_journal_header (fs, bh, &cur);
control = cur;
replayed ++;
+
+ ret = next_transaction (fs, &cur, newest);
}
- reiserfs_warning (stderr, "%d transactions replayed\n", replayed);
+ reiserfs_warning (stderr, "Reiserfs journal '%s' in blocks [%u..%u]: %d "
+ "transactions replayed\n", fs->fs_j_file_name,
+ get_jp_journal_1st_block(sb_jp(fs->fs_ondisk_sb)),
+ get_jp_journal_1st_block(sb_jp(fs->fs_ondisk_sb)) +
+ get_jp_journal_size(sb_jp(fs->fs_ondisk_sb)) + 1,
+ replayed);
mark_buffer_dirty (fs->fs_super_bh);
bwrite (fs->fs_super_bh);
- update_journal_header (bh, newest);
+ update_journal_header (fs, bh, &newest);
return 0;
}
diff --git a/reiserfscore/lbalance.c b/reiserfscore/lbalance.c
index c0e4e30..e9323ba 100644
--- a/reiserfscore/lbalance.c
+++ b/reiserfscore/lbalance.c
@@ -949,7 +949,8 @@ void leaf_cut_from_buffer (reiserfs_filsys_t * fs,
set_dc_child_size (dc, get_dc_child_size (dc) - cut_size);
mark_buffer_dirty(bi->bi_parent);
}
- if (is_a_leaf(bh->b_data, bh->b_size) != THE_LEAF)
+ if (is_a_leaf(bh->b_data, bh->b_size) != THE_LEAF &&
+ is_a_leaf(bh->b_data, bh->b_size) != HAS_IH_ARRAY)
reiserfs_panic ("leaf_cut_from_buffer: bad leaf %lu: %b",
bh->b_blocknr, bh);
}
@@ -1015,7 +1016,8 @@ static void leaf_delete_items_entirely (reiserfs_filsys_t * fs,
(j - last_removed_loc + IH_SIZE * del_num));
mark_buffer_dirty(bi->bi_parent);
}
- if (is_a_leaf(bh->b_data, bh->b_size) != THE_LEAF)
+ if (is_a_leaf(bh->b_data, bh->b_size) != THE_LEAF &&
+ is_a_leaf(bh->b_data, bh->b_size) != HAS_IH_ARRAY)
reiserfs_panic ("leaf_delete_items_entirely: bad leaf %lu: %b", bh->b_blocknr, bh);
}
diff --git a/reiserfscore/node_formats.c b/reiserfscore/node_formats.c
index 9a2c9a2..c17a5c5 100644
--- a/reiserfscore/node_formats.c
+++ b/reiserfscore/node_formats.c
@@ -202,9 +202,9 @@ int is_tree_node (struct buffer_head * bh, int level)
static int is_desc_block (char * buf, unsigned long buf_size)
{
+ struct reiserfs_journal_desc *desc = (struct reiserfs_journal_desc *)buf;
if (!memcmp(buf + buf_size - 12, JOURNAL_DESC_MAGIC, 8) &&
- //get_jdesc_len (desc) > 0)
- le32_to_cpu(*((__u32*)(buf + 4))) > 0)
+ le32_to_cpu (desc->j2_len) > 0)
return 1;
return 0;
}
@@ -495,7 +495,7 @@ static int is_bad_indirect (reiserfs_filsys_t * fs, struct item_head * ih, char
for (i = 0; i < I_UNFM_NUM (ih); i ++) {
if (!ind [i])
continue;
- if (check_unfm_func && check_unfm_func (fs, le32_to_cpu(ind [i])))
+ if (check_unfm_func && check_unfm_func (fs, d32_get (ind, i)))
return 1;
}
diff --git a/reiserfscore/prints.c b/reiserfscore/prints.c
index 9d9122b..0f7aadb 100644
--- a/reiserfscore/prints.c
+++ b/reiserfscore/prints.c
@@ -3,6 +3,8 @@
* reiserfsprogs/README
*/
+#define _GNU_SOURCE
+
#include "includes.h"
#include <stdarg.h>
#include <limits.h>
@@ -392,9 +394,9 @@ void print_indirect_item (FILE * fp, struct buffer_head * bh, int item_num)
reiserfs_warning (fp, "%d pointer%s\n[", I_UNFM_NUM (ih),
I_UNFM_NUM (ih) != 1 ? "s" : "" );
for (j = 0; j < I_UNFM_NUM (ih); j ++) {
- if (sequence_finished (prev, &num, unp[j])) {
+ if (sequence_finished (prev, &num, d32_get(unp, j))) {
print_sequence (fp, prev, num);
- start_new_sequence (&prev, &num, unp[j]);
+ start_new_sequence (&prev, &num, d32_get(unp, j));
}
}
print_sequence (fp, prev, num);
diff --git a/reiserfscore/reiserfslib.c b/reiserfscore/reiserfslib.c
index 8f5cef8..a54f72f 100644
--- a/reiserfscore/reiserfslib.c
+++ b/reiserfscore/reiserfslib.c
@@ -3,6 +3,8 @@
* reiserfsprogs/README
*/
+#define _GNU_SOURCE
+
#include "includes.h"
#include <linux/kdev_t.h>
@@ -63,7 +65,11 @@ reiserfs_filsys_t * reiserfs_open (char * filename, int flags, int *error, void
if (error)
*error = 0;
- fd = open (filename, flags | O_LARGEFILE);
+ fd = open (filename, flags
+#if defined(O_LARGEFILE)
+ | O_LARGEFILE
+#endif
+ );
if (fd == -1) {
if (error)
*error = errno;
@@ -199,7 +205,11 @@ reiserfs_filsys_t * reiserfs_create (char * filename,
return 0;
}
- fs->fs_dev = open (filename, O_RDWR | O_LARGEFILE);
+ fs->fs_dev = open (filename, O_RDWR
+#if defined(O_LARGEFILE)
+ | O_LARGEFILE
+#endif
+ );
if (fs->fs_dev == -1) {
reiserfs_warning (stderr, "reiserfs_create: could not open %s: %s\n",
filename, strerror(errno));
@@ -322,7 +332,11 @@ static void reiserfs_only_reopen (reiserfs_filsys_t * fs, int flag)
if (close (fs->fs_dev))
die ("reiserfs_reopen: closed failed: %s", strerror(errno));
- fs->fs_dev = open (fs->fs_file_name, flag | O_LARGEFILE);
+ fs->fs_dev = open (fs->fs_file_name, flag
+#if defined(O_LARGEFILE)
+ | O_LARGEFILE
+#endif
+ );
if (fs->fs_dev == -1)
die ("reiserfs_reopen: could not reopen device: %s", strerror(errno));
@@ -413,18 +427,6 @@ int reiserfs_free_block (reiserfs_filsys_t * fs, unsigned long block)
return 0;
}
-/*
-inline int reiserfs_bin_search (void * key, void * base, int num, int width,
- int *ppos, comparison_fn_t comp_func) {
- __u32 position = *ppos;
- int retval;
-
- retval = reiserfs_bin_search (key, base, num, width, &position, comp_func);
- *ppos = position;
- return retval;
-}
-*/
-
static int reiserfs_search_by_key_x (reiserfs_filsys_t * fs, struct key * key,
struct path * path, int key_length)
{
@@ -572,16 +574,14 @@ int usearch_by_position (reiserfs_filsys_t * s, struct key * key,
static int comp_dir_entries (const void * p1, const void * p2)
{
- __u32 deh_offset;
- const __u32 * off1, * off2;
-
- off1 = p1;
- off2 = p2;
- deh_offset = le32_to_cpu (*off1);
+ __u32 off1, off2;
- if (deh_offset < *off2)
+ off1 = d32_get((__u32 *)p1, 0);
+ off2 = *(__u32 *)p2;
+
+ if (off1 < off2)
return -1;
- if (deh_offset > *off2)
+ if (off1 > off2)
return 1;
return 0;
}
@@ -1211,8 +1211,8 @@ int can_we_format_it (char * device_name, int force)
reiserfs_warning (stderr, "%s is not a block special device\n", device_name);
check_forcing_ask_confirmation (force);
} else {
- if ((IDE_DISK_MAJOR (MAJOR(rdev)) && MINOR(rdev) % 64 == 0) ||
- (SCSI_BLK_MAJOR (MAJOR(rdev)) && MINOR(rdev) % 16 == 0)) {
+ if ((IDE_DISK_MAJOR (major(rdev)) && minor(rdev) % 64 == 0) ||
+ (SCSI_BLK_MAJOR (major(rdev)) && minor(rdev) % 16 == 0)) {
/* /dev/hda or similar */
reiserfs_warning (stderr, "%s is entire device, not just one partition!\n",
device_name);
@@ -1351,9 +1351,9 @@ void mark_badblock(reiserfs_filsys_t *fs,
tmp_ih = get_ih(badblock_path);
ind_item = (__u32 *)get_item(badblock_path);
- for (i = 0; i < I_UNFM_NUM(tmp_ih); i++, ind_item++) {
+ for (i = 0; i < I_UNFM_NUM(tmp_ih); i++) {
reiserfs_bitmap_set_bit(fs->fs_badblocks_bm,
- le32_to_cpu(*ind_item));
+ d32_get(ind_item, i));
}
pathrelse (badblock_path);
diff --git a/reiserfscore/stree.c b/reiserfscore/stree.c
index f13598d..389c692 100644
--- a/reiserfscore/stree.c
+++ b/reiserfscore/stree.c
@@ -60,8 +60,8 @@ int comp_short_keys (const void * k1, const void * k2)
__u32 u1, u2;
for( ; n_key_length--; ++p_s_key1, ++p_s_key2 ) {
- u1 = le32_to_cpu(*p_s_key1) ;
- u2 = le32_to_cpu(*p_s_key2) ;
+ u1 = d32_get(p_s_key1, 0) ;
+ u2 = d32_get(p_s_key2, 0) ;
if ( u1 < u2 )
return -1;
if ( u1 > u2 )
diff --git a/reiserfsprogs.spec b/reiserfsprogs.spec
index 28695a2..895b17a 100644
--- a/reiserfsprogs.spec
+++ b/reiserfsprogs.spec
@@ -1,4 +1,4 @@
-%define reiserfsprogsversion 3.6.13
+%define reiserfsprogsversion 3.6.18
Vendor: Hans Reiser
Distribution: Hans Reiser
@@ -44,7 +44,7 @@ Vladimir Saveliev <monstr@namesys.com>
%{__ln_s} -f reiserfsck fsck.reiserfs
%{__ln_s} -f mkreiserfs mkfs.reiserfs
-# __os_install_post is normally executed after %install disable it
+# __os_install_post is normally executed after \%install disable it
%define ___build_post %{nil}
# explicitly call it now, so manpages get compressed, exec's stripped etc.
%{?__os_install_post}
diff --git a/resize_reiserfs/Makefile.in b/resize_reiserfs/Makefile.in
index a875367..bfebbf8 100644
--- a/resize_reiserfs/Makefile.in
+++ b/resize_reiserfs/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.7.2 from Makefile.am.
+# Makefile.in generated by automake 1.7.6 from Makefile.am.
# @configure_input@
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,7 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+host_triplet = @host@
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
+am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
+build = @build@
build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
@@ -113,6 +127,7 @@ EXTRA_DIST = $(man_MANS)
LDADD = $(top_srcdir)/lib/libmisc.a $(top_srcdir)/reiserfscore/libcore.a
subdir = resize_reiserfs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES =
@@ -147,10 +162,10 @@ all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu resize_reiserfs/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@@ -196,7 +211,7 @@ distclean-depend:
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@@ -207,7 +222,7 @@ distclean-depend:
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@@ -354,7 +369,6 @@ all-am: Makefile $(PROGRAMS) $(MANS)
installdirs:
$(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
-
install: install-am
install-exec: install-exec-am
install-data: install-data-am
diff --git a/resize_reiserfs/do_shrink.c b/resize_reiserfs/do_shrink.c
index bf34a67..8e38173 100644
--- a/resize_reiserfs/do_shrink.c
+++ b/resize_reiserfs/do_shrink.c
@@ -124,11 +124,11 @@ static unsigned long move_formatted_block(reiserfs_filsys_t * fs, unsigned long
for (j = 0; j < I_UNFM_NUM(ih); j++) {
unsigned long unfm_block;
- if (indirect [j] == 0) /* hole */
+ if (d32_get (indirect, j) == 0) /* hole */
continue;
- unfm_block = move_unformatted_block(fs, le32_to_cpu (indirect [j]), bnd, h + 1);
+ unfm_block = move_unformatted_block(fs, d32_get (indirect, j), bnd, h + 1);
if (unfm_block) {
- indirect [j] = cpu_to_le32 (unfm_block);
+ d32_put (indirect, j, unfm_block);
mark_buffer_dirty(bh);
}
}
diff --git a/resize_reiserfs/resize.h b/resize_reiserfs/resize.h
index 98f83c9..0d901f8 100644
--- a/resize_reiserfs/resize.h
+++ b/resize_reiserfs/resize.h
@@ -3,18 +3,15 @@
* reiserfsprogs/README
*/
-#define _GNU_SOURCE
+#ifndef HAVE_CONFIG_H
+# include "config.h"
+#endif
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <asm/types.h>
-#include <errno.h>
-#include <stdio.h>
-#include <mntent.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdlib.h>
+#include "io.h"
+#include "misc.h"
+#include "reiserfs_lib.h"
+
+#include "../version.h"
#if __GLIBC__ >= 2
#include <sys/mount.h>
@@ -22,13 +19,10 @@
#include <linux/fs.h>
#endif
+#include <errno.h>
+#include <string.h>
-#include "io.h"
-#include "misc.h"
-#include "reiserfs_lib.h"
-#include "../include/config.h"
-#include "../version.h"
-
+#include <mntent.h>
#define print_usage_and_exit() {\
fprintf (stderr, "Usage: %s [-s[+|-]#[G|M|K]] [-fqvV] device\n\n", argv[0]);\
diff --git a/resize_reiserfs/resize_reiserfs.8 b/resize_reiserfs/resize_reiserfs.8
index 2ddbd6f..10cdce5 100644
--- a/resize_reiserfs/resize_reiserfs.8
+++ b/resize_reiserfs/resize_reiserfs.8
@@ -1,7 +1,7 @@
.\" -*- nroff -*-
.\" Copyright 1996-2004 Hans Reiser.
.\"
-.TH RESIZE_REISERFS 8 "January 2004" "Reiserfsprogs-3.6.13"
+.TH RESIZE_REISERFS 8 "January 2004" "Reiserfsprogs-3.6.18"
.SH NAME
resize_reiserfs \- resizer tool for the ReiserFS filesystem
.SH SYNOPSIS
@@ -59,7 +59,7 @@ space on block
.I device.
.PP
-If you wish to shrink an reiserfs partition, first use
+If you wish to shrink a reiserfs partition, first use
.B resize_reiserfs
to shrink the file system. You may then use
.BR cfdisk (8)
@@ -86,7 +86,7 @@ Turn on extra progress status messages (default).
.SH RETURN VALUES
0 Resizing successful.
.TP
-\-1 In another case.
+\-1 Resizing not successful.
.SH EXAMPLES
The following example shows how to test
@@ -108,15 +108,14 @@ with a
.br
\ df /mnt
-.SH WARNING
-Note that this is a BETA program and may corrupt filesystems.
.SH AUTHOR
This version of
.B resize_reiserfs
has been written by Alexander Zarochentcev <zam@namesys.com>.
.SH BUGS
-Please, report about the bugs to Alexander Zarochentcev <zam@namesys.com> or
-to Hans Reiser <reiser@namesys.com>.
+Please report bugs to the ReiserFS developers <reiserfs-dev@namesys.com>, providing
+as much information as possible--your hardware, kernel, patches, settings, all printed
+messages; check the syslog file for any related information.
.SH SEE ALSO
.BR cfdisk (8),
.BR reiserfsck (8),
diff --git a/resize_reiserfs/resize_reiserfs.c b/resize_reiserfs/resize_reiserfs.c
index 690ed1b..e5d774d 100644
--- a/resize_reiserfs/resize_reiserfs.c
+++ b/resize_reiserfs/resize_reiserfs.c
@@ -10,6 +10,8 @@
*
*/
+#define _GNU_SOURCE
+
#include "resize.h"
#include <limits.h>
diff --git a/tune/Makefile.in b/tune/Makefile.in
index 380caaf..6275e8f 100644
--- a/tune/Makefile.in
+++ b/tune/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.7.2 from Makefile.am.
+# Makefile.in generated by automake 1.7.6 from Makefile.am.
# @configure_input@
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,7 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+host_triplet = @host@
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
+am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
+build = @build@
build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
@@ -114,6 +128,7 @@ EXTRA_DIST = $(man_MANS)
LDADD = $(top_srcdir)/lib/libmisc.a $(top_srcdir)/reiserfscore/libcore.a
subdir = tune
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES =
@@ -146,10 +161,10 @@ all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu tune/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@@ -193,7 +208,7 @@ distclean-depend:
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@@ -204,7 +219,7 @@ distclean-depend:
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@@ -351,7 +366,6 @@ all-am: Makefile $(PROGRAMS) $(MANS)
installdirs:
$(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
-
install: install-am
install-exec: install-exec-am
install-data: install-data-am
diff --git a/tune/reiserfstune.8 b/tune/reiserfstune.8
index c44ed09..ac75992 100644
--- a/tune/reiserfstune.8
+++ b/tune/reiserfstune.8
@@ -1,9 +1,9 @@
.\" -*- nroff -*-
.\" Copyright 1996-2004 Hans Reiser.
.\"
-.TH REISERFSTUNE 8 "February 2004" "Reiserfsprogs-3.6.13"
+.TH REISERFSTUNE 8 "February 2004" "Reiserfsprogs-3.6.18"
.SH NAME
-reiserfstune \- tunning tool for the ReiserFS filesystem
+reiserfstune \- The tunning tool for the ReiserFS filesystem.
.SH SYNOPSIS
.B reiserfstune
[ \fB-f\fR ]
@@ -19,17 +19,18 @@ reiserfstune \- tunning tool for the ReiserFS filesystem
[ \fB-l\fR | \fB--label \fILABEL\fR ]
.I device
.SH DESCRIPTION
-\fBreiserfstune\fR is used for tuning the ReiserFS
-journal. It can change two parameters (journal size and maximum
-transaction size), and it can move the journal's location to a new specified
-block device. (The old ReiserFS's journal may be
-kept unused, or discarded at the user's option.) Note: At the time of
-writing this feature was implemented for a special release of
-ReiserFS, and was not expected to be put into the mainstream kernel
-until approximately Linux 2.5. This means that if you have the stock
-kernel you must apply a special patch. Without this patch the kernel
-will refuse to mount the newly modified file system. We will charge
-$25 to explain this to you if you ask us why it doesn't work.
+\fBreiserfstune\fR is used for tuning the ReiserFS. It can change two journal
+parameters (the journal size and the maximum transaction size), and it can move
+the journal's location to a new specified block device. (The old ReiserFS's
+journal may be kept unused, or discarded at the user's option.) Besides that
+\fBreiserfstune\fR can store the bad block list to the ReiserFS and set UUID
+and LABEL.
+Note: At the time of writing the relocated journal was implemented for a special
+release of ReiserFS, and was not expected to be put into the mainstream kernel
+until approximately Linux 2.5. This means that if you have the stock kernel you
+must apply a special patch. Without this patch the kernel will refuse to mount
+the newly modified file system. We will charge $25 to explain this to you if
+you ask us why it doesn't work.
.PP
Perhaps the most interesting application of this code is to put the
journal on a solid state disk.
@@ -149,7 +150,9 @@ using /dev/hda1 under patched kernel
This version of \fBreiserfstune\fR has been written by Vladimir
Demidov <vova@namesys.com> and Edward Shishkin <edward@namesys.com>.
.SH BUGS
-Please repoort bugs to the ReiserFS mail list <reiserfs-list@namesys.com>
+Please report bugs to the ReiserFS developers <reiserfs-dev@namesys.com>, providing
+as much information as possible--your hardware, kernel, patches, settings, all printed
+messages; check the syslog file for any related information.
.SH SEE ALSO
.BR reiserfsck (8),
.BR debugreiserfs (8),
diff --git a/tune/tune.c b/tune/tune.c
index 397664f..2c789d9 100644
--- a/tune/tune.c
+++ b/tune/tune.c
@@ -3,8 +3,15 @@
* reiserfsprogs/README
*/
+#define _GNU_SOURCE
+
#include "tune.h"
+#include <getopt.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>
+
char *program_name;
static void message( const char * fmt, ... )
@@ -222,15 +229,15 @@ static void callback_new_badblocks(reiserfs_filsys_t *fs,
tmp_ih = get_ih(badblock_path);
ind_item = (__u32 *)get_item(badblock_path);
- for (i = 0; i < I_UNFM_NUM(tmp_ih); i++, ind_item++) {
+ for (i = 0; i < I_UNFM_NUM(tmp_ih); i++) {
if (reiserfs_bitmap_test_bit(fs->fs_badblocks_bm,
- le32_to_cpu(*ind_item)))
+ d32_get (ind_item, i)))
{
message("Block %u is marked as bad already.",
- le32_to_cpu(*ind_item));
+ d32_get (ind_item, i));
reiserfs_bitmap_clear_bit(fs->fs_badblocks_bm,
- le32_to_cpu(*ind_item));
+ d32_get (ind_item, i));
}
}
@@ -247,9 +254,9 @@ static void callback_clear_badblocks(reiserfs_filsys_t *fs,
tmp_ih = get_ih(badblock_path);
ind_item = (__u32 *)get_item(badblock_path);
- for (i = 0; i < I_UNFM_NUM(tmp_ih); i++, ind_item++) {
+ for (i = 0; i < I_UNFM_NUM(tmp_ih); i++) {
reiserfs_bitmap_clear_bit(fs->fs_bitmap2,
- le32_to_cpu(*ind_item));
+ d32_get(ind_item, i));
}
pathrelse (badblock_path);
@@ -514,7 +521,11 @@ int main (int argc, char **argv)
if (get_jp_journal_magic(sb_jp(fs->fs_ondisk_sb)) != NEED_TUNE &&
!(Options & OPT_SKIP_J))
{
- if (reiserfs_open_journal (fs, jdevice_name, O_RDWR | O_LARGEFILE)) {
+ if (reiserfs_open_journal (fs, jdevice_name, O_RDWR
+#if defined(O_LARGEFILE)
+ | O_LARGEFILE
+#endif
+ )) {
message ("Failed to open the journal device (%s).", jdevice_name);
return 1;
}
diff --git a/tune/tune.h b/tune/tune.h
index 26829d6..7a854e7 100644
--- a/tune/tune.h
+++ b/tune/tune.h
@@ -3,30 +3,14 @@
* reiserfsprogs/README
*/
-#define _GNU_SOURCE
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <asm/types.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/vfs.h>
-#include <time.h>
-#include <sys/ioctl.h>
-#include <sys/mount.h>
-#include <sys/stat.h>
-#include <linux/kdev_t.h>
-#include <sys/utsname.h>
-#include <getopt.h>
-#include <stdarg.h>
+#ifndef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include "io.h"
#include "misc.h"
#include "reiserfs_lib.h"
-#include "../include/config.h"
+
#include "../version.h"
#if defined(HAVE_LIBUUID) && defined(HAVE_UUID_UUID_H)