pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/47194



The following reply was made to PR pkg/47194; it has been noted by GNATS.

From: Peter Bex <Peter.Bex%xs4all.nl@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/47194
Date: Wed, 14 Nov 2012 22:35:22 +0100

 --k9xkV0rc9XGsukaG
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Here's a quick patch I whipped up based on the code for Darwin in emacs.
 Darwin also has (only?) openpty();  I'm unsure whether this is completely
 correct since I'm adding support for all BSDs rather than just NetBSD,
 and doing it unconditionally (might fail on older BSDs).
 
 Fixing it The Right Way(TM) would probably involve patching configure to
 detect existence of openpty() and whether it requires libutil to link.
 
 Cheers,
 Peter Bex
 
 --k9xkV0rc9XGsukaG
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="emacs24-openpty.patch"
 
 --- src/s/bsd-common.h.orig    2012-11-14 22:04:22.000000000 +0100
 +++ src/s/bsd-common.h 2012-11-14 22:23:22.000000000 +0100
 @@ -59,6 +59,21 @@
  
  /* Define HAVE_PTYS if the system supports pty devices.  */
  #define HAVE_PTYS
 +/* Run only once.  We need a `for'-loop because the code uses `continue'.  */
 +#define PTY_ITERATION int i; for (i = 0; i < 1; i++)
 +#define PTY_NAME_SPRINTF      /* none */
 +#define PTY_TTY_NAME_SPRINTF  /* none */
 +
 +#define PTY_OPEN                                              \
 +  do                                                          \
 +    {                                                         \
 +      int slave;                                              \
 +      if (openpty (&fd, &slave, pty_name, NULL, NULL) == -1)  \
 +      fd = -1;                                                \
 +      else                                                    \
 +      emacs_close (slave);                                    \
 +    }                                                         \
 +  while (0)
  
  /* Define HAVE_SOCKETS if system supports 4.2-compatible sockets.  */
  #define HAVE_SOCKETS
 --- configure.in.orig  2012-11-14 22:20:34.000000000 +0100
 +++ configure.in       2012-11-14 22:20:43.000000000 +0100
 @@ -955,7 +955,7 @@
    ## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2.
    aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;;
  
 -  freebsd) LIBS_SYSTEM="-lutil" ;;
 +  freebsd|netbsd|openbsd) LIBS_SYSTEM="-lutil" ;;
  
    hpux*) LIBS_SYSTEM="-l:libdld.sl" ;;
  
 --- configure.orig     2012-11-14 22:20:54.000000000 +0100
 +++ configure  2012-11-14 22:20:55.000000000 +0100
 @@ -7854,7 +7854,7 @@
    ## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2.
    aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;;
  
 -  freebsd) LIBS_SYSTEM="-lutil" ;;
 +  freebsd|netbsd|openbsd) LIBS_SYSTEM="-lutil" ;;
  
    hpux*) LIBS_SYSTEM="-l:libdld.sl" ;;
  
 
 --k9xkV0rc9XGsukaG--
 


Home | Main Index | Thread Index | Old Index