[Top][All Lists]

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

Re: Undefined symbols: cfmakeraw and cfsetspeed

From: Angelo Graziosi
Subject: Re: Undefined symbols: cfmakeraw and cfsetspeed
Date: Fri, 20 Jun 2008 01:02:28 +0200
User-agent: Thunderbird (Windows/20080421)

Stefan Monnier ha scritto:
Following the suggestions in [2], it seems that this patch
Could you improve the patch so as to avoid things like "#ifdef __CYGWIN__"
and use autoconf instead?

I can't, do not know how autoconf works.

I don't either, to tell you the truth, but some parts are pretty easy.
In this case, I think you just need to add the relevant functions to one
of the calls to AC_CHECK_FUNCS (in configure.in) and that will provide
you with a HAVE_<FUNNAME> macro which you can then use in your code with
#ifdef HAVE_<FUNNAME>.

Do you mean this?

--- configure.in.orig   2008-06-01 23:52:00.000000000 +0200
+++ configure.in        2008-06-19 22:30:20.218750000 +0200
@@ -2300,7 +2300,8 @@
 __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
 sendto recvfrom getsockopt setsockopt getsockname getpeername \
 gai_strerror mkstemp getline getdelim mremap memmove fsync sync bzero \
-memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign)
+memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign \
+cfmakeraw cfsetspeed)


--- sysdep.c.orig       2008-06-15 12:28:21.000000000 +0200
+++ sysdep.c    2008-06-19 22:43:14.578125000 +0200
@@ -244,6 +244,10 @@

 SIGMASKTYPE sigprocmask_set;

+#if !defined (HAVE_CFMAKERAW)
+void cfmakeraw(struct termios *);
+#endif /* !defined (HAVE_CFMAKERAW */


@@ -5447,7 +5451,12 @@
     tem = Fplist_get (p->childp, QCspeed);
   CHECK_NUMBER (tem);
   err = cfsetspeed (&attr, XINT (tem));
+  err = cfsetispeed(&attr, XINT (tem));
+  err = err +  cfsetospeed(&attr, XINT (tem));
   if (err != 0)
error ("cfsetspeed(%d) failed: %s", XINT (tem), emacs_strerror (errno));
   childp2 = Fplist_put (childp2, QCspeed, tem);
@@ -5577,6 +5586,18 @@
   p->childp = childp2;

+#if !defined (HAVE_CFMAKERAW)
+/* Workaround for targets which are missing cfmakeraw */
+/* Pasted from man page; added in serial.c arbitrarily */
+void cfmakeraw(struct termios *termios_p)
+    termios_p->c_oflag &= ~OPOST;
+    termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+    termios_p->c_cflag &= ~(CSIZE|PARENB);
+    termios_p->c_cflag |= CS8;
+#endif /* !defined (HAVE_CFMAKERAW */
 #endif /* TERMIOS  */

 /* arch-tag: edb43589-4e09-4544-b325-978b5b121dcf

I have regenerated 'configure' with autoconf, but it seems that HAVE_CFMAKERAW is always 0 and build/src/config.h does not have it.

I have tested this on Cygwin, for which 'configure' says

checking for cfmakeraw... no

and so, HAVE_CFMAKERAW should be 0, and on GNU/Linux, for which

checking for cfmakeraw... yes

and HAVE_CFMAKERAW should be 1. But as I said, it seems HAVE_CFMAKERAW==0 always.


Perhaps have you other suggestions?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]