Module Name:    src
Committed By:   joerg
Date:           Tue Jul 19 18:29:41 UTC 2011

Modified Files:
        src/sbin/newfs_v7fs: main.c
        src/usr.sbin/makefs: v7fs.c
        src/usr.sbin/makefs/v7fs: Makefile.inc

Log Message:
Allow cross-compiling from Linux


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sbin/newfs_v7fs/main.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/makefs/v7fs.c
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/makefs/v7fs/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/newfs_v7fs/main.c
diff -u src/sbin/newfs_v7fs/main.c:1.4 src/sbin/newfs_v7fs/main.c:1.5
--- src/sbin/newfs_v7fs/main.c:1.4	Mon Jul 18 22:50:28 2011
+++ src/sbin/newfs_v7fs/main.c	Tue Jul 19 18:29:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.4 2011/07/18 22:50:28 tron Exp $	*/
+/*	$NetBSD: main.c,v 1.5 2011/07/19 18:29:41 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.4 2011/07/18 22:50:28 tron Exp $");
+__RCSID("$NetBSD: main.c,v 1.5 2011/07/19 18:29:41 joerg Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -193,7 +193,9 @@
 		fs->io.write(fs->io.cookie, buf, i);
 		progress(0);
 	}
+#ifndef HAVE_NBTOOL_CONFIG_H
 	progress_done();
+#endif
 	VPRINTF("\n");
 
 	/* Construct superblock */
@@ -233,7 +235,9 @@
 	blk = sb->freeblock[0];
 	while ((blk = make_freeblocklist(fs, blk, buf)))
 		continue;
+#ifndef HAVE_NBTOOL_CONFIG_H
 	progress_done();
+#endif
 
 	VPRINTF("done.\n");
 

Index: src/usr.sbin/makefs/v7fs.c
diff -u src/usr.sbin/makefs/v7fs.c:1.1 src/usr.sbin/makefs/v7fs.c:1.2
--- src/usr.sbin/makefs/v7fs.c:1.1	Mon Jul 18 08:58:38 2011
+++ src/usr.sbin/makefs/v7fs.c	Tue Jul 19 18:29:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: v7fs.c,v 1.1 2011/07/18 08:58:38 uch Exp $	*/
+/*	$NetBSD: v7fs.c,v 1.2 2011/07/19 18:29:41 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: v7fs.c,v 1.1 2011/07/18 08:58:38 uch Exp $");
+__RCSID("$NetBSD: v7fs.c,v 1.2 2011/07/19 18:29:41 joerg Exp $");
 #endif	/* !__lint */
 
 #include <stdio.h>
@@ -49,10 +49,13 @@
 #include "v7fs_impl.h"
 #include "v7fs_makefs.h"
 #include "newfs_v7fs.h"
-#include "progress.h"
 
 static v7fs_opt_t v7fs_opts;
+
+#ifndef HAVE_NBTOOL_CONFIG_H
+#include "progress.h"
 static bool progress_bar_enable;
+#endif
 bool verbose;
 
 void
@@ -90,11 +93,13 @@
 	int fd, endian, error = 1;
 
 	verbose = debug;
+#ifndef HAVE_NBTOOL_CONFIG_H
 	if ((progress_bar_enable = v7fs_opts.progress)) {
 		progress_switch(progress_bar_enable);
 		progress_init();
 		progress(&(struct progress_arg){ .cdev = image });
 	}
+#endif
 
 	/* Determine filesystem image size */
 	v7fs_estimate(dir, root, fsopts);
@@ -156,6 +161,7 @@
 void
 progress(const struct progress_arg *p)
 {
+#ifndef HAVE_NBTOOL_CONFIG_H
 	static struct progress_arg Progress;
 	static char cdev[32];
 	static char label[32];
@@ -178,4 +184,5 @@
 		Progress.total++;
 		progress_bar(cdev, label, Progress.total, PROGRESS_BAR_GRANULE);
 	}
+#endif
 }

Index: src/usr.sbin/makefs/v7fs/Makefile.inc
diff -u src/usr.sbin/makefs/v7fs/Makefile.inc:1.3 src/usr.sbin/makefs/v7fs/Makefile.inc:1.4
--- src/usr.sbin/makefs/v7fs/Makefile.inc:1.3	Mon Jul 18 21:22:55 2011
+++ src/usr.sbin/makefs/v7fs/Makefile.inc	Tue Jul 19 18:29:41 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.3 2011/07/18 21:22:55 tron Exp $
+#	$NetBSD: Makefile.inc,v 1.4 2011/07/19 18:29:41 joerg Exp $
 #
 
 V7FS=	${NETBSDSRCDIR}/sys/fs/v7fs
@@ -13,6 +13,8 @@
 v7fs_inode_util.c v7fs_datablock.c v7fs_dirent.c v7fs_io.c v7fs_file.c \
 v7fs_file_util.c v7fs_io_user.c
 SRCS += main.c		# newfs
+.if !defined(HOSTPROG)
 SRCS += progress.c	# progress bar (fsck)
+.endif
 
 SRCS += v7fs_estimate.c v7fs_populate.c
\ No newline at end of file

Reply via email to