PPC, with an obligatory couple of swipes from me.
bb_inode.c newdir.c alloc_sb.c lookup.c dirblock.c expanddir.c \
dir_iterate.c link.c res_gdt.c icount.c get_pathname.c dblist.c \
dirhash.c version.c flushb.c unlink.c check_desc.c valid_blk.c \
- ext_attr.c bmap.c dblist_dir.c ext2fs_inline.c
+ ext_attr.c bmap.c dblist_dir.c ext2fs_inline.c swapfs.c
EXT2FS_SRCS := $(patsubst %,ext2fs/%, $(EXT2FS_SRC))
EXT2FS_OBJS := $(patsubst %.c,%.o, $(EXT2FS_SRCS))
#define HAVE_SYS_TYPES_H 1
#define HAVE_UNISTD_H 1
+/* Endianness */
+#if __BYTE_ORDER== __BIG_ENDIAN
+#define ENABLE_SWAPFS 1
+#define WORDS_BIGENDIAN 1
+#endif
+
#endif /* __E2FSBB_H__ */
if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
fatal_error(ctx, 0);
#ifdef ENABLE_SWAPFS
+
+#ifdef WORDS_BIGENDIAN
+#define NATIVE_FLAG EXT2_FLAG_SWAP_BYTES;
+#else
+#define NATIVE_FLAG 0;
+#endif
+
+
if (normalize_swapfs) {
- if ((fs->flags & EXT2_FLAG_SWAP_BYTES) ==
- ext2fs_native_flag()) {
+ if ((fs->flags & EXT2_FLAG_SWAP_BYTES) == NATIVE_FLAG) {
fprintf(stderr, _("%s: Filesystem byte order "
"already normalized.\n"), ctx->device_name);
fatal_error(ctx, 0);
* has been configured or if we're being built on a CPU architecture
* with a non-native byte order.
*/
-#if defined(ENABLE_SWAPFS) || defined(WORDS_BIGENDIAN)
+#if defined(ENABLE_SWAPFS) || defined(WORDS_BIGENDIAN) || __BYTE_ORDER== __BIG_ENDIAN
#define EXT2FS_ENABLE_SWAPFS
#endif
+++ /dev/null
-/*
- * native.c --- returns the ext2_flag for a native byte order
- *
- * Copyright (C) 1996 Theodore Ts'o.
- *
- * %Begin-Header%
- * This file may be redistributed under the terms of the GNU Public
- * License.
- * %End-Header%
- */
-
-#include <stdio.h>
-
-#include "ext2_fs.h"
-#include "ext2fs.h"
-
-int ext2fs_native_flag(void)
-{
-#ifdef WORDS_BIGENDIAN
- return EXT2_FLAG_SWAP_BYTES;
-#else
- return 0;
-#endif
-}
-
-
-