--- Begin Message ---
Subject: |
PATCH: Re: trouble compiling freeipmi |
Date: |
Tue, 12 Oct 2004 21:13:58 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
,----[ Chris Bailey <address@hidden> ]
| I am having difficulty compiling FreeIPMI on FreeBSD 4.10.
`----
I have no access to a FreeBSD system, but I would love to address the
issues. Try applying this patch, otherwise it may be easier if I get
remote access to your system.
,----[ Chris Bailey <address@hidden> ]
| The first time I tried, error.h was missing when trying to include
| xmalloc.h in libfreeipmi.
|
| Now I get the following error:
|
| In file included from freeipmi.h:65,
| from bit-ops.c:26:
| ipmi-semaphores.h:84: redefinition of 'union semun'
`----
Try this patch.
# cd freeipmi-0.1.0
# patch -p1 < freeipmi-0.1.0-freebsd-port.diff
------8><------8><------ PATCH BEGINS HERE ------8><------8><------
diff -pruN freeipmi/libfreeipmi/src/ipmi-semaphores.h
freeipmi-hacked/libfreeipmi/src/ipmi-semaphores.h
--- freeipmi/libfreeipmi/src/ipmi-semaphores.h 2004-05-05 14:00:19.000000000
-0700
+++ freeipmi-hacked/libfreeipmi/src/ipmi-semaphores.h 2004-10-12
21:04:22.000000000 -0700
@@ -78,16 +78,18 @@ do {
\
} while (0)
#define IPMI_MUTEX_UP(semid) IPMI_MUTEX_UNLOCK (semid)
-
-#ifndef _LINUX_SEM_H
-/* arg for semctl system calls. */
-union semun {
- int val; /* value for SETVAL */
- struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
- unsigned short *array; /* array for GETALL & SETALL */
- struct seminfo *__buf; /* buffer for IPC_INFO */
- void *__pad;
-};
+
+#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
+ /* union semun is defined by including <sys/sem.h> */
+#else
+ /* according to X/OPEN we have to define it ourselves */
+ union semun {
+ int val; /* value for SETVAL */
+ struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
+ unsigned short *array; /* array for GETALL & SETALL */
+ struct seminfo *__buf; /* buffer for IPC_INFO */
+ void *__pad;
+ };
#endif
extern struct sembuf mutex_lock_buf_interruptible;
diff -pruN freeipmi/libfreeipmi/src/xmalloc.h
freeipmi-hacked/libfreeipmi/src/xmalloc.h
--- freeipmi/libfreeipmi/src/xmalloc.h 2004-05-05 14:00:19.000000000 -0700
+++ freeipmi-hacked/libfreeipmi/src/xmalloc.h 2004-10-12 21:04:31.000000000
-0700
@@ -56,8 +56,6 @@ void free ();
# define _(Text) Text
#endif
-#include "error.h"
-
#ifndef EXIT_FAILURE
# define EXIT_FAILURE 1
#endif
@@ -71,14 +69,6 @@ char *ipmi_xstrdup (char *p);
void ipmi_xfree (__VOID *p);
#endif
-
-
-#if __STDC__ && (HAVE_VPRINTF || HAVE_DOPRNT)
-void error (int, int, const char *, ...);
-#else
-void error ();
-#endif
-
#ifdef __cplusplus
}
#endif
------8><------8><------ PATCH ENDS HERE ------8><------8><------
,----[ Chris Bailey <address@hidden> ]
| I am interested in using fish to script sensor monitoring, gathering
| of FRU information from the BMC and chassis control, particularly
| power management.
`----
You can do powerful scripting with Fish. Thats how most of the
utilities are written internally. We will help you automate
your tasks.
--
Anand Babu
Free as in Freedom <www.gnu.org>
--- End Message ---