Patch attached.

Excluding the headers using
+if COMPILE_FOR_S390
+S390_HDRS = fdasd.h vtoc.h
+else
+S390_HDRS =
+endif
does not exclude them from the tarball created using 'make dist', and
they are successfully omitted from being installed on non-s390
systems.

I have changed the names, Makefile indentations and autoconf macros as
suggested by Jim.

Lastly, I have conditionally included fdasd.h in
include/parted/linux.h when a s390 system is encoutered, since linux.h
uses the 'struct fdasd_anchor' defined in fdasd.h in such cases.

I have checked these out on non-s390 GNU/Linux and GNU systems, and
hope that I have not broken anything on s390 systems.

Happy hacking,
Debarshi
--
GPG key ID: 63D4A5A7
Key server: pgp.mit.edu
diff -urNp parted/configure.ac parted-build/configure.ac
--- parted/configure.ac	2007-03-14 03:20:44.000000000 +0530
+++ parted-build/configure.ac	2007-03-16 00:18:49.000000000 +0530
@@ -433,6 +433,12 @@ AC_CHECK_HEADER([execinfo.h], [
 	])
 ])
 
+dnl Checks for #defines.
+compile_for_s390=no
+AC_EGREP_CPP([__s390__], , compile_for_s390=yes)
+AC_EGREP_CPP([__s390x__], , compile_for_s390=yes)
+AM_CONDITIONAL([COMPILE_FOR_S390], [test "$compile_for_s390" = yes])
+
 dnl check for "check", unit testing library/header
 PKG_CHECK_MODULES([CHECK], [check >= 0.9.3], have_check=yes, have_check=no)
 if test "$have_check" != "yes"; then
diff -urNp parted/include/parted/linux.h parted-build/include/parted/linux.h
--- parted/include/parted/linux.h	2007-03-14 00:42:37.000000000 +0530
+++ parted-build/include/parted/linux.h	2007-03-16 00:13:31.000000000 +0530
@@ -23,6 +23,10 @@
 #include <parted/parted.h>
 #include <parted/device.h>
 
+#if defined(__s390__) || defined(__s390x__)
+#include <parted/fdasd.h>
+#endif
+
 #define LINUX_SPECIFIC(dev)	((LinuxSpecific*) (dev)->arch_specific)
 
 typedef	struct _LinuxSpecific	LinuxSpecific;
diff -urNp parted/include/parted/Makefile.am parted-build/include/parted/Makefile.am
--- parted/include/parted/Makefile.am	2007-03-14 00:42:37.000000000 +0530
+++ parted-build/include/parted/Makefile.am	2007-03-16 00:19:13.000000000 +0530
@@ -1,4 +1,11 @@
+if COMPILE_FOR_S390
+S390_HDRS = fdasd.h vtoc.h
+else
+S390_HDRS =
+endif
+
 partedincludedir      =	$(includedir)/parted
+
 partedinclude_HEADERS = gnu.h		\
 			linux.h		\
 			constraint.h	\
@@ -11,9 +18,8 @@ partedinclude_HEADERS = gnu.h		\
 			natmath.h	\
 			timer.h		\
 			unit.h		\
-			parted.h    \
-			vtoc.h		\
-			fdasd.h
+			parted.h        \
+			$(S390_HDRS)
 
 noinst_HEADERS	      = crc32.h		\
 			endian.h
diff -urNp parted/libparted/arch/linux.c parted-build/libparted/arch/linux.c
--- parted/libparted/arch/linux.c	2007-03-14 00:42:37.000000000 +0530
+++ parted-build/libparted/arch/linux.c	2007-03-16 00:10:40.000000000 +0530
@@ -65,9 +65,6 @@
 #define HDIO_GETGEO             0x0301  /* get device geometry */
 #define HDIO_GET_IDENTITY       0x030d  /* get IDE identification info */
 
-#include <parted/vtoc.h>
-#include <parted/fdasd.h>
-
 #if defined(O_DIRECT) && (!defined(__s390__) || !defined(__s390x__))
 #define RD_MODE (O_RDONLY | O_DIRECT)
 #define WR_MODE (O_WRONLY | O_DIRECT)
diff -urNp parted/libparted/labels/Makefile.am parted-build/libparted/labels/Makefile.am
--- parted/libparted/labels/Makefile.am	2007-03-14 00:42:37.000000000 +0530
+++ parted-build/libparted/labels/Makefile.am	2007-03-16 00:19:36.000000000 +0530
@@ -3,14 +3,18 @@
 #
 # This file may be modified and/or distributed without restriction.
 
+if COMPILE_FOR_S390
+S390_SRCS = dasd.c fdasd.c vtoc.c
+else
+S390_SRCS =
+endif
+
 partedincludedir      =	-I$(top_srcdir)/include
 noinst_LTLIBRARIES    =	liblabels.la
 
 liblabels_la_SOURCES  = rdb.c		\
 			bsd.c  		\
-			dasd.c		\
-			fdasd.c		\
-			vtoc.c		\
+			$(S390_SRCS)	\
 			efi_crc32.c	\
 			dos.c  		\
 			dvh.h		\
_______________________________________________
parted-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/parted-devel

Reply via email to