]> git.marmaro.de Git - mmh/commitdiff
Fixed build on Cygwin by adding configure check for ncurses/termcap.h.
authorDavid Levine <levinedl@acm.org>
Mon, 16 Jan 2012 15:50:10 +0000 (09:50 -0600)
committerDavid Levine <levinedl@acm.org>
Mon, 16 Jan 2012 15:50:10 +0000 (09:50 -0600)
MACHINES
configure.ac
h/prototypes.h
uip/termsbr.c

index ddd30faa13a714d089c9fac1767dfe458220eb3b..60741ef9052d944a35706ca289230e056fe50c64 100644 (file)
--- a/MACHINES
+++ b/MACHINES
@@ -6,6 +6,7 @@ nmh is known to compile on the following platforms (save the
 exceptions noted below), using an ANSI C compiler, such as gcc.
 
 AIX 4.1.5.0.01
+Cygwin, setup version 2.763
 FreeBSD
 IRIX 6.5
 Linux 2.2, 2.3, 2.4 (glibc 2.1, glibc 2.2)
@@ -38,6 +39,12 @@ Will not compile correctly unless you configure with the --enable-debug
 option. It appears to find conflicts in the headers only when debugging
 is disabled. With debugging enabled, it compiles and runs happily.
 
+--------------------------------------
+Cygwin:
+
+Be sure to install Cygwin package libncurses-devel, in the Devel or
+Libs category.  And libncurses10 or later in the Lib category.
+
 --------------------------------------
 HPUX:
 
@@ -91,7 +98,7 @@ SunOS 4.1.1/4.1.3/4.1.4:
 
 You can't use the C compiler that comes with SunOS 4 since
 it isn't ANSI C.  But nmh builds just fine with gcc. With
---enable-debug you will see a lot of warnings. 
+--enable-debug you will see a lot of warnings.
 --------------------------------------
 
 
index 7b6859a695682d638edc5e85db2b860562f9d5e4..e4b0e9facbfbb25facbbd5a7a6f34d115a3b3307 100644 (file)
@@ -485,7 +485,7 @@ AC_SUBST(OURDEFS)
 
 AC_HEADER_STDC
 AC_HEADER_TIOCGWINSZ
-AC_CHECK_HEADERS(errno.h fcntl.h crypt.h termcap.h \
+AC_CHECK_HEADERS(errno.h fcntl.h crypt.h ncurses/termcap.h termcap.h \
                  langinfo.h wchar.h wctype.h iconv.h netdb.h \
                  sys/param.h sys/time.h sys/stream.h)
 
index fcc8f0c9085a0a4fa1f7b1053e81f8f38a595d4c..12124cdbad0b43797c00572fdf48346f37ac9a23 100644 (file)
@@ -6,13 +6,13 @@
 /*
  * missing system prototypes
  */
-#ifndef HAVE_TERMCAP_H
-extern int tgetent (char *bp, char *name);
-extern int tgetnum (char *id);
-extern int tgetflag (char *id);
-extern char *tgetstr (char *id, char **area);
-extern char *tgoto (char *cm, int destcol, int destline);
-extern int tputs (char *cp, int affcnt, int (*outc) (int));
+#if ! defined(HAVE_TERMCAP_H) && ! defined (HAVE_NCURSES_TERMCAP_H)
+  extern int tgetent (char *bp, char *name);
+  extern int tgetnum (char *id);
+  extern int tgetflag (char *id);
+  extern char *tgetstr (char *id, char **area);
+  extern char *tgoto (char *cm, int destcol, int destline);
+  extern int tputs (char *cp, int affcnt, int (*outc) (int));
 #endif
 
 /*
index f30a058506d248dc965c0c7d1ad8ab746619a1f8..4804776a462743262a23f6b7bbb35d6073bef003 100644 (file)
 
 #include <termios.h>
 
+/* It might be better to tie this to the termcap_curses_order in
+   configure.ac.  It would be fine to check for ncurses/termcap.h
+   first on Linux, it's a symlink to termcap.h.  */
 #ifdef HAVE_TERMCAP_H
 # include <termcap.h>
+#elif defined (HAVE_NCURSES_TERMCAP_H)
+# include <ncurses/termcap.h>
 #endif
 
 /* <sys/ioctl.h> is need anyway for ioctl()