[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-acct] [PATCH] FTBFS: GNU/kFreeBSD and FreeBSD.
From: |
Mats Erik Andersson |
Subject: |
[Bug-acct] [PATCH] FTBFS: GNU/kFreeBSD and FreeBSD. |
Date: |
Tue, 19 Oct 2010 23:10:32 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Hello there,
you have clearly not observed that the present CVS content for
Acct triggers an FTBFS (Fail to build from source) in Debian-lingo.
In fact, Acct can not even be configured in GNU/kFreeBSD!
The present patch solves this for
FreeBSD 8.0 and
GNU/kFreeBSD 8.1.
Judging from the changes I had to make, Acct ought not have
been compileable for FreeBSD, all the way back to 7.0. The
problem is that "struct acct" has been made obsolete by
"struct acctv2", and that the test in "files.h.in" for this
situation depends on __FreeBSD_version, which in turn is
available only after reading <osreldate.h>.
Best regards,
Mats Erik Andersson, fil. dr
<address@hidden>
2459 41E9 C420 3F6D F68B 2E88 F768 4541 F25B 5D41
_____________________________________________________________
diff -Naur acct.cvs/accton.c acct/accton.c
--- acct.cvs/accton.c 2010-02-12 02:21:33.000000000 +0100
+++ acct/accton.c 2010-10-19 21:07:27.000000000 +0200
@@ -37,6 +37,11 @@
#include "common.h"
#include "files.h"
+#if defined __FreeBSD__ || defined __FreeBSD_kernel__
+/* Eliminate macro from "files.h". */
+# undef acct
+#endif
+
#ifdef HAVE_GETOPT_LONG_ONLY
#include <getopt.h>
#else
diff -Naur acct.cvs/configure.ac acct/configure.ac
--- acct.cvs/configure.ac 2010-09-01 03:32:27.000000000 +0200
+++ acct/configure.ac 2010-10-19 21:07:27.000000000 +0200
@@ -166,11 +166,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
+#include <stdint.h> /* GNU/kFreeBSD */
#include <sys/acct.h>
#include <utmp.h>
#ifndef WTMP_FILE
-# if defined(__FreeBSD__) || defined (__NetBSD__) || defined(__linux__)
+# if defined(__FreeBSD__) || defined (__NetBSD__) || defined(__linux__) \
+ || defined(__FreeBSD_kernel__)
# define WTMP_FILE "/var/log/wtmp"
# else
# if defined(sun) || defined(AMIX)
@@ -186,7 +188,8 @@
#endif
#ifndef ACCT_FILE
-# if defined(__FreeBSD__) || defined(__linux__)
+# if defined(__FreeBSD__) || defined(__linux__) \
+ || defined(__FreeBSD_kernel__)
# define ACCT_FILE "/var/account/pacct"
# else
# if defined(__NetBSD__)
@@ -206,7 +209,8 @@
#endif
#ifndef SAVACCT_FILE
-# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__)
+# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__) \
+ || defined(__FreeBSD_kernel__)
# define SAVACCT_FILE "/var/account/savacct"
# else
# if defined(sun) || defined(AMIX)
@@ -222,7 +226,8 @@
#endif
#ifndef USRACCT_FILE
-# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__)
+# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__) \
+ || defined(__FreeBSD_kernel__)
# define USRACCT_FILE "/var/account/usracct"
# else
# if defined(sun) || defined(AMIX)
diff -Naur acct.cvs/files.h.in acct/files.h.in
--- acct.cvs/files.h.in 2010-02-12 19:06:31.000000000 +0100
+++ acct/files.h.in 2010-10-19 21:21:49.000000000 +0200
@@ -14,13 +14,19 @@
#ifdef LINUX_MULTIFORMAT
# include "linux-acct.h"
#else
+# include <stdint.h> /* GNU/kFreeBSD */
# include <sys/acct.h>
-#ifdef __FreeBSD__
-# if __FreeBSD_version >= 700100 /* FreeBSD 7.0-STABLE */
-# define acct acctv2
+# if defined __FreeBSD__ || defined __FreeBSD_kernel__
+# include <osreldate.h>
+# if __FreeBSD_kernel__
+# define __FreeBSD_version __FreeBSD_kernel_version
+# endif /* __FreeBSD_kernel__ */
+# if __FreeBSD_version >= 700100 /* FreeBSD 7.0-STABLE */
+# define acct acctv2
+# define ac_flag ac_flagx
+# endif
# endif
#endif
-#endif
#include <utmp.h>
signature.asc
Description: Digital signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-acct] [PATCH] FTBFS: GNU/kFreeBSD and FreeBSD.,
Mats Erik Andersson <=