From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Angelo Graziosi Newsgroups: gmane.emacs.devel Subject: Re: Undefined symbols: cfmakeraw and cfsetspeed Date: Fri, 20 Jun 2008 01:02:28 +0200 Message-ID: <485AE584.3090103@alice.it> References: <485924D7.70407@alice.it> <485A84D6.2050105@alice.it> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1213916634 8498 80.91.229.12 (19 Jun 2008 23:03:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Jun 2008 23:03:54 +0000 (UTC) Cc: Daniel Engeler , kzeitler@alcatel-lucent.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 20 01:04:38 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K9TBF-0001yK-Vn for ged-emacs-devel@m.gmane.org; Fri, 20 Jun 2008 01:04:38 +0200 Original-Received: from localhost ([127.0.0.1]:34732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K9TAR-000873-Em for ged-emacs-devel@m.gmane.org; Thu, 19 Jun 2008 19:03:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K9T9m-000816-M3 for emacs-devel@gnu.org; Thu, 19 Jun 2008 19:03:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K9T9l-00080S-96 for emacs-devel@gnu.org; Thu, 19 Jun 2008 19:03:06 -0400 Original-Received: from [199.232.76.173] (port=58875 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K9T9l-00080M-0h for emacs-devel@gnu.org; Thu, 19 Jun 2008 19:03:05 -0400 Original-Received: from smtp-out113.alice.it ([85.37.17.113]:4333) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K9T9g-0002cJ-3R; Thu, 19 Jun 2008 19:03:00 -0400 Original-Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-out113.alice.it with Microsoft SMTPSVC(6.0.3790.1830); Fri, 20 Jun 2008 01:02:58 +0200 Original-Received: from FBCMCL01B05.fbc.local ([192.168.69.86]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Fri, 20 Jun 2008 01:02:57 +0200 Original-Received: from [87.1.239.111] ([87.1.239.111]) by FBCMCL01B05.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Fri, 20 Jun 2008 01:02:57 +0200 User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) In-Reply-To: X-OriginalArrivalTime: 19 Jun 2008 23:02:57.0449 (UTC) FILETIME=[9D1A2990:01C8D260] X-detected-kernel: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:99492 Archived-At: 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_ macro which you can then use in your code with > #ifdef HAVE_. 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) AC_CHECK_HEADERS(sys/un.h) ======================================= ======================================= --- 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 */ + #if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined (BROKEN_GET_CURRENT_DIR_NAME) @@ -5447,7 +5451,12 @@ else tem = Fplist_get (p->childp, QCspeed); CHECK_NUMBER (tem); +#ifdef HAVE_CFSETSPEED err = cfsetspeed (&attr, XINT (tem)); +#else + err = cfsetispeed(&attr, XINT (tem)); + err = err + cfsetospeed(&attr, XINT (tem)); +#endif 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_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); + 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. The same for HAVE_CFSETSPEED. Perhaps have you other suggestions? Cheers, Angelo.