From 94ba8c750604d8d2487841a06cb930dd5f3bb43b Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 2 Mar 2003 02:07:14 -0500 Subject: [PATCH] Changes to create a subset distribution which consists only of the et, ss, uuid, and blkid libraries. The configure script and top-level makefile were changed to support working with a subset distribution. --- ChangeLog | 9 +++++ Makefile.in | 83 +++++++++++++++++++++++++++++++++----- README.subset | 14 +++++++ configure | 29 ++++++------- configure.in | 22 +++++----- lib/blkid/ChangeLog | 7 ++++ lib/blkid/Makefile.in | 2 +- lib/blkid/blkid_types.h.in | 6 +-- lib/uuid/ChangeLog | 5 +++ lib/uuid/Makefile.in | 24 ++++++----- lib/uuid/uuidP.h | 2 +- lib/uuid/uuid_types.h.in | 53 ++++++++++++++++++++++++ 12 files changed, 204 insertions(+), 52 deletions(-) create mode 100644 README.subset create mode 100644 lib/uuid/uuid_types.h.in diff --git a/ChangeLog b/ChangeLog index 5a6bcaf4..f7abf75b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2003-03-02 Theodore Ts'o + + * configure.in, Makefile.in: Ignore missing directories so we can + do a subset distribution. If there are no e2fsprogs + applications, then "make install" will install the + library's development files. "make subset_tar_file" will + create a subset distribution which consists of the + et, ss, uuid, and blkid libraries. + 2003-02-22 Theodore Ts'o * configure.in, configure: Add new configure option diff --git a/Makefile.in b/Makefile.in index 8557b538..edf08053 100644 --- a/Makefile.in +++ b/Makefile.in @@ -15,36 +15,40 @@ LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/ext2fs lib/uuid lib/blkid PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs $(EVMS_DIR) SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests -SUBS= lib/ext2fs/ext2_types.h lib/blkid/blkid_types.h +SUBS= lib/ext2fs/ext2_types.h lib/blkid/blkid_types.h lib/uuid/uuid_types.h TAR=tar -all:: $(SUBS) +all:: $(MAKE) libs $(MAKE) progs $(MAKE) docs -progs: $(SUBS) all-progs-recursive -libs: $(SUBS) all-libs-recursive +subs: + for i in $(SUBS) ; do if test -d `dirname $$i` ; then make $$i ; fi ; done + +progs: subs all-progs-recursive +libs: subs all-libs-recursive docs: - cd doc && $(MAKE) libext2fs.info + -test -d doc && cd doc && $(MAKE) libext2fs.info install-doc-libs: - cd doc && $(MAKE) install-doc-libs + -test -d doc && cd doc && $(MAKE) install-doc-libs uninstall-doc-libs: - cd doc && $(MAKE) uninstall-doc-libs + -test -d doc && cd doc && $(MAKE) uninstall-doc-libs clean-doc: - cd doc && $(MAKE) clean + -test -d doc && cd doc && $(MAKE) clean distclean-doc: - cd doc && $(MAKE) distclean + -test -d doc && cd doc && $(MAKE) distclean -install: $(SUBS) all-libs-recursive install-progs-recursive \ +install: subs all-libs-recursive install-progs-recursive \ install-shlibs-libs-recursive install-doc-libs # export MANPATH=$(DESTDIR)$(mandir); $(srcdir)/install-utils/compile_manpages + if test ! -d e2fsck -a ! -d debugfs -a ! -d misc -a ! -d ext2ed ; then $(MAKE) install-libs ; fi uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs @@ -99,6 +103,10 @@ lib/blkid/blkid_types.h: $(DEP_SUBSTITUTE) $(srcdir)/lib/blkid/blkid_types.h.in $(SUBSTITUTE) $(srcdir)/lib/blkid/blkid_types.h.in \ > lib/blkid/blkid_types.h +lib/uuid/uuid_types.h: $(DEP_SUBSTITUTE) $(srcdir)/lib/uuid/uuid_types.h.in + $(SUBSTITUTE) $(srcdir)/lib/uuid/uuid_types.h.in \ + > lib/uuid/uuid_types.h + mostlyclean-local: $(RM) -f \#* *~ *.orig core MAKELOG @@ -112,7 +120,7 @@ distclean-local: clean-local realclean-local: distclean-local $(RM) -f configure -check:: $(SUBS) check-recursive +check:: subs check-recursive distribution_tar_file: $(RM) -rf /tmp/dest @@ -126,6 +134,9 @@ distribution_tar_file: SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \ -e 's/pre-//' -e 's/-PLUS//'` +SSROOT = `echo e2fsprogs-libs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \ + -e 's/pre-//' -e 's/-PLUS//'` + $(srcdir)/.exclude-file: a=$(SRCROOT); \ (cd $(srcdir)/.. && find e2fsprogs \( -name \*~ -o -name \*.orig \ @@ -134,6 +145,7 @@ $(srcdir)/.exclude-file: -o -name changed-files -o -name .#\* \) \ -print) | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-file echo "$(SRCROOT)/BitKeeper" >> $(srcdir)/.exclude-file + echo "$(SRCROOT)/README.subset" >> $(srcdir)/.exclude-file echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file echo "$(SRCROOT)/TODO" >> $(srcdir)/.exclude-file @@ -144,9 +156,58 @@ $(srcdir)/.exclude-file: echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \ >> $(srcdir)/.exclude-file +$(srcdir)/.exclude-subset: + a=$(SSROOT); \ + (cd $(srcdir)/.. && find e2fsprogs \( -name \*~ -o -name \*.orig \ + -o -name CVS -o -name \*.rej -o -name Makefile.pq \ + -o -name TAGS -o -name \*.old -o -name \*.gmo -o -name SCCS \ + -o -name changed-files -o -name .#\* \) \ + -print) | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-subset + echo "$(SSROOT)/BitKeeper" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/build" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/rpm.log" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/TODO" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/powerquest" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/.exclude-subset" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/po/stamp-cat-id" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/po/cat-id-tbl.c" >> $(srcdir)/.exclude-subset + echo $(SSROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \ + >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/e2fsck" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/ext2ed" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/debugfs" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/misc" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/tests" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/resize" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/doc" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/contrib" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/po" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/include" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/debian" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/lib/e2p" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/lib/evms" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/lib/ext2fs" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/ABOUT-NLS" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/README" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/INSTALL" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/INSTALL.dllbin" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/INSTALL.elfbin" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/RELEASE-NOTES" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/e2fsprogs.lsm" >> $(srcdir)/.exclude-subset + echo "$(SSROOT)/e2fsprogs.spec" >> $(srcdir)/.exclude-subset + source_tar_file: $(srcdir)/.exclude-file cd $(srcdir)/.. && a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \ $(TAR) -c -h -v -f - \ -X $$a/.exclude-file $$a | \ gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz rm -f $(srcdir)/.exclude-file + +subset_tar_file: $(srcdir)/.exclude-subset + cd $(srcdir)/.. && a=$(SSROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \ + $(TAR) -c -h -v -f - \ + -X $$a/.exclude-subset $$a | \ + gzip -9 > e2fsprogs-libs-@E2FSPROGS_VERSION@.tar.gz + rm -f $(srcdir)/.exclude-file $(srcdir)/.exclude-subset + + diff --git a/README.subset b/README.subset new file mode 100644 index 00000000..3333c62a --- /dev/null +++ b/README.subset @@ -0,0 +1,14 @@ +This distribution contains a subset of the e2fsprogs package; it +contains the base libraries which may be used by other +non-ext2-releated applications. + +This may be is useful for non-Linux operating systems that need these +libraries GNOME, but who do not need the ext2/ext3 filesystem utilities. + +The full e2fsprogs distributions can be found at the e2fsprogs web +page, which is: + + http://e2fsprogs.sourceforge.net + +In case of bugs in these libraries, please contact Ted Ts'o at +tytso@thunk.org or tytso@alum.mit.edu. diff --git a/configure b/configure index e155ef60..3a866420 100644 --- a/configure +++ b/configure @@ -4930,10 +4930,17 @@ test -d lib || mkdir lib test -d include || mkdir include test -d include/linux || mkdir include/linux test -d include/asm || mkdir include/asm -rmakefile= -if test -d ${srcdir}/resize ; then - rmakefile=resize/Makefile -fi +for i in MCONFIG Makefile util/Makefile util/subst.conf lib/et/Makefile \ + lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile \ + lib/uuid/Makefile lib/uuid/uuid_types.h \ + lib/blkid/Makefile lib/blkid/blkid_types.h \ + lib/evms/Makefile misc/Makefile ext2ed/Makefile e2fsck/Makefile \ + debugfs/Makefile tests/Makefile tests/progs/Makefile \ + resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do + if test -d `dirname ${srcdir}/$i` ; then + outlist="$outlist $i" + fi +done trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -5047,12 +5054,7 @@ done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" -trap 'rm -fr `echo "MCONFIG Makefile util/Makefile util/subst.conf lib/et/Makefile - lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile lib/uuid/Makefile - lib/blkid/Makefile lib/blkid/blkid_types.h lib/evms/Makefile - misc/Makefile ext2ed/Makefile e2fsck/Makefile debugfs/Makefile \ - tests/Makefile tests/progs/Makefile $rmakefile doc/Makefile - intl/Makefile po/Makefile.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "$outlist" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $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 6428e031..5ca3ad15 100644 --- a/configure.in +++ b/configure.in @@ -745,13 +745,15 @@ test -d lib || mkdir lib test -d include || mkdir include test -d include/linux || mkdir include/linux test -d include/asm || mkdir include/asm -rmakefile= -if test -d ${srcdir}/resize ; then - rmakefile=resize/Makefile -fi -AC_OUTPUT(MCONFIG Makefile util/Makefile util/subst.conf lib/et/Makefile - lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile lib/uuid/Makefile - lib/blkid/Makefile lib/blkid/blkid_types.h lib/evms/Makefile - misc/Makefile ext2ed/Makefile e2fsck/Makefile debugfs/Makefile \ - tests/Makefile tests/progs/Makefile $rmakefile doc/Makefile - intl/Makefile po/Makefile.in) +for i in MCONFIG Makefile util/Makefile util/subst.conf lib/et/Makefile \ + lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile \ + lib/uuid/Makefile lib/uuid/uuid_types.h \ + lib/blkid/Makefile lib/blkid/blkid_types.h \ + lib/evms/Makefile misc/Makefile ext2ed/Makefile e2fsck/Makefile \ + debugfs/Makefile tests/Makefile tests/progs/Makefile \ + resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do + if test -d `dirname ${srcdir}/$i` ; then + outlist="$outlist $i" + fi +done +AC_OUTPUT($outlist) diff --git a/lib/blkid/ChangeLog b/lib/blkid/ChangeLog index ebbccabe..88963e30 100644 --- a/lib/blkid/ChangeLog +++ b/lib/blkid/ChangeLog @@ -1,3 +1,10 @@ +2003-03-02 Theodore Ts'o + + * Makefile.in: Don't install list.h, since it's not used by the + public blkid.h file. + + * blkid_types.h.in: Change #ifndef protection to use _BLKID_TYPES_H + 2003-03-01 Theodore Ts'o * tag.c (blkid_set_tag): Fix bug; don't return an error when diff --git a/lib/blkid/Makefile.in b/lib/blkid/Makefile.in index 5f48adcb..58bc8331 100644 --- a/lib/blkid/Makefile.in +++ b/lib/blkid/Makefile.in @@ -25,7 +25,7 @@ SRCS= $(srcdir)/cache.c $(srcdir)/dev.c $(srcdir)/devname.c $(srcdir)/devno.c \ $(srcdir)/getsize.c $(srcdir)/llseek.c $(srcdir)/probe.c \ $(srcdir)/read.c $(srcdir)/resolve.c $(srcdir)/save.c $(srcdir)/tag.c -HFILES= blkid.h list.h +HFILES= blkid.h HFILES_IN= blkid_types.h LIBRARY= libblkid diff --git a/lib/blkid/blkid_types.h.in b/lib/blkid/blkid_types.h.in index 38f588f8..1fb4d27a 100644 --- a/lib/blkid/blkid_types.h.in +++ b/lib/blkid/blkid_types.h.in @@ -1,5 +1,5 @@ -#ifndef _EXT2_TYPES_H -#define _EXT2_TYPES_H +#ifndef _BLKID_TYPES_H +#define _BLKID_TYPES_H /* * If linux/types.h is already been included, assume it has defined @@ -50,4 +50,4 @@ typedef unsigned short __u32; #endif /* LINUX_TYPES_H */ -#endif /* EXT2_TYPES_H */ +#endif /* BLKID_TYPES_H */ diff --git a/lib/uuid/ChangeLog b/lib/uuid/ChangeLog index d78f539c..f23bb69a 100644 --- a/lib/uuid/ChangeLog +++ b/lib/uuid/ChangeLog @@ -1,3 +1,8 @@ +2003-03-02 Theodore Ts'o + + * Makefile.in, uuidP.h, uuid_types.h.in: Use uuid_types.h instead + of ext2_types.h + 2002-11-09 Theodore Ts'o * Release of E2fsprogs 1.32 diff --git a/lib/uuid/Makefile.in b/lib/uuid/Makefile.in index 5f2d4234..133b959c 100644 --- a/lib/uuid/Makefile.in +++ b/lib/uuid/Makefile.in @@ -84,6 +84,9 @@ BSDLIB_INSTALL_DIR = $(root_libdir) all:: tst_uuid uuid_time $(SMANPAGES) +$(top_builddir)/lib/uuid/uuid_types.h: $(srcdir)/uuid_types.h.in $(top_builddir)/config.status + cd $(top_builddir); CONFIG_FILES=$(my_dir)/uuid_types.h ./config.status + tst_uuid.o: $(srcdir)/tst_uuid.c $(CC) $(ALL_CFLAGS) -c $(srcdir)/tst_uuid.c -o tst_uuid.o @@ -131,6 +134,7 @@ install:: all installdirs -$(RANLIB) $(DESTDIR)$(libdir)/libuuid.a $(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libuuid.a $(INSTALL_DATA) $(srcdir)/uuid.h $(DESTDIR)$(includedir)/uuid/uuid.h + $(INSTALL_DATA) uuid_types.h $(DESTDIR)$(includedir)/uuid/uuid_types.h for i in $(SMANPAGES); do \ $(RM) -f $(DESTDIR)$(man3dir)/$$i.gz; \ $(INSTALL_DATA) $$i $(DESTDIR)$(man3dir)/$$i; \ @@ -170,22 +174,22 @@ distclean:: clean # the Makefile.in file # clear.o: $(srcdir)/clear.c $(srcdir)/uuidP.h \ - $(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/uuid.h + $(top_builddir)/lib/uuid/uuid_types.h $(srcdir)/uuid.h compare.o: $(srcdir)/compare.c $(srcdir)/uuidP.h \ - $(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/uuid.h + $(top_builddir)/lib/uuid/uuid_types.h $(srcdir)/uuid.h copy.o: $(srcdir)/copy.c $(srcdir)/uuidP.h \ - $(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/uuid.h + $(top_builddir)/lib/uuid/uuid_types.h $(srcdir)/uuid.h gen_uuid.o: $(srcdir)/gen_uuid.c $(srcdir)/uuidP.h \ - $(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/uuid.h + $(top_builddir)/lib/uuid/uuid_types.h $(srcdir)/uuid.h isnull.o: $(srcdir)/isnull.c $(srcdir)/uuidP.h \ - $(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/uuid.h + $(top_builddir)/lib/uuid/uuid_types.h $(srcdir)/uuid.h pack.o: $(srcdir)/pack.c $(srcdir)/uuidP.h \ - $(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/uuid.h + $(top_builddir)/lib/uuid/uuid_types.h $(srcdir)/uuid.h parse.o: $(srcdir)/parse.c $(srcdir)/uuidP.h \ - $(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/uuid.h + $(top_builddir)/lib/uuid/uuid_types.h $(srcdir)/uuid.h unpack.o: $(srcdir)/unpack.c $(srcdir)/uuidP.h \ - $(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/uuid.h + $(top_builddir)/lib/uuid/uuid_types.h $(srcdir)/uuid.h unparse.o: $(srcdir)/unparse.c $(srcdir)/uuidP.h \ - $(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/uuid.h + $(top_builddir)/lib/uuid/uuid_types.h $(srcdir)/uuid.h uuid_time.o: $(srcdir)/uuid_time.c $(srcdir)/uuidP.h \ - $(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/uuid.h + $(top_builddir)/lib/uuid/uuid_types.h $(srcdir)/uuid.h diff --git a/lib/uuid/uuidP.h b/lib/uuid/uuidP.h index 50407c02..2d7e70f1 100644 --- a/lib/uuid/uuidP.h +++ b/lib/uuid/uuidP.h @@ -10,7 +10,7 @@ */ #include -#include +#include #include "uuid.h" diff --git a/lib/uuid/uuid_types.h.in b/lib/uuid/uuid_types.h.in new file mode 100644 index 00000000..250d0434 --- /dev/null +++ b/lib/uuid/uuid_types.h.in @@ -0,0 +1,53 @@ +#ifndef _UUID_TYPES_H +#define _UUID_TYPES_H + +/* + * If linux/types.h is already been included, assume it has defined + * everything we need. (cross fingers) + */ +#ifndef _LINUX_TYPES_H + +typedef unsigned char __u8; +typedef signed char __s8; + +#if (@SIZEOF_INT@ == 8) +typedef int __s64; +typedef unsigned int __u64; +#elif (@SIZEOF_LONG@ == 8) +typedef long __s64; +typedef unsigned long __u64; +#elif (@SIZEOF_LONG_LONG@ == 8) +#if defined(__GNUC__) +typedef __signed__ long long __s64; +#else +typedef signed long long __s64; +#endif +typedef unsigned long long __u64; +#endif + +#if (@SIZEOF_INT@ == 2) +typedef int __s16; +typedef unsigned int __u16; +#elif (@SIZEOF_SHORT@ == 2) +typedef short __s16; +typedef unsigned short __u16; +#else + ?==error: undefined 16 bit type +#endif + +#if (@SIZEOF_INT@ == 4) +typedef int __s32; +typedef unsigned int __u32; +#elif (@SIZEOF_LONG@ == 4) +typedef long __s32; +typedef unsigned long __u32; +#elif (@SIZEOF_SHORT@ == 4) +typedef short __s32; +typedef unsigned short __u32; +#else + ?== error: undefined 32 bit type +#endif + +#endif /* LINUX_TYPES_H */ + +#endif /* UUID_TYPES_H */