Package: brandy
Severity: important
Tags: patch
Hi,
currently your package FTBFS on GNU/kFreeBSD, with the following error:
> gcc -Wall -O2 -g -I/usr/include/SDL src/variables.c -c -o
> src/variables.o
> In file included from src/variables.c:31:
> src/target.h:111:2: error: #error Target operating system for
> interpreter is either missing or not supported
> make[1]: *** [src/variables.o] Error 1
> make[1]: Leaving directory `/build/buildd/brandy-1.20~pre3'
> make: *** [build-stamp] Error 2
Full build logs are available at
<http://experimental.ftbfs.de/build.php?arch=kfreebsd-i386&pkg=brandy>.
Please find attached a patch to add support for GNU/kFreeBSD. Basically,
it uses exactly the same code/defines as other free platforms (e.g.
Linux, NetBSD, FreeBSD, etc.), but isn't really like Linux since there's
an undefined XCASE, so a proper TARGET_* is needed.
Cheers,
--
Cyril Brulebois
--- brandy-1.20~pre3/src/emulate.c 2007-03-07 18:31:47.681738000 +0100
+++ brandy-1.20~pre3/src/emulate.c 2007-03-07 18:32:07.000000000 +0100
@@ -937,7 +937,7 @@
#elif defined(TARGET_NETBSD) | defined(TARGET_LINUX) | defined(TARGET_MACOSX)\
| defined(TARGET_UNIX) | defined(TARGET_FREEBSD) | defined(TARGET_OPENBSD)\
- | defined(TARGET_AMIGA)
+ | defined(TARGET_AMIGA) | defined(TARGET_GNUKFREEBSD)
/*
** emulate_oscli issued the operating system command 'command'.
** 'respfile' is set to NIL if the command output is to displayed
--- brandy-1.20~pre3/src/errors.c 2007-03-07 18:31:47.756616000 +0100
+++ brandy-1.20~pre3/src/errors.c 2007-03-07 18:32:44.000000000 +0100
@@ -103,7 +103,7 @@
(void) signal(SIGSEGV, handle_signal);
error(ERR_ADDRESS);
#if defined(TARGET_LINUX) | defined(TARGET_NETBSD) | defined(TARGET_MACOSX)\
- | defined(TARGET_FREEBSD) |defined(TARGET_OPENBSD)
+ | defined(TARGET_FREEBSD) |defined(TARGET_OPENBSD) | defined(TARGET_GNUKFREEBSD)
case SIGCONT:
(void) signal(SIGCONT, handle_signal);
init_keyboard();
@@ -126,7 +126,7 @@
(void) signal(SIGSEGV, handle_signal);
(void) signal(SIGINT, handle_signal);
#if defined(TARGET_LINUX) | defined(TARGET_NETBSD) | defined(TARGET_MACOSX)\
- | defined(TARGET_FREEBSD) |defined(TARGET_OPENBSD)
+ | defined(TARGET_FREEBSD) |defined(TARGET_OPENBSD) | defined(TARGET_GNUKFREEBSD)
(void) signal(SIGCONT, handle_signal);
#endif
#ifdef TARGET_DJGPP
@@ -146,7 +146,7 @@
(void) signal(SIGSEGV, SIG_DFL);
(void) signal(SIGINT, SIG_DFL);
#if defined(TARGET_LINUX) | defined(TARGET_NETBSD) | defined(TARGET_MACOSX)\
- | defined(TARGET_FREEBSD) |defined(TARGET_OPENBSD)
+ | defined(TARGET_FREEBSD) |defined(TARGET_OPENBSD) | defined(TARGET_GNUKFREEBSD)
(void) signal(SIGCONT, SIG_DFL);
#endif
#ifdef TARGET_DJGPP
--- brandy-1.20~pre3/src/keyboard.c 2007-03-07 18:17:18.937376000 +0100
+++ brandy-1.20~pre3/src/keyboard.c 2007-03-07 18:33:15.000000000 +0100
@@ -160,7 +160,8 @@
#if defined(TARGET_LINUX) | defined(TARGET_NETBSD) | defined(TARGET_MACOSX)\
| defined(TARGET_DJGPP) | defined(TARGET_FREEBSD) | defined(TARGET_OPENBSD)\
- | defined(TARGET_AMIGA) & defined(__GNUC__)
+ | defined(TARGET_AMIGA) & defined(__GNUC__)\
+ | defined(TARGET_GNUKFREEBSD)
#include <sys/time.h>
#include <sys/types.h>
#include <errno.h>
@@ -282,6 +283,8 @@
#define OSVERSION 0xF6
#elif defined(TARGET_AMIGA)
#define OSVERSION 0xF5
+#elif defined(TARGET_GNUKFREEBSD)
+#define OSVERSION 0xF4
#else
#error Target operating system is either not defined or not supported
#endif
@@ -328,7 +331,8 @@
static int fn_string_count; /* Count of characters left in function key string */
#if defined(TARGET_LINUX) | defined(TARGET_NETBSD) | defined(TARGET_MACOSX)\
- | defined(TARGET_FREEBSD) |defined(TARGET_OPENBSD) | defined(TARGET_AMIGA) & defined(__GNUC__)
+ | defined(TARGET_FREEBSD) |defined(TARGET_OPENBSD) | defined(TARGET_AMIGA) & defined(__GNUC__)\
+ | defined(TARGET_GNUKFREEBSD)
static struct termios origtty; /* Copy of original keyboard parameters */
static int32 keyboard; /* File descriptor for keyboard */
@@ -404,7 +408,8 @@
}
#if defined(TARGET_LINUX) | defined(TARGET_NETBSD) | defined(TARGET_MACOSX)\
- | defined(TARGET_FREEBSD) | defined(TARGET_OPENBSD) | defined(TARGET_AMIGA) & defined(__GNUC__)
+ | defined(TARGET_FREEBSD) | defined(TARGET_OPENBSD) | defined(TARGET_AMIGA) & defined(__GNUC__)\
+ | defined(TARGET_GNUKFREEBSD)
/* ----- Linux-, *BSD- and MACOS-specific keyboard input functions ----- */
@@ -1457,7 +1462,8 @@
}
#elif defined(TARGET_LINUX) | defined(TARGET_NETBSD) | defined(TARGET_MACOSX)\
- | defined(TARGET_FREEBSD) | defined(TARGET_OPENBSD) | defined(TARGET_AMIGA) & defined(__GNUC__)
+ | defined(TARGET_FREEBSD) | defined(TARGET_OPENBSD) | defined(TARGET_AMIGA) & defined(__GNUC__)\
+ | defined(TARGET_GNUKFREEBSD)
/*
** 'init_keyboard' initialises the keyboard code. It checks to
--- brandy-1.20~pre3/src/target.h 2007-03-07 18:15:15.414357000 +0100
+++ brandy-1.20~pre3/src/target.h 2007-03-07 18:36:12.000000000 +0100
@@ -81,6 +81,14 @@
#define BRANDY_OS "Linux"
#endif
+/* Same as Linux, but can be treated exactly like it, see the Linux specific
+ * XCASE in src/keyboard.c */
+#if (defined __FreeBSD_kernel__)
+#define TARGET_GNUKFREEBSD
+#define USE_SDL
+#define BRANDY_OS "GNU/kFreeBSD"
+#endif
+
#ifdef DJGPP
#define TARGET_DJGPP
#define BRANDY_OS "DJGPP"
@@ -155,7 +163,7 @@
#define EDITOR_VARIABLE "EDITOR"
#define DEFAULT_EDITOR "edit"
#elif defined(TARGET_LINUX) | defined(TARGET_NETBSD) | defined(TARGET_FREEBSD)\
- | defined(TARGET_OPENBSD)
+ | defined(TARGET_OPENBSD) | defined(TARGET_GNUKFREEBSD)
#define EDITOR_VARIABLE "EDITOR"
#define DEFAULT_EDITOR "vi"
#elif defined(TARGET_MACOSX)
@@ -181,7 +189,7 @@
#define DIR_SEPS "\\/:"
#define DIR_SEP '\\'
#elif defined(TARGET_LINUX) | defined(TARGET_NETBSD) | defined(TARGET_MACOSX)\
- | defined(TARGET_FREEBSD) | defined(TARGET_OPENBSD)
+ | defined(TARGET_FREEBSD) | defined(TARGET_OPENBSD) | defined(TARGET_GNUKFREEBSD)
#define DIR_SEPS "/"
#define DIR_SEP '/'
#elif defined(TARGET_RISCOS)
@@ -197,7 +205,8 @@
#if defined(__arm)
#define MACTYPE 0x600
#elif defined(TARGET_LINUX) | defined(TARGET_NETBSD) | defined(TARGET_MACOSX)\
- | defined(TARGET_FREEBSD) | defined(TARGET_OPENBSD) | defined(TARGET_AMIGA)
+ | defined(TARGET_FREEBSD) | defined(TARGET_OPENBSD) | defined(TARGET_AMIGA)\
+ | defined(TARGET_GNUKFREEBSD)
#define MACTYPE 0x800
#elif defined(TARGET_DJGPP) | defined(TARGET_WIN32) | defined(TARGET_BCC32)
#define MACTYPE 0x2000
--- brandy-1.20~pre3/src/textonly.c 2007-03-07 18:31:47.840533000 +0100
+++ brandy-1.20~pre3/src/textonly.c 2007-03-07 18:33:58.000000000 +0100
@@ -47,7 +47,7 @@
#endif
#if defined(TARGET_LINUX) | defined(TARGET_NETBSD) | defined(TARGET_DJGPP)\
- | defined(TARGET_FREEBSD) | defined(TARGET_OPENBSD)
+ | defined(TARGET_FREEBSD) | defined(TARGET_OPENBSD) | defined(TARGET_GNUKFREEBSD)
#include <sys/ioctl.h>
#include <sys/types.h>
#include <unistd.h>
@@ -1570,7 +1570,7 @@
*/
static void find_screensize(void) {
#if defined(TARGET_LINUX) | defined(TARGET_NETBSD) | defined(TARGET_FREEBSD)\
- | defined(TARGET_OPENBSD)
+ | defined(TARGET_OPENBSD) | defined(TARGET_GNUKFREEBSD)
struct winsize sizes;
int rc;
if (!basicvars.runflags.outredir)