From 792b28ec3eb755fda79f986da27e19bec7c552ac Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 31 Mar 2009 21:22:10 +0000 Subject: [PATCH] Most of AIX support. --- GNUmakefile | 16 +++++++++++++++- compat/getopt.h | 2 -- compat/getopt_long.c | 3 ++- compat/vis.h | 3 --- log.c | 6 +++++- osdep-unknown.c | 4 ++-- 6 files changed, 24 insertions(+), 10 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 635f0367..72fabf7d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,4 +1,4 @@ -# $Id: GNUmakefile,v 1.75 2009-03-07 09:29:54 nicm Exp $ +# $Id: GNUmakefile,v 1.76 2009-03-31 21:22:10 nicm Exp $ .PHONY: clean @@ -53,10 +53,12 @@ CFLAGS+= -g -ggdb -DDEBUG LDFLAGS+= -rdynamic LIBS+= -ldl endif +ifeq (${CC},gcc) CFLAGS+= -Wno-long-long -Wall -W -Wnested-externs -Wformat=2 CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations CFLAGS+= -Wwrite-strings -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare CFLAGS+= -Wundef -Wbad-function-cast -Winline -Wcast-align +endif LDFLAGS+= LIBS+= -lncurses @@ -66,6 +68,18 @@ INSTALLDIR= install -d INSTALLBIN= install -g bin -o root -m 555 INSTALLMAN= install -g bin -o root -m 444 +ifeq ($(shell uname),AIX) +INCDIRS+= -I/usr/local/include/ncurses -Icompat +SRCS+= compat/vis.c compat/strlcpy.c compat/strlcat.c compat/strtonum.c \ + compat/fgetln.c compat/asprintf.c compat/daemon.c compat/forkpty-aix.c \ + compat/getopt_long.c compat/bsd-poll.c +CFLAGS+= -DNO_TREE_H -DNO_ASPRINTF -DNO_QUEUE_H -DNO_VSYSLOG + -DNO_PROGNAME -DNO_STRLCPY -DNO_STRLCAT -DNO_STRTONUM \ + -DNO_SETPROCTITLE -DNO_QUEUE_H -DNO_TREE_H -DNO_FORKPTY -DNO_FGETLN \ + -DBROKEN_GETOPT -DBROKEN_POLL +LDFLAGS+= -L/usr/local/lib +endif + ifeq ($(shell uname),IRIX64) INCDIRS+= -Icompat -I/usr/local/include/ncurses SRCS+= compat/strlcpy.c compat/strtonum.c compat/daemon.c \ diff --git a/compat/getopt.h b/compat/getopt.h index 4e6689c3..aab7fe2e 100644 --- a/compat/getopt.h +++ b/compat/getopt.h @@ -56,7 +56,6 @@ struct option { int val; }; -__BEGIN_DECLS int getopt_long(int, char * const *, const char *, const struct option *, int *); int getopt_long_only(int, char * const *, const char *, @@ -73,6 +72,5 @@ extern int optopt; extern int optreset; extern char *suboptarg; /* getsubopt(3) external variable */ #endif -__END_DECLS #endif /* !_GETOPT_H_ */ diff --git a/compat/getopt_long.c b/compat/getopt_long.c index 20555612..9bd4fe14 100644 --- a/compat/getopt_long.c +++ b/compat/getopt_long.c @@ -49,13 +49,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include +/* #include */ #include /* #include */ #include #include #include "tmux.h" +#define warnx(a, b) /* XXX */ #define REPLACE_GETOPT /* use this getopt as the system getopt(3) */ diff --git a/compat/vis.h b/compat/vis.h index 23ae0469..d4a43af5 100644 --- a/compat/vis.h +++ b/compat/vis.h @@ -73,7 +73,6 @@ #include -__BEGIN_DECLS char *vis(char *, int, int, int); int strvis(char *, const char *, int); int strnvis(char *, const char *, size_t, int); @@ -82,6 +81,4 @@ int strunvis(char *, const char *); int unvis(char *, char, int *, int); ssize_t strnunvis(char *, const char *, size_t); -__END_DECLS - #endif /* !_VIS_H_ */ diff --git a/log.c b/log.c index a97f5eb8..8c3aa113 100644 --- a/log.c +++ b/log.c @@ -1,4 +1,4 @@ -/* $Id: log.c,v 1.10 2008-12-08 16:19:51 nicm Exp $ */ +/* $Id: log.c,v 1.11 2009-03-31 21:22:10 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -111,7 +111,11 @@ log_vwrite(int pri, const char *msg, va_list ap) switch (log_type) { case LOG_TYPE_SYSLOG: +#ifdef NO_VSYSLOG + /* XXX */ +#else vsyslog(pri, msg, ap); +#endif break; case LOG_TYPE_TTY: if (pri == LOG_INFO) diff --git a/osdep-unknown.c b/osdep-unknown.c index e37e099e..5370af94 100644 --- a/osdep-unknown.c +++ b/osdep-unknown.c @@ -1,4 +1,4 @@ -/* $Id: osdep-unknown.c,v 1.3 2009-02-18 08:41:46 nicm Exp $ */ +/* $Id: osdep-unknown.c,v 1.4 2009-03-31 21:22:10 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -24,7 +24,7 @@ #include "tmux.h" char * -get_argv0(unused pid_t pgrp) +osdep_get_name(unused int fd, unused char *tty) { return (NULL); }