Here's a quick patch to fix this.

thanks
dan

commit b1f38c34edc679eac03613b6ceb5825deca2e854
Author: Dan Gora <d...@adax.com>
Date:   Wed Apr 24 19:09:54 2013 -0300

    [debian] ipmitool: Fix compilation bug on big endian machines.

    On big endian machines the compilation would fail because BSWAP_32
    was not defined in ipmi_chassis.c and ipmi_pef.c.

    The problem was including bswap.h depended on WORDS_BIGENDIAN which
    comes from <config.h>, however none of the previous header files
    would include config.h, so it remained undefined.

    We now just include the bswap.h unconditionally.

diff --git a/linux/debian/ipmitool/lib/ipmi_chassis.c
b/linux/debian/ipmitool/lib/ipmi_chassis.c
index 9f71d32..aaf3878 100644
--- a/linux/debian/ipmitool/lib/ipmi_chassis.c
+++ b/linux/debian/ipmitool/lib/ipmi_chassis.c
@@ -35,10 +35,7 @@
 #include <stdio.h>
 #include <time.h>

-#if WORDS_BIGENDIAN
-# include <ipmitool/bswap.h>
-#endif
-
+#include <ipmitool/bswap.h>
 #include <ipmitool/helper.h>
 #include <ipmitool/ipmi.h>
 #include <ipmitool/log.h>
diff --git a/linux/debian/ipmitool/lib/ipmi_pef.c
b/linux/debian/ipmitool/lib/ipmi_pef.c
index c0fa00d..154bf40 100644
--- a/linux/debian/ipmitool/lib/ipmi_pef.c
+++ b/linux/debian/ipmitool/lib/ipmi_pef.c
@@ -34,10 +34,7 @@
 #include <math.h>
 #include <time.h>

-#if WORDS_BIGENDIAN
-# include <ipmitool/bswap.h>
-#endif
-
+#include <ipmitool/bswap.h>
 #include <ipmitool/helper.h>
 #include <ipmitool/log.h>
 #include <ipmitool/ipmi.h>



On Wed, Apr 24, 2013 at 6:04 PM, Dan Gora <d...@adax.com> wrote:
> Hi Zdenek,
>
> It turns out that this bug is not a duplicate after all.. The TOB of
> the CVS tree as of today still has the same compilation failure on big
> endian machines.
>
> The problem is the include files in ipmi_pef.c and ipmi_chassis.c
>
> #include <string.h>
> #include <math.h>
> #include <time.h>
>
> #if WORDS_BIGENDIAN
> # include <ipmitool/bswap.h>
> #endif
>
> #include <ipmitool/helper.h>
> #include <ipmitool/log.h>
> #include <ipmitool/ipmi.h>
> #include <ipmitool/ipmi_intf.h>
> #include <ipmitool/ipmi_pef.h>
>
>
> In this case, bswap.h doesn't get included because there are no other
> header files before it which include <config.h>, so WORDS_BIGENDIAN is
> not defined until ipmi.h is included.
>
> The easiest solution is just to remove the #if WORDS_BIGENDIAN from
> around the #include <ipmitool/bswap.h>.
>
> thanks
> dan
>
>
> On Thu, Apr 4, 2013 at 4:14 PM, Zdenek Styblik <zdenek.styb...@gmail.com> 
> wrote:
>> On Thu, Apr 4, 2013 at 7:21 PM, Dan Gora <d...@adax.com> wrote:
>>> Ok, never mind.. it was.. Sorry about that.. I originally did all the
>>> changes against 1.8.12, then ported them to the tip of the CVS tree.
>>> I didn't see that this was already fixed.
>>>
>>> thanks
>>> dan
>>>
>>
>> No worries.
>>
>> Z.
>>
>>>
>>> On Thu, Apr 4, 2013 at 2:19 PM, Dan Gora <d...@adax.com> wrote:
>>>> On Thu, Apr 4, 2013 at 8:57 AM, Zdenek Styblik <zdenek.styb...@gmail.com> 
>>>> wrote:
>>>>> On Fri, Mar 22, 2013 at 1:08 AM, Dan Gora <d...@adax.com> wrote:
>>>>>> The BSWAP_32 macro was added for big endian machines in these files,
>>>>>> but the author forgot to include the necessary header file which
>>>>>> defines it.
>>>>>>
>>>>>> Signed-off-by: Dan Gora <d...@adax.com>
>>>>>
>>>>> This is already fixed.
>>>>>
>>>>
>>>> This was after the 1.8.12 release, right?
>>>>
>>>> thanks
>>>> dan



-- 
Dan Gora
Software Engineer

Adax, Inc.
Av Dona Maria Alves, 1070 Casa 5
Centro
Ubatuba, SP
CEP 11680-000
Brasil

Tel: +55 (12) 3833-1021  (Brazil and outside of US)
    : +1 (510) 859-4801  (Inside of US)
    : dan_gora (Skype)

email: d...@adax.com

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to