From: Derek on
Hi

I've managed to cross compile Tcl to an Linux/Arm based embedded
system,Dig connectME 9210.
This seems to work fine for the current task but the next task
includes the serial port.

When ever I try to configure the to port I get the "bad option "-mode"
should be ...." error message.


I have tried Etcl over a NFS mount and this is able to fconfigure the
port OK, however the Etcl binary is way too big for my purposes.

I've looked through the configure script and found the following which
suggests to me that serial ports are not supported when cross
compiling.

echo "$as_me:$LINENO: checking termios vs. termio vs. sgtty" >&5
echo $ECHO_N "checking termios vs. termio vs. sgtty... $ECHO_C" >&6
if test "${tcl_cv_api_serial+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
tcl_cv_api_serial=no
else
<test for port handling here>

If I'm mistaken and it is just an invocation issue, does any body know
what the magic invocation is?

Is is possible to cross compile standard Tcl with full serial port
support?

Thanks in advance

Derek



Any help would be appreciated
From: Donal K. Fellows on
On 2 Nov, 14:24, Derek <derek.phi...(a)csr.com> wrote:
> I've looked through the configure script and found the following which
> suggests to me that serial ports are not supported when cross
> compiling.

You're correct that we don't, but that's because the code to determine
which API to build with is horrible (it needs to run compiled code
snippets IIRC). You can work around this by setting the environment
variable tcl_cv_api_serial to "termios", which configure will
interpret to mean "oh, we have this cached already" so overriding the
checking code. A bit of a hack, but fairly easy to do.

Donal.
From: Derek on
On Nov 2, 4:00 pm, "Donal K. Fellows"
<donal.k.fell...(a)manchester.ac.uk> wrote:
> On 2 Nov, 14:24, Derek <derek.phi...(a)csr.com> wrote:
>
> > I've looked through the configure script and found the following which
> > suggests to me that serial ports are not supported when cross
> > compiling.
>
> You're correct that we don't, but that's because the code to determine
> which API to build with is horrible (it needs to run compiled code
> snippets IIRC). You can work around this by setting the environment
> variable tcl_cv_api_serial to "termios", which configure will
> interpret to mean "oh, we have this cached already" so overriding the
> checking code. A bit of a hack, but fairly easy to do.
>
> Donal.

Almost!!

It did find it

"checking sys/modem.h usability... no
checking sys/modem.h presence... no
checking for sys/modem.h... no
checking termios vs. termio vs. sgtty... (cached) termios
checking for fd_set in sys/types... yes
checking whether struct tm is in sys/time.h or time.h... time.h
..
..
"

However more errors crop up

"fixstrtod.o: In function `fixstrtod':
fixstrtod.c:(.text+0x0): multiple definition of `fixstrtod'
strtod.o:strtod.c:(.text+0x0): first defined here
collect2: ld returned 1 exit status
make: *** [libtcl8.5.so] Error 1"
"



Derek






From: Derek on
On 2 Nov, 17:07, Derek <derek.phi...(a)csr.com> wrote:
> On Nov 2, 4:00 pm, "Donal K. Fellows"
>
> <donal.k.fell...(a)manchester.ac.uk> wrote:
> > On 2 Nov, 14:24, Derek <derek.phi...(a)csr.com> wrote:
>
> > > I've looked through the configure script and found the following which
> > > suggests to me that serial ports are not supported when cross
> > > compiling.
>
> > You're correct that we don't, but that's because the code to determine
> > which API to build with is horrible (it needs to run compiled code
> > snippets IIRC). You can work around this by setting the environment
> > variable tcl_cv_api_serial to "termios", which configure will
> > interpret to mean "oh, we have this cached already" so overriding the
> > checking code. A bit of a hack, but fairly easy to do.
>
> > Donal.
>
> Almost!!
>
> It did find it
>
> "checking sys/modem.h usability... no
> checking sys/modem.h presence... no
> checking for sys/modem.h... no
> checking termios vs. termio vs. sgtty... (cached) termios
> checking for fd_set in sys/types... yes
> checking whether struct tm is in sys/time.h or time.h... time.h
> .
> .
> "
>
> However more errors crop up
>
> "fixstrtod.o: In function `fixstrtod':
> fixstrtod.c:(.text+0x0): multiple definition of `fixstrtod'
> strtod.o:strtod.c:(.text+0x0): first defined here
> collect2: ld returned 1 exit status
> make: *** [libtcl8.5.so] Error 1"
> "
>
> Derek

I removed this duplication and it built and seems to work.
I'll do some testing an try and reproduce before adding any more

Derek