Here are two patches to make ratpoison compile with older
compilers.
The first one fixes an actual bug in putting libraries in library
flags instead of libraries:
Subject: [PATCH] move libraries from LDFLAGS to LDADD to avoid
problems in argument order
diff --git a/src/Makefile.am b/src/Makefile.am
index 715c47b..b4ce142 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,7 +22,8 @@
bin_PROGRAMS = ratpoison
MAINTAINERCLEANFILES = Makefile.in config.h.in
-AM_LDFLAGS=${X_LDFLAGS} ${X_LIBS} ${X_EXTRA_LIBS} ${XFT_LIBS} $
{HISTORY_LIBS}
+AM_LDFLAGS=${X_LDFLAGS}
+ratpoison_LDADD=${XFT_LIBS} ${X_LIBS} ${X_EXTRA_LIBS} ${HISTORY_LIBS}
AM_CPPFLAGS=${X_CFLAGS} ${XFT_CFLAGS}
ratpoison_SOURCES = actions.c \
I've applied this as "obvious trivial bugfix".
The second patch[1] stops using some c99 features to make it compile
with
gcc version 2, which I am very unsure about:
--- a/src/history.c
+++ b/src/history.c
@@ -65,7 +65,7 @@ extract_shell_part (const char *p)
struct history_item {
struct list_head node;
- char line[];
+ char line[1];
};
static struct history {
@@ -155,7 +155,7 @@ history_add_upto (int history_id, const char
*item, size_t max)
return;
item_len = strlen(item);
- i = xmalloc (sizeof(struct history_item) + item_len + 1);
+ i = xmalloc (sizeof(struct history_item) + item_len);
memcpy (i->line, item, item_len + 1);
list_add_tail (&i->node, &h->head);
Pros:
- makes it work with some gcc 2.9x compilers.
(I do not know how many, as linkedlist.h also uses enhancements,
so that even with this it is not c89 compatible but at most some
older variants of gnu89).