[parted-devel] Parted on GNU Hurd based systems

Jim Meyering jim at meyering.net
Wed Mar 14 10:13:49 CET 2007


"Debarshi 'Rishi' Ray" <debarshi.ray at gmail.com> wrote:
...

> diff --git a/configure.ac b/configure.ac
> index d00fb15..2db260b 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -433,6 +433,12 @@ AC_CHECK_HEADER([execinfo.h], [
>  	])
>  ])
>
> +dnl Checks for #defines.
> +have_s390=no
> +AC_CHECK_FUNC([__s390__], have_s390=yes, )
> +AC_CHECK_FUNC([__s390x__], have_s390=yes, )

__s390__ isn't really a *function*, is it?
Everywhere else, it's used like a cpp symbol.
If so, you need a different test (and different variable name):

  AC_EGREP_CPP([__s390__],, compile_for_s390=yes)
  AC_EGREP_CPP([__s390x__],, compile_for_s390=yes)

Hmm... now that I look at linux.h,

struct _LinuxSpecific {
	int	fd;
#if defined(__s390__) || defined(__s390x__)
	unsigned int real_sector_size;
	/* IBM internal dasd structure (i guess ;), required. */
	struct fdasd_anchor *anchor;
#endif
};

a *proper* autoconf-style test would not check for __s390__,
but rather for the existence of "struct fdasd_anchor" in whatever
header defines it.  Then the #if above would be

  #if HAVE_STRUCT_FDASD_ANCHOR

But you needn't do that.

> +AM_CONDITIONAL([HAVE_S390], [test "$have_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 13df6c0..79e08cb 100644
> --- a/include/parted/Makefile.am
> +++ b/include/parted/Makefile.am
> @@ -1,4 +1,13 @@
> +if HAVE_S390
> +S390_HEADERS = fdasd.h vtoc.h
> +else
> +S390_HEADERS =
> +endif

Unless you have a good reason to exclude headers here, please don't.
Listing them here should be ok, even when not used.

>  partedincludedir      =	$(includedir)/parted
> +# Dummy-- to prevent error: "S390dir not defined".
> +S390dir               = $(partedincludedir)

Why is the above necessary?
I don't see any other use of that symbol.

>  partedinclude_HEADERS = gnu.h		\
>  			linux.h		\
>  			constraint.h	\
> @@ -11,9 +20,8 @@ partedinclude_HEADERS = gnu.h		\
>  			natmath.h	\
>  			timer.h		\
>  			unit.h		\
> -			parted.h    \
> -			vtoc.h		\
> -			fdasd.h
> +			parted.h        \
> +                        $(S390_HEADERS)

Inconsistent indentation.
In Makefiles, always indent with TAB.

>
>  noinst_HEADERS	      = crc32.h		\
>  			endian.h
> diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
> index 312cc8c..75d029e 100644
> --- a/libparted/arch/linux.c
> +++ b/libparted/arch/linux.c
> @@ -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 --git a/libparted/labels/Makefile.am b/libparted/labels/Makefile.am
> index 5b0aec4..437f163 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 HAVE_S390
> +S390_SOURCES = dasd.c fdasd.c vtoc.c
> +else
> +S390_SOURCES =
> +endif
> +
>  partedincludedir      =	-I$(top_srcdir)/include
>  noinst_LTLIBRARIES    =	liblabels.la
>
>  liblabels_la_SOURCES  = rdb.c		\
>  			bsd.c  		\
> -			dasd.c		\
> -			fdasd.c		\
> -			vtoc.c		\
> +			$(S390_SOURCES)	\
>  			efi_crc32.c	\
>  			dos.c  		\
>  			dvh.h		\
> _______________________________________________
> parted-devel mailing list
> parted-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/parted-devel



More information about the parted-devel mailing list