[parted-devel] A few queries.

Debarshi 'Rishi' Ray debarshi.ray at gmail.com
Tue Mar 20 09:30:41 CET 2007


> commit c1b00586c9296e03d2445de20a3d44c1c949979e
> Author: David Cantrell <dcantrell at redhat.com>
> Date:   Mon Mar 19 14:01:46 2007 -0400
>
>   Conditionalize the System Z stuff correctly.  We get headers installed on non-System Z
> platforms, but the code only compiles on that platform.

If 'uname -m' is a better option than checking for __s390__ (as
suggested by the following patch), then why revert to using __s390__?

Is there any reason to install the headers on non-DASD systems also. I
recall that you were against installing them to preserve consistency.
Since the DASD specific code would not be compiled into the library,
would it not mislead the user if the headers are present? I am
curious. :-)

> commit 5167881e1f44c1bd4ccf4ed15daeeaa7af75558d
> Author: David Cantrell <dcantrell at redhat.com>
> Date:   Mon Mar 19 11:20:55 2007 -0400
>
>    Remove the COMPILE_FOR_S390 flag-setting stuff.  It wasn't correct anyway.  Take a
> kernel-style approach and check uname -m to see if we are on s390.  If so, we build for
> zSeries.  Otherwise we do not.

I find that we have gone back to using #ifdef...#endif blocks to
conditionally compile the DASD specific files. Why I say back is
because this looks like a regression since the preferred way seems to
be to use AM_CONDITIONAL. The rationale is stated in this "Best
practices with autotools" article:
http://programming.linux.com/article.pl?sid=05/08/11/1923248&tid=22 as
follows:

"Many projects, to avoid compiling code for specific code paths, add
the entire files in #ifdef ... #endif preprocessor conditionals. While
this usually works, it makes the code ugly and error-prone, as a
single statement out of the conditional block can be compiled where
the source file is not needed. It also misleads users sometimes, as
the source files seem to be compiled in situations where they don't
make sense."

If 'uname -m' is a better way to do it than checking for the __s390__
macro, then can't we have a 'uname -m' based test using Autotools
itself?

Happy hacking,
Debarshi
-- 
GPG key ID: 63D4A5A7
Key server: pgp.mit.edu



More information about the parted-devel mailing list