[Parted-commits] GNU Parted Official Repository: Changes to 'master'
Debarshi Ray
rishi-guest at alioth.debian.org
Tue May 8 17:34:15 UTC 2007
configure.ac | 9 +++++++++
include/parted/Makefile.am | 9 +++++++--
libparted/labels/Makefile.am | 10 +++++++---
libparted/labels/dasd.c | 5 -----
libparted/labels/fdasd.c | 5 -----
libparted/labels/vtoc.c | 5 -----
6 files changed, 23 insertions(+), 20 deletions(-)
New commits:
commit 2b4fa6af6736ee2526da7f4ae6a173b29c321826
Author: Debarshi Ray <rishi at gnu.org>
Date: Tue May 8 23:05:23 2007 +0530
Preventing compilation of DASD code on GNU Hurd systems through the use of AC_COMPILE_IFELSE and AM_CONDITIONAL, instead of #ifdef.
diff --git a/configure.ac b/configure.ac
index d2253f2..18a30d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -436,6 +436,15 @@ AC_CHECK_HEADER([execinfo.h], [
])
])
+dnl Checks for #defines.
+AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ #if defined __s390__ || defined __s390x__
+ # message s390 defined
+ #endif
+ ]])], [compile_for_s390="no"], [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 --git a/include/parted/Makefile.am b/include/parted/Makefile.am
index 3c9b5e5..dd0e1d4 100644
--- a/include/parted/Makefile.am
+++ b/include/parted/Makefile.am
@@ -1,3 +1,9 @@
+if COMPILE_FOR_S390
+S390_HDRS = fdasd.h vtoc.h
+else
+S390_HDRS =
+endif
+
partedincludedir = $(includedir)/parted
partedinclude_HEADERS = gnu.h \
@@ -13,8 +19,7 @@ partedinclude_HEADERS = gnu.h \
timer.h \
unit.h \
parted.h \
- fdasd.h \
- vtoc.h
+ $(S390_HDRS)
noinst_HEADERS = crc32.h \
endian.h
diff --git a/libparted/labels/Makefile.am b/libparted/labels/Makefile.am
index 5b0aec4..f4d7d14 100644
--- a/libparted/labels/Makefile.am
+++ b/libparted/labels/Makefile.am
@@ -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 \
diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c
index fa7d000..f11bc52 100644
--- a/libparted/labels/dasd.c
+++ b/libparted/labels/dasd.c
@@ -47,9 +47,6 @@
# define _(String) (String)
#endif /* ENABLE_NLS */
-/* S390 */
-#if defined (__s390__) || defined (__s390x__)
-
#define PARTITION_LINUX_SWAP 0x82
#define PARTITION_LINUX 0x83
#define PARTITION_LINUX_EXT 0x85
@@ -865,5 +862,3 @@ error:
ped_constraint_destroy (constraint_any);
return 0;
}
-
-#endif /* S390 */
diff --git a/libparted/labels/fdasd.c b/libparted/labels/fdasd.c
index 6755ee7..198bce2 100644
--- a/libparted/labels/fdasd.c
+++ b/libparted/labels/fdasd.c
@@ -29,9 +29,6 @@
# define _(String) (String)
#endif /* ENABLE_NLS */
-/* S390 */
-#if defined (__s390__) || defined (__s390x__)
-
static int
getpos (fdasd_anchor_t *anc, int dsn)
{
@@ -1051,6 +1048,4 @@ fdasd_add_partition (fdasd_anchor_t *anc, unsigned int start,
return p;
}
-#endif /* S390 */
-
/* vim:set tabstop=4 shiftwidth=4 softtabstop=4: */
diff --git a/libparted/labels/vtoc.c b/libparted/labels/vtoc.c
index 15482c5..bd2c905 100644
--- a/libparted/labels/vtoc.c
+++ b/libparted/labels/vtoc.c
@@ -19,9 +19,6 @@
# define _(String) (String)
#endif /* ENABLE_NLS */
-/* S390 */
-#if defined (__s390__) || defined (__s390x__)
-
static const unsigned char EBCtoASC[256] =
{
/* 0x00 NUL SOH STX ETX *SEL HT *RNL DEL */
@@ -1155,5 +1152,3 @@ vtoc_set_freespace(format4_label_t *f4, format5_label_t *f5,
vtoc_reorganize_FMT5_extents (f5);
}
}
-
-#endif /* S390 */
More information about the Parted-commits
mailing list