changeset 217:7ba4e371e9a6

Add Makefile for OpenBSD, and specific #ifdef'd includes for the platform.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 21 Nov 2010 04:16:55 +0200
parents 3ccfe8902fd5
children 0e60593006c9
files Makefile.openbsd libnnchat.h nnchat.c
diffstat 3 files changed, 27 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.openbsd	Sun Nov 21 04:16:55 2010 +0200
@@ -0,0 +1,20 @@
+#
+# Configuration settings for Linux and generic UNIX
+# See other Makefile.* files for more options.
+#
+
+# C-compiler, flags and linker flags
+CC=gcc
+CFLAGS=-DHAVE_STRING_H -DHAVE_INT_TYPES -DHAVE_NETINET_IN_H -DHAVE_NCURSES_H
+LDFLAGS=-lncurses
+
+#CFLAGS += -DHAVE_STDINT_H
+#CFLAGS += -DHAVE_SYS_TYPES_H
+
+# Miscellaneous
+BINPATH=
+OBJPATH=
+EXEEXT=
+
+
+include Makefile.gen
--- a/libnnchat.h	Sun Nov 21 04:14:08 2010 +0200
+++ b/libnnchat.h	Sun Nov 21 04:16:55 2010 +0200
@@ -13,6 +13,9 @@
 #include <winsock.h>
 #else
 #include <sys/socket.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
 #include <arpa/inet.h>
 #include <netdb.h>
 #endif
--- a/nnchat.c	Sun Nov 21 04:14:08 2010 +0200
+++ b/nnchat.c	Sun Nov 21 04:16:55 2010 +0200
@@ -16,7 +16,11 @@
 #else
 #include <sys/wait.h>
 #endif
+#ifdef HAVE_NCURSES_H
+#include <ncurses.h>
+#else
 #include <curses.h>
+#endif
 
 #ifdef __WIN32
 #define SET_CONFIG_FILE    "nnchat.txt"