Link with libutil only where needed.
This commit is contained in:
parent
9119543795
commit
3f510ad2bb
|
@ -106,11 +106,14 @@ dnl Check for -lxpg4 for FreeBSD
|
||||||
AC_CHECK_LIB(xpg4,_xpg4_setrunelocale)
|
AC_CHECK_LIB(xpg4,_xpg4_setrunelocale)
|
||||||
dnl Check for -lmmap for OS/2
|
dnl Check for -lmmap for OS/2
|
||||||
AC_CHECK_LIB(mmap,mmap)
|
AC_CHECK_LIB(mmap,mmap)
|
||||||
|
|
||||||
dnl Check for openpty
|
dnl Check for openpty
|
||||||
|
UTILLIBS=""
|
||||||
|
AC_SUBST(UTILLIBS)
|
||||||
AC_CHECK_FUNCS(openpty,,
|
AC_CHECK_FUNCS(openpty,,
|
||||||
[AC_CHECK_LIB(util,openpty,
|
[AC_CHECK_LIB(util,openpty,
|
||||||
[AC_DEFINE(HAVE_OPENPTY)
|
[AC_DEFINE(HAVE_OPENPTY)
|
||||||
LIBS="$LIBS -lutil"]
|
UTILLIBS="-lutil"]
|
||||||
)])
|
)])
|
||||||
|
|
||||||
DLLIBS=""
|
DLLIBS=""
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "wine/port.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -17,6 +18,12 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
#ifdef HAVE_LIBUTIL_H
|
||||||
|
# include <libutil.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_PTY_H
|
||||||
|
# include <pty.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
@ -27,8 +34,6 @@ DEFAULT_DEBUG_CHANNEL(console);
|
||||||
char console_xterm_prog[80];
|
char console_xterm_prog[80];
|
||||||
|
|
||||||
static BOOL wine_create_console(FILE **master, FILE **slave, pid_t *pid);
|
static BOOL wine_create_console(FILE **master, FILE **slave, pid_t *pid);
|
||||||
int wine_openpty(int *master, int *slave, char *name,
|
|
||||||
struct termios *term, struct winsize *winsize);
|
|
||||||
|
|
||||||
/* The console -- I chose to keep the master and slave
|
/* The console -- I chose to keep the master and slave
|
||||||
* (UNIX) file descriptors around in case they are needed for
|
* (UNIX) file descriptors around in case they are needed for
|
||||||
|
@ -129,7 +134,7 @@ static BOOL wine_create_console(FILE **master, FILE **slave, pid_t *pid)
|
||||||
if (tcgetattr(0, &term) < 0) return FALSE;
|
if (tcgetattr(0, &term) < 0) return FALSE;
|
||||||
term.c_lflag |= ICANON;
|
term.c_lflag |= ICANON;
|
||||||
term.c_lflag &= ~ECHO;
|
term.c_lflag &= ~ECHO;
|
||||||
if (wine_openpty(&tmaster, &tslave, NULL, &term, NULL) < 0)
|
if (openpty(&tmaster, &tslave, NULL, &term, NULL) < 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
*master = fdopen(tmaster, "r+");
|
*master = fdopen(tmaster, "r+");
|
||||||
*slave = fdopen(tslave, "r+");
|
*slave = fdopen(tslave, "r+");
|
||||||
|
|
|
@ -5,7 +5,7 @@ VPATH = @srcdir@
|
||||||
MODULE = winedos
|
MODULE = winedos
|
||||||
SOVERSION = 1.0
|
SOVERSION = 1.0
|
||||||
IMPORTS = user32 kernel32 ntdll
|
IMPORTS = user32 kernel32 ntdll
|
||||||
EXTRALIBS = @CURSESLIBS@
|
EXTRALIBS = @CURSESLIBS@ @UTILLIBS@
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
dosaspi.c \
|
dosaspi.c \
|
||||||
|
|
|
@ -113,6 +113,12 @@ int statfs(const char *name, struct statfs *info);
|
||||||
int strncasecmp(const char *str1, const char *str2, size_t n);
|
int strncasecmp(const char *str1, const char *str2, size_t n);
|
||||||
#endif /* !defined(HAVE_STRNCASECMP) */
|
#endif /* !defined(HAVE_STRNCASECMP) */
|
||||||
|
|
||||||
|
#ifndef HAVE_OPENPTY
|
||||||
|
struct termios;
|
||||||
|
struct winsize;
|
||||||
|
int openpty(int *master, int *slave, char *name, struct termios *term, struct winsize *winsize);
|
||||||
|
#endif /* HAVE_OPENPTY */
|
||||||
|
|
||||||
#ifndef HAVE_STRERROR
|
#ifndef HAVE_STRERROR
|
||||||
const char *strerror(int err);
|
const char *strerror(int err);
|
||||||
#endif /* !defined(HAVE_STRERROR) */
|
#endif /* !defined(HAVE_STRERROR) */
|
||||||
|
|
|
@ -34,12 +34,6 @@
|
||||||
#ifdef HAVE_SYSCALL_H
|
#ifdef HAVE_SYSCALL_H
|
||||||
# include <syscall.h>
|
# include <syscall.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_PTY_H
|
|
||||||
# include <pty.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_LIBUTIL_H
|
|
||||||
# include <libutil.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_STDINT_H
|
#ifdef HAVE_STDINT_H
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -197,7 +191,7 @@ int strncasecmp( const char *str1, const char *str2, size_t n )
|
||||||
#endif /* HAVE_STRNCASECMP */
|
#endif /* HAVE_STRNCASECMP */
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* wine_openpty
|
* openpty
|
||||||
* NOTE
|
* NOTE
|
||||||
* It looks like the openpty that comes with glibc in RedHat 5.0
|
* It looks like the openpty that comes with glibc in RedHat 5.0
|
||||||
* is buggy (second call returns what looks like a dup of 0 and 1
|
* is buggy (second call returns what looks like a dup of 0 and 1
|
||||||
|
@ -206,12 +200,9 @@ int strncasecmp( const char *str1, const char *str2, size_t n )
|
||||||
* FIXME
|
* FIXME
|
||||||
* We should have a autoconf check for this.
|
* We should have a autoconf check for this.
|
||||||
*/
|
*/
|
||||||
int wine_openpty(int *master, int *slave, char *name,
|
#ifndef HAVE_OPENPTY
|
||||||
struct termios *term, struct winsize *winsize)
|
int openpty(int *master, int *slave, char *name, struct termios *term, struct winsize *winsize)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_OPENPTY
|
|
||||||
return openpty(master, slave, name, term, winsize);
|
|
||||||
#else
|
|
||||||
const char *ptr1, *ptr2;
|
const char *ptr1, *ptr2;
|
||||||
char pts_name[512];
|
char pts_name[512];
|
||||||
|
|
||||||
|
@ -246,8 +237,8 @@ int wine_openpty(int *master, int *slave, char *name,
|
||||||
}
|
}
|
||||||
errno = EMFILE;
|
errno = EMFILE;
|
||||||
return -1;
|
return -1;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif /* HAVE_OPENPTY */
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* getnetbyaddr
|
* getnetbyaddr
|
||||||
|
|
Loading…
Reference in New Issue