From 592ba10565db67dbf024717e20458a5c36f1370a Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Wed, 20 Jan 1999 14:18:55 +0000 Subject: [PATCH] autoconf: added checks for libio.h, elf.h, curses.h,ncurses.h and fixed includers. --- configure | 2 +- configure.in | 2 +- console/ncurses.c | 8 +++++++- debugger/stabs.c | 6 +++++- include/config.h.in | 12 ++++++++++++ include/console.h | 14 +++++++------- misc/port.c | 4 +++- 7 files changed, 36 insertions(+), 12 deletions(-) diff --git a/configure b/configure index da1da01c460..45fb1751849 100755 --- a/configure +++ b/configure @@ -3235,7 +3235,7 @@ else fi done -for ac_hdr in wctype.h sys/syscall.h syscall.h sys/param.h sys/vfs.h sys/mount.h sys/statfs.h float.h linux/cdrom.h linux/ucdrom.h sys/cdio.h sys/filio.h sys/modem.h strings.h sys/strtio.h dlfcn.h unistd.h sys/sockio.h net/if.h netinet/in.h sys/file.h +for ac_hdr in wctype.h sys/syscall.h syscall.h sys/param.h sys/vfs.h sys/mount.h sys/statfs.h float.h linux/cdrom.h linux/ucdrom.h sys/cdio.h sys/filio.h sys/modem.h strings.h sys/strtio.h dlfcn.h unistd.h sys/sockio.h net/if.h netinet/in.h sys/file.h libio.h curses.h ncurses.h elf.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 diff --git a/configure.in b/configure.in index 65c19c17ab9..165d284edc0 100644 --- a/configure.in +++ b/configure.in @@ -344,7 +344,7 @@ fi dnl **** Check for functions and header files **** AC_CHECK_FUNCS(clone getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf) -AC_CHECK_HEADERS(wctype.h sys/syscall.h syscall.h sys/param.h sys/vfs.h sys/mount.h sys/statfs.h float.h linux/cdrom.h linux/ucdrom.h sys/cdio.h sys/filio.h sys/modem.h strings.h sys/strtio.h dlfcn.h unistd.h sys/sockio.h net/if.h netinet/in.h sys/file.h) +AC_CHECK_HEADERS(wctype.h sys/syscall.h syscall.h sys/param.h sys/vfs.h sys/mount.h sys/statfs.h float.h linux/cdrom.h linux/ucdrom.h sys/cdio.h sys/filio.h sys/modem.h strings.h sys/strtio.h dlfcn.h unistd.h sys/sockio.h net/if.h netinet/in.h sys/file.h libio.h curses.h ncurses.h elf.h) AC_HEADER_STAT() AC_C_CONST() AC_TYPE_SIZE_T() diff --git a/console/ncurses.c b/console/ncurses.c index b5b5fc63abe..ce0245559f6 100644 --- a/console/ncurses.c +++ b/console/ncurses.c @@ -21,7 +21,13 @@ #include "debug.h" #undef ERR /* Use ncurses's err() */ -#include +#ifdef HAVE_CURSES_H +# include +#else +# ifdef HAVE_NCURSES_H +# include +# endif +#endif SCREEN *ncurses_screen; diff --git a/debugger/stabs.c b/debugger/stabs.c index 61581ad8966..67565ca2a26 100644 --- a/debugger/stabs.c +++ b/debugger/stabs.c @@ -4,6 +4,8 @@ * Copyright (C) 1996, Eric Youngdale. */ +#include "config.h" + #include #include #include @@ -26,7 +28,9 @@ #endif #ifdef __ELF__ -#include +#ifdef HAVE_ELF_H +# include +#endif #include #include #elif defined(__EMX__) diff --git a/include/config.h.in b/include/config.h.in index 9f1223440a8..fc41763af7b 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -126,12 +126,21 @@ /* Define if you have the waitpid function. */ #undef HAVE_WAITPID +/* Define if you have the header file. */ +#undef HAVE_CURSES_H + /* Define if you have the header file. */ #undef HAVE_DLFCN_H +/* Define if you have the header file. */ +#undef HAVE_ELF_H + /* Define if you have the header file. */ #undef HAVE_FLOAT_H +/* Define if you have the header file. */ +#undef HAVE_LIBIO_H + /* Define if you have the header file. */ #undef HAVE_LINUX_CDROM_H @@ -141,6 +150,9 @@ /* Define if you have the header file. */ #undef HAVE_MACHINE_SOUNDCARD_H +/* Define if you have the header file. */ +#undef HAVE_NCURSES_H + /* Define if you have the header file. */ #undef HAVE_NET_IF_H diff --git a/include/console.h b/include/console.h index 75587a449fe..949fe65c364 100644 --- a/include/console.h +++ b/include/console.h @@ -12,18 +12,18 @@ #include "config.h" -/* Which libs can be used for wine's curses implementation... */ -#ifdef HAVE_LIBNCURSES -#define WINE_NCURSES +/* Can we compile with curses/ncurses? */ +#if ( (defined(HAVE_LIBNCURSES) || defined(HAVE_LIBCURSES)) && \ + (defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H)) \ +) +# define WINE_NCURSES #else - #ifdef HAVE_LIBCURSES - #define WINE_NCURSES - #endif +# undef WINE_NCURSES #endif #define CONSOLE_DEFAULT_DRIVER "tty" /* If you have problems, try setting the next line to xterm */ -#define CONSOLE_XTERM_PROG "nxterm" /* We should check for this first... */ +#define CONSOLE_XTERM_PROG "xterm" /* We should check for this first... */ typedef struct CONSOLE_DRIVER { diff --git a/misc/port.c b/misc/port.c index aba2d0a1c3d..5e03c6e0ade 100644 --- a/misc/port.c +++ b/misc/port.c @@ -12,7 +12,9 @@ #include #include #include -#include +#ifdef HAVE_LIBIO_H +# include +#endif #ifndef HAVE_USLEEP #ifdef __EMX__