From e71d87317ac095fa08079f0cc9040da16952eb93 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 14 Mar 2003 02:13:48 -0500 Subject: [PATCH] Add Apple/Darwin patches. --- ChangeLog | 4 ++++ configure.in | 6 ++++++ e2fsck/ChangeLog | 3 +++ e2fsck/iscan.c | 2 ++ e2fsck/scantest.c | 2 ++ e2fsck/unix.c | 2 ++ lib/ChangeLog | 5 +++++ lib/Makefile.darwin-lib | 46 ++++++++++++++++++++++++++++++++++++++++++++++ lib/ext2fs/ChangeLog | 3 +++ lib/ext2fs/getsize.c | 7 +++++++ lib/uuid/ChangeLog | 4 ++++ lib/uuid/Makefile.in | 1 + misc/ChangeLog | 4 ++++ misc/fsck.c | 2 ++ 14 files changed, 91 insertions(+) create mode 100644 lib/Makefile.darwin-lib diff --git a/ChangeLog b/ChangeLog index 013f10a..606572e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-03-14 Theodore Ts'o + + * configure.in: Add support for Apple/Darwin shared libraries. + 2003-03-06 Theodore Tso * Makefile.in (.exclude-subset): Include the doc directory in the diff --git a/configure.in b/configure.in index 5ca3ad1..4047f49 100644 --- a/configure.in +++ b/configure.in @@ -258,6 +258,12 @@ else BSDLIB_CMT= MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib LIB_EXT=.so + [case "$host_os" in + darwin.*) + MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib + LIB_EXT=.dylib + ;; + esac] echo "Enabling BSD shared libraries" fi , diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index e74a622..b98ba86 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,5 +1,8 @@ 2003-03-14 Theodore Ts'o + * iscan.c, scantest.c, unix.c: And #ifdef protection around + #include of malloc.h + * rehash.c (duplicate_search_and_fix): Now search for duplicates filenames, and either prompt to remove a complete duplicate entry, or to rename a duplicate filename. diff --git a/e2fsck/iscan.c b/e2fsck/iscan.c index 70e9aed..6501e1f 100644 --- a/e2fsck/iscan.c +++ b/e2fsck/iscan.c @@ -19,7 +19,9 @@ #include #endif #include +#ifdef HAVE_MALLOC_H #include +#endif #include "et/com_err.h" #include "e2fsck.h" diff --git a/e2fsck/scantest.c b/e2fsck/scantest.c index e8374d9..9727a9f 100644 --- a/e2fsck/scantest.c +++ b/e2fsck/scantest.c @@ -15,7 +15,9 @@ #include #endif #include +#ifdef HAVE_MALLOC_H #include +#endif #include #include "et/com_err.h" diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 492ba4a..c9d1da2 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -34,7 +34,9 @@ extern int optind; #include #endif #include +#ifdef HAVE_MALLOC_H #include +#endif #include "et/com_err.h" #include "e2fsck.h" diff --git a/lib/ChangeLog b/lib/ChangeLog index a1b1599..cb95c34 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2003-03-14 Theodore Ts'o + + * Makefile.darwin-lib: New file to provide support for e2fsprogs + on Apple Darwin. + 2002-11-09 Theodore Ts'o * Release of E2fsprogs 1.32 diff --git a/lib/Makefile.darwin-lib b/lib/Makefile.darwin-lib new file mode 100644 index 0000000..4bacd27 --- /dev/null +++ b/lib/Makefile.darwin-lib @@ -0,0 +1,46 @@ +# +# This is a Makefile stub which handles the creation of Darwin BSD shared +# libraries. +# +# In order to use this stub, the following makefile variables must be +efined. +# +# BSDLIB_VERSION = 1.0 +# BSDLIB_IMAGE = libce +# BSDLIB_MYDIR = et +# BSDLIB_INSTALL_DIR = $(SHLIBDIR) +# + +all:: pic image + +subdirs:: pic + +pic: + mkdir pic + +BSD_LIB = $(BSDLIB_IMAGE).$(BSDLIB_VERSION).dylib + +image: $(BSD_LIB) + +$(BSD_LIB): $(OBJS) + (cd pic; $(CC) -dynamiclib -compatibility_version 1.0 + -current_version $(BSDLIB_VERSION) \ + -flat_namespace -undefined warning -o $(BSD_LIB) $(OBJS)) + $(MV) pic/$(BSD_LIB) . + $(RM) -f ../$(BSD_LIB) + $(LN) $(BSD_LIB) ../$(BSD_LIB) + $(LN) ../$(BSD_LIB) ../$(BSDLIB_IMAGE).dylib + +install-shlibs install:: $(BSD_LIB) + $(INSTALL_PROGRAM) $(BSD_LIB) \ + $(DESTDIR)$(BSDLIB_INSTALL_DIR)/$(BSD_LIB) + -$(LDCONFIG) + +uninstall-shlibs uninstall:: + $(RM) -f $(DESTDIR)$(BSDLIB_INSTALL_DIR)/$(BSD_LIB) + +clean:: + $(RM) -rf pic + $(RM) -f $(BSD_LIB) + $(RM) -f ../$(BSD_LIB) + $(RM) -f ../$(BSDLIB_IMAGE).dylib diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 5e3b37e..b9c997c 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,5 +1,8 @@ 2003-03-14 Theodore Ts'o + * getsize.c: Add support for Apple Darwin's ioctl to get the hard + disk size. + * badblocks.c (ext2fs_u32_list_count), ext2fs.h: Add new function which returns the number of entries in the list. diff --git a/lib/ext2fs/getsize.c b/lib/ext2fs/getsize.c index e8fadba..5b5c633 100644 --- a/lib/ext2fs/getsize.c +++ b/lib/ext2fs/getsize.c @@ -33,6 +33,13 @@ #define BLKGETSIZE _IO(0x12,96) /* return device size */ #endif +#ifdef APPLE_DARWIN +#include +#include + +#define BLKGETSIZE DKIOCGETBLOCKCOUNT32 +#endif /* APPLE_DARWIN */ + #include "ext2_fs.h" #include "ext2fs.h" diff --git a/lib/uuid/ChangeLog b/lib/uuid/ChangeLog index 2146e25..7a0ec9b 100644 --- a/lib/uuid/ChangeLog +++ b/lib/uuid/ChangeLog @@ -1,3 +1,7 @@ +2003-03-14 Theodore Ts'o + + * Makefile.in: Add support for Apple Darwin + 2003-03-06 Theodore Tso * uuid_types.h.in: Don't redefine types if other e2fsprogs diff --git a/lib/uuid/Makefile.in b/lib/uuid/Makefile.in index c91093c..ed995ce 100644 --- a/lib/uuid/Makefile.in +++ b/lib/uuid/Makefile.in @@ -167,6 +167,7 @@ distclean:: clean # ../../lib/libuuid.a: libuuid.a ../../lib/libuuid.so: image +../../lib/libuuid.dylib: image # +++ Dependency line eater +++ # diff --git a/misc/ChangeLog b/misc/ChangeLog index 248f8cf..4c8ce6e 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,7 @@ +2003-03-14 Theodore Ts'o + + * fsck.c: And #ifdef protection around #include of malloc.h + 2003-03-13 Theodore Ts'o * e2image.c (write_raw_image_file): Include blocks from slow diff --git a/misc/fsck.c b/misc/fsck.c index 86f2406..6408c8e 100644 --- a/misc/fsck.c +++ b/misc/fsck.c @@ -50,7 +50,9 @@ #if HAVE_ERRNO_H #include #endif +#if HAVE_MALLOC_H #include +#endif #include "../version.h" #include "nls-enable.h" -- 1.8.3.1