From: Angelo Graziosi <angelo.graziosi@alice.it>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Daniel Engeler <engeler@gmail.com>,
kzeitler@alcatel-lucent.com, emacs-devel@gnu.org
Subject: Re: Undefined symbols: cfmakeraw and cfsetspeed
Date: Fri, 20 Jun 2008 01:02:28 +0200 [thread overview]
Message-ID: <485AE584.3090103@alice.it> (raw)
In-Reply-To: <jwv7icljqgy.fsf-monnier+emacs@gnu.org>
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)
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.
next prev parent reply other threads:[~2008-06-19 23:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-18 15:08 Undefined symbols: cfmakeraw and cfsetspeed Angelo Graziosi
2008-06-19 13:59 ` Stefan Monnier
2008-06-19 16:09 ` Angelo Graziosi
2008-06-19 17:17 ` Stefan Monnier
2008-06-19 23:02 ` Angelo Graziosi [this message]
2008-06-20 1:01 ` Stefan Monnier
2008-06-20 7:34 ` Angelo Graziosi
2008-06-20 14:51 ` Stefan Monnier
2008-06-19 17:29 ` Emanuele Giaquinta
-- strict thread matches above, loose matches on Subject: below --
2008-06-20 21:25 Daniel Engeler
2008-06-18 7:23 Klaus Zeitler
2008-06-18 7:30 ` dhruva
2008-06-18 7:47 ` David Kastrup
2008-06-18 13:01 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=485AE584.3090103@alice.it \
--to=angelo.graziosi@alice.it \
--cc=emacs-devel@gnu.org \
--cc=engeler@gmail.com \
--cc=kzeitler@alcatel-lucent.com \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.