Many files:
  Checked in e2fsprogs 1.04.

diff --git a/.fix-Changelog b/.fix-Changelog
new file mode 100644
index 0000000..b8b36fc
--- /dev/null
+++ b/.fix-Changelog
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+FILES=`find . -name ChangeLog`
+
+header=/tmp/revheader
+
+for i in $FILES 
+do
+	echo $i
+	cat $header $i > $i.new
+	mv $i.new $i
+done
diff --git a/ChangeLog b/ChangeLog
index 992e47a..bc4c349 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+Thu May 16 11:12:30 1996  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+	* Release of E2fsprogs version 1.04
+
+Thu May 16 09:38:40 1996  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+	* configure.in: 
+	  MCONFIG.in: Man pages, shell scripts and include files are now
+		generated using the lib/substitute_sh script.  This is
+		faster than the configure substitution, and it doesn't
+		change the mod time of the file if it hasn't changed,
+		which prevents needless compilation of files.
+
+		Define new sets of Makefile variables: LIBSS, LIBCOM_ERR,
+ 		LIBEXT2FS, LIBE2P, and their static and profiled variants,
+ 		STATIC_* and PROFILED_*, which point to the actual file of
+ 		the shared or static library.  This way makefiles can link
+ 		directly with exactly the library they want.  Many ld's
+		(include GNU ld) have a really broken idea of how -L
+		works, and will link against an older library in /usr/lib
+		even though there is a newer on in a specified -L directory.
+		  
+Wed May 15 21:40:22 1996  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+	* configure.in: Add support for --enable-dynamic-e2fsck, for
+ 		people who don't want to link e2fsck statically.  This
+ 		saves space, at the cost of increasing the reliance of
+ 		e2fsck other files (3-4 shared libraries).
+
 Wed Mar 27 00:33:40 1996    <tytso@rsts-11.mit.edu>
 
 	* Release of E2fsprogs version 1.03
diff --git a/INSTALL.dllbin b/INSTALL.dllbin
index a446e37..3b0ecb8 100644
--- a/INSTALL.dllbin
+++ b/INSTALL.dllbin
@@ -1,7 +1,7 @@
 NOTE: This is the DLL version of the binary distribution.  If you have
 an ELF system, please either compile e2fsprogs from sources yourself,
 or get the ELF version of the binary distribution.  The ELF version
-will have a filename of e2fsprogs-1.01-elfbin.tar.gz
+will have a filename of e2fsprogs-1.04-elfbin.tar.gz
 
 
 	To install the binary distribution of the second extended file
@@ -9,7 +9,7 @@
 
 1) Install this tar file using the following command:
 
-	gunzip < e2fsprogs-1.01-dllbin.tar.gz | (cd /; tar xvf - )
+	gunzip < e2fsprogs-1.04-dllbin.tar.gz | (cd /; tar xvf - )
 
 2) Run ldconfig to update the shared library pointers.
 
diff --git a/INSTALL.elfbin b/INSTALL.elfbin
index 1a05ec9..4acf08c 100644
--- a/INSTALL.elfbin
+++ b/INSTALL.elfbin
@@ -1,7 +1,7 @@
 NOTE: This is the ELF version of the binary distribution.  If you have
 a DLL system, please either compile e2fsprogs from sources yourself,
 or get the DLL version of the binary distribution.  The DLL version
-will have a filename of e2fsprogs-1.01-dllbin.tar.gz
+will have a filename of e2fsprogs-1.04-dllbin.tar.gz
 
 
 	To install the binary distribution of the second extended file
@@ -9,7 +9,7 @@
 
 1) Install this tar file using the following command:
 
-	gunzip < e2fsprogs-1.01-elfbin.tar.gz | (cd /; tar xvf - )
+	gunzip < e2fsprogs-1.04-elfbin.tar.gz | (cd /; tar xvf - )
 
 2) Run ldconfig to update the shared library pointers.
 
diff --git a/MCONFIG.in b/MCONFIG.in
index c3c8f7a..0874305 100644
--- a/MCONFIG.in
+++ b/MCONFIG.in
@@ -44,6 +44,25 @@
 ARUPD = $(AR) r
 
 #
+# Library definitions
+#
+LIB = $(top_builddir)/lib
+LIBSS = $(LIB)/libss@LIB_EXT@
+LIBCOM_ERR = $(LIB)/libcom_err@LIB_EXT@
+LIBE2P = $(LIB)/libe2p@LIB_EXT@
+LIBEXT2FS = $(LIB)/libext2fs@LIB_EXT@
+
+STATIC_LIBSS = $(LIB)/libss@STATIC_LIB_EXT@
+STATIC_LIBCOM_ERR = $(LIB)/libcom_err@STATIC_LIB_EXT@
+STATIC_LIBE2P = $(LIB)/libe2p@STATIC_LIB_EXT@
+STATIC_LIBEXT2FS = $(LIB)/libext2fs@STATIC_LIB_EXT@
+
+PROFILED_LIBSS = $(LIB)/libss@PROFILED_LIB_EXT@
+PROFILED_LIBCOM_ERR = $(LIB)/libcom_err@PROFILED_LIB_EXT@
+PROFILED_LIBE2P = $(LIB)/libe2p@PROFILED_LIB_EXT@
+PROFILED_LIBEXT2FS = $(LIB)/libext2fs@PROFILED_LIB_EXT@
+
+#
 # Use these definitions is you use tools 2.x, x < 16
 #
 #DLL_BIN=/usr/dll/bin
@@ -60,6 +79,11 @@
 LINUX_INCLUDE=@LINUX_INCLUDE@
 
 #
+# A fast substitution command for fixing up man pages, shell scripts, etc.
+#
+SUBSTITUTE= $(top_builddir)/lib/substitute_sh
+
+#
 # Warning flags
 #
 # Uncomment WFLAGS if you want really anal GCC warning messages
diff --git a/Makefile.in b/Makefile.in
index 15fd1ae..bcdae22 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -10,10 +10,12 @@
 PROG_SUBDIRS=e2fsck debugfs misc
 SUBDIRS=$(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
 
-all:: libs progs check
+SUBS= include/linux/types.h
 
-progs: all-progs-recursive
-libs: all-libs-recursive
+all:: $(SUBS) libs progs check
+
+progs: $(SUBS) all-progs-recursive
+libs: $(SUBS) all-libs-recursive
 
 install: all-libs-recursive install-progs-recursive \
 	install-shlibs-libs-recursive
@@ -44,10 +46,19 @@
 	done
 
 mostlyclean: mostlyclean-recursive mostlyclean-local
+
 clean: clean-recursive clean-local
+	$(RM) -f $(SUBS)
+
 distclean: distclean-recursive distclean-local
+
 realclean: realclean-recursive realclean-local
 
+include/linux/types.h: $(SUBSTITUTE) $(srcdir)/include/linux/types.h.in
+	-chmod +x $(SUBSTITUTE)
+	$(SUBSTITUTE) $(srcdir)/include/linux/types.h.in \
+		include/linux/types.h.in
+
 mostlyclean-local:
 	$(RM) -f \#* *~ core MAKELOG 
 clean-local: mostlyclean-local
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 04e3bb9..470d322 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -1,3 +1,53 @@
+E2fsprogs 1.04 (May 16, 1996)
+=============================
+
+First "official" (1.03 was a limited release only) to support building
+e2fsprogs under Linux 2.0 kernels (as well as late model 1.3 and 1.99
+kernels).
+
+This package includes a RPM specs file, that it can be built using the
+RedHat Package Manager.
+
+E2fsck now prints a hint that if there are lots of incorrectly located
+inode bitmaps, block bitmaps, and inode table blocks, the user might
+want to try using e2fsck -b 8193 first, to see if that fares any
+better.
+
+For ext2 filesystem written with the hurd, debugfs will now print out
+the translator field when printing an inode structure.
+
+Lots of miscellaneous linking/installation cleanups:
+
+  Libraries are now linked using a relative pathname, instead of
+  relying on -L working correct.  It doesn't, in many cases, including
+  current versions of GNU ld.  This guarantees that the build tree is
+  linking with the right libraries, instead of the ones installed in
+  /usr/lib.
+
+  Header files, man pages, and the et/ss shell scripts are now
+  generated using a custom substitution script, instead of relying on
+  the configure script.  This prevents needless recompilation of
+  files; in addition, the custom substitution script is much faster.
+
+  e2fsck may now be linked dynamically, by using the
+  --enable-dynamic-e2fsck flag to configure.  This is not recommended,
+  since it increases e2fsck's dependence on other files, but some
+  people need to save disk space, and other critical programs on their
+  systems were being linked dynamically anyway.
+
+  Programs such as fsck which didn't need to be linked against
+  libext2fs (or mke2fs which didn't need to be linked against libe2p)
+  only link against libraries they actually need.  Otherwise, those
+  programs would require the presense of libraries that otherwise
+  could be removed from a rescuse diskette.
+
+  The ss include files are now installed correctly so they can
+  actually be used by another package.
+
+  If the profiling libraries are built, they are now installed on a
+  "make install-libs".
+
+
 E2fsprogs 1.03 (March 27, 1996)
 ===============================
 
diff --git a/configure b/configure
index 3a9d37a..279bb44 100644
--- a/configure
+++ b/configure
@@ -20,17 +20,19 @@
 ac_help="$ac_help
   --with-ldopts=LDOPTS    select linker command line options"
 ac_help="$ac_help
-  --enable-dll-shlibs	select DLL libraries"
+  --enable-dll-shlibs	  select DLL libraries"
 ac_help="$ac_help
-  --enable-elf-shlibs	select ELF shared libraries"
+  --enable-elf-shlibs	  select ELF shared libraries"
 ac_help="$ac_help
-  --enable-bsd-shlibs	select BSD shared libraries"
+  --enable-bsd-shlibs	  select BSD shared libraries"
 ac_help="$ac_help
-  --enable-profile	build profiling libraries"
+  --enable-profile	  build profiling libraries"
 ac_help="$ac_help
-  --enable-checker	build checker libraries"
+  --enable-checker	  build checker libraries"
 ac_help="$ac_help
-  --enable-gcc-wall	enable GCC anal warnings"
+  --enable-gcc-wall	  enable GCC anal warnings"
+ac_help="$ac_help
+  --enable-dynamic-e2fsck build e2fsck dynamically"
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -488,6 +490,9 @@
   CCOPTS=
 fi
 
+LIB_EXT=.a
+STATIC_LIB_EXT=.a
+PROFILE_LIB_EXT=.a
 # Check whether --with-ldopts or --without-ldopts was given.
 withval="$with_ldopts"
 if test -n "$withval"; then
@@ -509,6 +514,7 @@
 	DLL_CMT=
 	MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib
 	BINARY_TYPE=dllbin
+	LIB_EXT=.sa
 	echo "Enabling DLL shared libraries"
 fi
 
@@ -533,6 +539,7 @@
 	ELF_CMT=
 	MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
 	BINARY_TYPE=elfbin
+	LIB_EXT=.so
 	echo "Enabling ELF shared libraries"
 fi
 
@@ -556,6 +563,7 @@
 else
 	BSDLIB_CMT=
 	MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
+	LIB_EXT=.so
 	echo "Enabling BSD shared libraries"
 fi
 
@@ -579,6 +587,7 @@
 else
 	PROFILE_CMT=
 	MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
+	PROFILED_LIB_EXT=_p.a
 	echo "Building profiling libraries"
 fi
 
@@ -614,6 +623,9 @@
 
 
 
+
+
+
 # Check whether --enable-gcc-wall or --disable-gcc-wall was given.
 enableval="$enable_gcc_wall"
 if test -n "$enableval"; then
@@ -633,6 +645,25 @@
 fi
 
 
+# Check whether --enable-dynamic-e2fsck or --disable-dynamic-e2fsck was given.
+enableval="$enable_dynamic_e2fsck"
+if test -n "$enableval"; then
+  if test "$enableval" = "no"
+then
+	E2FSCK_TYPE=static
+	echo "Building e2fsck statically"
+else
+	E2FSCK_TYPE=shared
+	echo "Building e2fsck dynamically"
+fi
+
+else
+  E2FSCK_TYPE=static
+echo "Building e2fsck statically by default"
+
+fi
+
+
 MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
 
 
@@ -1270,7 +1301,7 @@
   ac_cv_c_cross=yes
 else
 cat > conftest.$ac_ext <<EOF
-#line 1274 "configure"
+#line 1305 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
@@ -1301,7 +1332,7 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1305 "configure"
+#line 1336 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
@@ -1315,7 +1346,7 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1319 "configure"
+#line 1350 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
@@ -1348,7 +1379,7 @@
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1352 "configure"
+#line 1383 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
@@ -1381,7 +1412,7 @@
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1385 "configure"
+#line 1416 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -1429,7 +1460,7 @@
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1433 "configure"
+#line 1464 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -1478,7 +1509,7 @@
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1482 "configure"
+#line 1513 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <dirent.h>
@@ -1520,7 +1551,7 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
 cat > conftest.$ac_ext <<EOF
-#line 1524 "configure"
+#line 1555 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1554,7 +1585,7 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
 cat > conftest.$ac_ext <<EOF
-#line 1558 "configure"
+#line 1589 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1588,7 +1619,7 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
 cat > conftest.$ac_ext <<EOF
-#line 1592 "configure"
+#line 1623 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1625,7 +1656,7 @@
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1629 "configure"
+#line 1660 "configure"
 #include "confdefs.h"
 #include <sys/stat.h>
 int main() { return 0; }
@@ -1658,7 +1689,7 @@
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1662 "configure"
+#line 1693 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1708,7 +1739,7 @@
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1712 "configure"
+#line 1743 "configure"
 #include "confdefs.h"
 #include <linux/fs.h>
 EOF
@@ -1752,7 +1783,7 @@
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1756 "configure"
+#line 1787 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 EOF
@@ -1779,7 +1810,7 @@
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1783 "configure"
+#line 1814 "configure"
 #include "confdefs.h"
 #include <linux/ext2_fs.h>
 int main() { return 0; }
@@ -1810,7 +1841,7 @@
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1814 "configure"
+#line 1845 "configure"
 #include "confdefs.h"
 #include <linux/ext2_fs.h>
 #include <sys/ioctl.h>
@@ -1871,6 +1902,8 @@
   DO_TEST_SUITE=check
 fi
 
+DO_SUBSTITUTE_SCRIPT=$srcdir/lib/do_substitute
+
 test -d lib || mkdir lib
 test -d include || mkdir include
 test -d include/linux || mkdir include/linux
@@ -1973,13 +2006,9 @@
 ac_given_srcdir=$srcdir
 ac_given_INSTALL="$INSTALL"
 
-trap 'rm -fr `echo "MCONFIG include/linux/types.h Makefile lib/et/Makefile 
-	lib/et/compile_et.sh lib/ss/Makefile lib/ss/mk_cmds.sh 
-	lib/ext2fs/Makefile lib/e2p/Makefile misc/Makefile 
-	e2fsck/Makefile debugfs/Makefile tests/Makefile lib/ext2fs/ext2_err.et 
-	debugfs/debugfs.8 e2fsck/e2fsck.8 misc/tune2fs.8 misc/lsattr.1
-	misc/chattr.1 misc/badblocks.8 misc/dumpe2fs.8 misc/mke2fs.8
-	misc/fsck.8 misc/mklost+found.8" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "MCONFIG lib/substitute_sh Makefile lib/et/Makefile 
+	lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile misc/Makefile 
+	e2fsck/Makefile debugfs/Makefile tests/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 
 # Protect against being on the right side of a sed subst in config.status. 
 sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g; 
@@ -2018,7 +2047,11 @@
 s%@CHECKER_CMT@%$CHECKER_CMT%g
 /@MAKEFILE_CHECKER@/r $MAKEFILE_CHECKER
 s%@MAKEFILE_CHECKER@%%g
+s%@LIB_EXT@%$LIB_EXT%g
+s%@STATIC_LIB_EXT@%$STATIC_LIB_EXT%g
+s%@PROFILED_LIB_EXT@%$PROFILED_LIB_EXT%g
 s%@W@%$W%g
+s%@E2FSCK_TYPE@%$E2FSCK_TYPE%g
 /@MAKEFILE_LIBRARY@/r $MAKEFILE_LIBRARY
 s%@MAKEFILE_LIBRARY@%%g
 s%@BINARY_TYPE@%$BINARY_TYPE%g
@@ -2056,18 +2089,16 @@
 s%@SS_DIR@%$SS_DIR%g
 s%@ET_DIR@%$ET_DIR%g
 s%@DO_TEST_SUITE@%$DO_TEST_SUITE%g
+/@DO_SUBSTITUTE_SCRIPT@/r $DO_SUBSTITUTE_SCRIPT
+s%@DO_SUBSTITUTE_SCRIPT@%%g
 
 CEOF
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"MCONFIG include/linux/types.h Makefile lib/et/Makefile 
-	lib/et/compile_et.sh lib/ss/Makefile lib/ss/mk_cmds.sh 
-	lib/ext2fs/Makefile lib/e2p/Makefile misc/Makefile 
-	e2fsck/Makefile debugfs/Makefile tests/Makefile lib/ext2fs/ext2_err.et 
-	debugfs/debugfs.8 e2fsck/e2fsck.8 misc/tune2fs.8 misc/lsattr.1
-	misc/chattr.1 misc/badblocks.8 misc/dumpe2fs.8 misc/mke2fs.8
-	misc/fsck.8 misc/mklost+found.8"}
+CONFIG_FILES=\${CONFIG_FILES-"MCONFIG lib/substitute_sh Makefile lib/et/Makefile 
+	lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile misc/Makefile 
+	e2fsck/Makefile debugfs/Makefile tests/Makefile"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
diff --git a/configure.in b/configure.in
index 43d149d..7d134b6 100644
--- a/configure.in
+++ b/configure.in
@@ -73,6 +73,13 @@
 CCOPTS=)dnl
 AC_SUBST(CCOPTS)
 dnl
+dnl Set default values for library extentions.  Will be dealt with after
+dnl parsing configuration opions, which may modify these
+dnl
+LIB_EXT=.a
+STATIC_LIB_EXT=.a
+PROFILE_LIB_EXT=.a
+dnl
 dnl set $(LDFLAGS) from --with-ldopts=value
 dnl
 AC_ARG_WITH([ldopts],
@@ -85,7 +92,7 @@
 dnl handle --enable-dll-shlibs
 dnl
 AC_ARG_ENABLE([dll-shlibs],
-[  --enable-dll-shlibs	select DLL libraries],
+[  --enable-dll-shlibs	  select DLL libraries],
 if test "$enableval" = "no"
 then
 	DLL_CMT=#
@@ -95,6 +102,7 @@
 	DLL_CMT=
 	MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib
 	BINARY_TYPE=dllbin
+	LIB_EXT=.sa
 	echo "Enabling DLL shared libraries"
 fi
 ,
@@ -108,7 +116,7 @@
 dnl handle --enable-elf-shlibs
 dnl
 AC_ARG_ENABLE([elf-shlibs],
-[  --enable-elf-shlibs	select ELF shared libraries],
+[  --enable-elf-shlibs	  select ELF shared libraries],
 if test "$enableval" = "no"
 then
 	ELF_CMT=#
@@ -118,6 +126,7 @@
 	ELF_CMT=
 	MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
 	BINARY_TYPE=elfbin
+	LIB_EXT=.so
 	echo "Enabling ELF shared libraries"
 fi
 ,
@@ -131,7 +140,7 @@
 dnl handle --enable-bsd-shlibs
 dnl
 AC_ARG_ENABLE([bsd-shlibs],
-[  --enable-bsd-shlibs	select BSD shared libraries],
+[  --enable-bsd-shlibs	  select BSD shared libraries],
 if test "$enableval" = "no"
 then
 	BSDLIB_CMT=#
@@ -140,6 +149,7 @@
 else
 	BSDLIB_CMT=
 	MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
+	LIB_EXT=.so
 	echo "Enabling BSD shared libraries"
 fi
 ,
@@ -153,7 +163,7 @@
 dnl handle --enable-profile
 dnl
 AC_ARG_ENABLE([profile],
-[  --enable-profile	build profiling libraries],
+[  --enable-profile	  build profiling libraries],
 if test "$enableval" = "no"
 then
 	PROFILE_CMT=#
@@ -162,6 +172,7 @@
 else
 	PROFILE_CMT=
 	MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
+	PROFILED_LIB_EXT=_p.a
 	echo "Building profiling libraries"
 fi
 ,
@@ -175,7 +186,7 @@
 dnl handle --enable-checker
 dnl
 AC_ARG_ENABLE([checker],
-[  --enable-checker	build checker libraries],
+[  --enable-checker	  build checker libraries],
 if test "$enableval" = "no"
 then
 	CHECKER_CMT=#
@@ -194,10 +205,16 @@
 AC_SUBST(CHECKER_CMT)
 AC_SUBST_FILE(MAKEFILE_CHECKER)
 dnl
+dnl Substitute library extensions
+dnl
+AC_SUBST(LIB_EXT)
+AC_SUBST(STATIC_LIB_EXT)
+AC_SUBST(PROFILED_LIB_EXT)
+dnl
 dnl handle --enable-gcc-wall
 dnl
 AC_ARG_ENABLE([gcc-wall],
-[  --enable-gcc-wall	enable GCC anal warnings],
+[  --enable-gcc-wall	  enable GCC anal warnings],
 if test "$enableval" = "no"
 then
 	W=#
@@ -211,6 +228,21 @@
 echo "Disabling GCC warnings by default"
 )
 AC_SUBST(W)
+AC_ARG_ENABLE([dynamic-e2fsck],
+[  --enable-dynamic-e2fsck build e2fsck dynamically],
+if test "$enableval" = "no"
+then
+	E2FSCK_TYPE=static
+	echo "Building e2fsck statically"
+else
+	E2FSCK_TYPE=shared
+	echo "Building e2fsck dynamically"
+fi
+,
+E2FSCK_TYPE=static
+echo "Building e2fsck statically by default"
+)
+AC_SUBST(E2FSCK_TYPE)
 dnl
 dnl
 MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
@@ -393,16 +425,17 @@
 fi
 AC_SUBST(DO_TEST_SUITE)
 dnl
+dnl
+dnl
+DO_SUBSTITUTE_SCRIPT=$srcdir/lib/do_substitute
+AC_SUBST_FILE(DO_SUBSTITUTE_SCRIPT)
+dnl
 dnl Make our output files, being sure that we create the some miscellaneous 
 dnl directories
 dnl
 test -d lib || mkdir lib
 test -d include || mkdir include
 test -d include/linux || mkdir include/linux
-AC_OUTPUT(MCONFIG include/linux/types.h Makefile lib/et/Makefile 
-	lib/et/compile_et.sh lib/ss/Makefile lib/ss/mk_cmds.sh 
-	lib/ext2fs/Makefile lib/e2p/Makefile misc/Makefile 
-	e2fsck/Makefile debugfs/Makefile tests/Makefile lib/ext2fs/ext2_err.et 
-	debugfs/debugfs.8 e2fsck/e2fsck.8 misc/tune2fs.8 misc/lsattr.1
-	misc/chattr.1 misc/badblocks.8 misc/dumpe2fs.8 misc/mke2fs.8
-	misc/fsck.8 misc/mklost+found.8)
+AC_OUTPUT(MCONFIG lib/substitute_sh Makefile lib/et/Makefile 
+	lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile misc/Makefile 
+	e2fsck/Makefile debugfs/Makefile tests/Makefile)
diff --git a/e2fsprogs-1.04.spec b/e2fsprogs-1.04.spec
new file mode 100644
index 0000000..bdbd3a5
--- /dev/null
+++ b/e2fsprogs-1.04.spec
@@ -0,0 +1,92 @@
+Description: Tools for the second extended (ext2) filesystem 
+Name: e2fsprogs
+Version: 1.04
+Release: 0
+Copyright: GPL
+Group: Utilities/System
+Source: tsx-11.mit.edu:/pub/linux/packages/ext2fs/e2fsprogs-1.04.tar.gz
+
+%package devel
+Description: e2fs static libs and headers
+Group: Development/Libraries
+
+%prep
+%setup
+
+%build
+
+%ifarch i386
+CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-profile --enable-elf-shlibs
+%endif
+
+%ifarch axp
+CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-profile
+%endif
+
+#make 
+make libs progs
+
+%install
+rm -rf /usr/include/ss /usr/include/et /usr/include/ext2fs
+export PATH=/sbin:$PATH
+make install
+make install-libs
+
+mv /usr/sbin/debugfs /sbin/debugfs
+
+%ifarch i386
+%post
+/sbin/ldconfig
+%endif
+
+%files
+/sbin/e2fsck
+/sbin/fsck.ext2
+/usr/man/man8/e2fsck.8
+/sbin/debugfs
+/usr/man/man8/debugfs.8
+/sbin/mke2fs
+/sbin/badblocks
+/sbin/tune2fs
+/sbin/dumpe2fs
+/sbin/fsck
+/usr/sbin/mklost+found
+/sbin/mkfs.ext2
+
+%ifarch i386
+/lib/libe2p.so.2.1
+/lib/libext2fs.so.2.0
+/lib/libss.so.2.0
+/lib/libcom_err.so.2.0
+%endif
+
+/usr/bin/chattr
+/usr/bin/lsattr
+/usr/man/man8/tune2fs.8
+/usr/man/man8/mklost+found.8
+/usr/man/man8/mke2fs.8
+/usr/man/man8/dumpe2fs.8
+/usr/man/man8/badblocks.8
+/usr/man/man8/fsck.8
+/usr/man/man1/chattr.1
+/usr/man/man1/lsattr.1
+
+%files devel
+/usr/lib/libe2p.a
+/usr/lib/libext2fs.a
+/usr/lib/libss.a
+/usr/lib/libcom_err.a
+/usr/lib/libe2p_p.a
+/usr/lib/libext2fs_p.a
+/usr/lib/libss_p.a
+/usr/lib/libcom_err_p.a
+/usr/include/ss
+/usr/include/ext2fs
+/usr/include/et
+
+%ifarch i386
+/lib/libe2p.so
+/lib/libext2fs.so
+/lib/libss.so
+/lib/libcom_err.so
+%endif
diff --git a/version.h b/version.h
index 07c3e08..5e7dd9d 100644
--- a/version.h
+++ b/version.h
@@ -6,6 +6,6 @@
  * under the GNU Public License.
  */
 
-#define E2FSPROGS_VERSION "1.02"
-#define E2FSPROGS_DATE "16-Jan-96"
+#define E2FSPROGS_VERSION "1.04"
+#define E2FSPROGS_DATE "16-May-96"