mirror of
https://github.com/reactos/wine.git
synced 2024-11-27 21:50:37 +00:00
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)
|
||||
dnl Check for -lmmap for OS/2
|
||||
AC_CHECK_LIB(mmap,mmap)
|
||||
|
||||
dnl Check for openpty
|
||||
UTILLIBS=""
|
||||
AC_SUBST(UTILLIBS)
|
||||
AC_CHECK_FUNCS(openpty,,
|
||||
[AC_CHECK_LIB(util,openpty,
|
||||
[AC_DEFINE(HAVE_OPENPTY)
|
||||
LIBS="$LIBS -lutil"]
|
||||
UTILLIBS="-lutil"]
|
||||
)])
|
||||
|
||||
DLLIBS=""
|
||||
|
@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@ -17,6 +18,12 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <termios.h>
|
||||
#ifdef HAVE_LIBUTIL_H
|
||||
# include <libutil.h>
|
||||
#endif
|
||||
#ifdef HAVE_PTY_H
|
||||
# include <pty.h>
|
||||
#endif
|
||||
|
||||
#include "console.h"
|
||||
#include "options.h"
|
||||
@ -27,8 +34,6 @@ DEFAULT_DEBUG_CHANNEL(console);
|
||||
char console_xterm_prog[80];
|
||||
|
||||
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
|
||||
* (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;
|
||||
term.c_lflag |= ICANON;
|
||||
term.c_lflag &= ~ECHO;
|
||||
if (wine_openpty(&tmaster, &tslave, NULL, &term, NULL) < 0)
|
||||
if (openpty(&tmaster, &tslave, NULL, &term, NULL) < 0)
|
||||
return FALSE;
|
||||
*master = fdopen(tmaster, "r+");
|
||||
*slave = fdopen(tslave, "r+");
|
||||
|
@ -5,7 +5,7 @@ VPATH = @srcdir@
|
||||
MODULE = winedos
|
||||
SOVERSION = 1.0
|
||||
IMPORTS = user32 kernel32 ntdll
|
||||
EXTRALIBS = @CURSESLIBS@
|
||||
EXTRALIBS = @CURSESLIBS@ @UTILLIBS@
|
||||
|
||||
C_SRCS = \
|
||||
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);
|
||||
#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
|
||||
const char *strerror(int err);
|
||||
#endif /* !defined(HAVE_STRERROR) */
|
||||
|
@ -34,12 +34,6 @@
|
||||
#ifdef HAVE_SYSCALL_H
|
||||
# include <syscall.h>
|
||||
#endif
|
||||
#ifdef HAVE_PTY_H
|
||||
# include <pty.h>
|
||||
#endif
|
||||
#ifdef HAVE_LIBUTIL_H
|
||||
# include <libutil.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
@ -197,7 +191,7 @@ int strncasecmp( const char *str1, const char *str2, size_t n )
|
||||
#endif /* HAVE_STRNCASECMP */
|
||||
|
||||
/***********************************************************************
|
||||
* wine_openpty
|
||||
* openpty
|
||||
* NOTE
|
||||
* 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
|
||||
@ -206,12 +200,9 @@ int strncasecmp( const char *str1, const char *str2, size_t n )
|
||||
* FIXME
|
||||
* We should have a autoconf check for this.
|
||||
*/
|
||||
int wine_openpty(int *master, int *slave, char *name,
|
||||
struct termios *term, struct winsize *winsize)
|
||||
#ifndef HAVE_OPENPTY
|
||||
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;
|
||||
char pts_name[512];
|
||||
|
||||
@ -246,8 +237,8 @@ int wine_openpty(int *master, int *slave, char *name,
|
||||
}
|
||||
errno = EMFILE;
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
#endif /* HAVE_OPENPTY */
|
||||
|
||||
/***********************************************************************
|
||||
* getnetbyaddr
|
||||
|
Loading…
Reference in New Issue
Block a user