Cross compiling Tcl Linux -> Linux 
Author Message
 Cross compiling Tcl Linux -> Linux

I need to build a Tcl/Tk for PPC Linux on a ix86 Linux.  I've
cross-built lots of other packages.  For example, I build Net-SNMP with
something like:

./configure --target=powerpc-linux \
            --host=powerpc-linux \
            --build=i386-pc-linux \
            --with-cc=powerpc-linux-gcc \
            --with-ar=powerpc-linux-ar \
            ...

but the configure script I find in tcl/tcl8.4.9/unix doesn't seem to
have any options for cc, ar, etc.  I've looked at the Wiki page headed
"cross-compiling" ( http://www.*-*-*.com/ ) and it has details of
building on Linux for Wintel but nothing that seems to help me with
Linux-to-Linux.  Am I just blind to something obvious?  Surely I'm not
the first person to want to cross-build Tcl.  Help, please!



Tue, 23 Oct 2007 00:23:07 GMT  
 Cross compiling Tcl Linux -> Linux

Quote:

> I need to build a Tcl/Tk for PPC Linux on a ix86 Linux.

Any reason not to just grab a Tcl from Debian?  Does the SourceForge
build farm have a PPC machine?  If it's just something quick, I'm
fully of PPC Linux machines here and I could compile you something, if
you want to write me privately.

--
David N. Welton
 - http://www.dedasys.com/davidw/

Apache, Linux, Tcl Consulting
 - http://www.dedasys.com/



Tue, 23 Oct 2007 06:01:49 GMT  
 Cross compiling Tcl Linux -> Linux

Quote:


> > I need to build a Tcl/Tk for PPC Linux on a ix86 Linux.

> Any reason not to just grab a Tcl from Debian?

This is the first step on the road to automated testing that will
involve building an extension to access and control hardware features.
Ultimately, at least, I need to be able to build and rebuild as I
develop my extension.

Quote:
> Does the SourceForge
> build farm have a PPC machine?  If it's just something quick, I'm
> fully of PPC Linux machines here and I could compile you something,
> if you want to write me privately.

Thanks.

Overnight, I had the realization that since I'm going Linux->Linux (so
most of my include files are the same, etc.) that I might try aliasing
"gcc" so it invokes "powerpc-linux-gcc" (and similarly for ld, ranlib,
etc.) and see how that goes.



Tue, 23 Oct 2007 19:43:17 GMT  
 Cross compiling Tcl Linux -> Linux

Quote:

> ...
> Overnight, I had the realization that since I'm going Linux->Linux
> (so most of my include files are the same, etc.) that I might try
> aliasing "gcc" so it invokes "powerpc-linux-gcc" (and similarly
> for ld, ranlib, etc.) and see how that goes.

I've gotten tclsh8.4 built and running by manually editing the
Makefile.  Ick!  I put notes on the wiki if anyone's interested.


Tue, 23 Oct 2007 21:01:18 GMT  
 Cross compiling Tcl Linux -> Linux

Quote:


>>Overnight, I had the realization that since I'm going Linux->Linux
>>(so most of my include files are the same, etc.) that I might try
>>aliasing "gcc" so it invokes "powerpc-linux-gcc" (and similarly
>>for ld, ranlib, etc.) and see how that goes.

> I've gotten tclsh8.4 built and running by manually editing the
> Makefile.  Ick!  I put notes on the wiki if anyone's interested.

If you think there are clear fixes that could go into the
m4 and/or configure.in to help the x-compile builds
(without affecting regular builds), please submit those
as bug reports.

--
   Jeff Hobbs, The Tcl Guy
   http://www.ActiveState.com/, a division of Sophos



Wed, 31 Oct 2007 08:51:25 GMT  
 Cross compiling Tcl Linux -> Linux

Quote:

> I need to build a Tcl/Tk for PPC Linux on a ix86 Linux.  ...

I got this to build by manually tweaking the Makefile that configure
created but now I'm on to my next obstacle:  I need to create an
extension that creates a thin layer on top of a promiscuous socket,
filtering a lot of the packets and passing just the few I care about.
I'd thought I might base this on Tcl_SocketObjCmd() but that seems too
tied to TCP.  So I started looking at Tcl_UDP (I got the source from
SourceForge) but I can't cross-build it.  It wants to run tclsh from my
target as part of the build process

( echo pkg_mkIndex . libudp1.0.6.so \; exit; ) | TCL_LIBRARY=`echo
/home/chrisn/tcl/tcl8.4.9/library`
LD_LIBRARY_PATH=".:/home/chrisn/tcl/tcl8.4.9/unix:"
LIBPATH=".:/home/chrisn/tcl/tcl8.4.9/unix:"
SHLIB_PATH=".:/home/chrisn/tcl/tcl8.4.9/unix:"
PATH=".:/home/chrisn/tcl/tcl8.4.9/unix:/usr/local/qt/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11/bin:/opt/sixnet/bin:/opt/atmel/bin:/usr/local/java/bin:/home/chrisn/bin"
TCLLIBPATH="." /home/chrisn/tcl/tcl8.4.9/unix/tclsh
/bin/sh: /home/chrisn/tcl/tcl8.4.9/unix/tclsh: cannot execute binary
file
make: *** [pkgIndex.tcl] Error 126

and, of course, the PPC binary of tclsh can't run on my ix86 build
machine.  Any thoughts?

                                          Chris



Sat, 03 Nov 2007 03:49:44 GMT  
 Cross compiling Tcl Linux -> Linux

Quote:

> I'd thought I might base this on Tcl_SocketObjCmd() but that seems too
> tied to TCP.  So I started looking at Tcl_UDP (I got the source from
> SourceForge) but I can't cross-build it.  It wants to run tclsh from my
> target as part of the build process

> ( echo pkg_mkIndex . libudp1.0.6.so \; exit; ) | TCL_LIBRARY=`echo
> /home/chrisn/tcl/tcl8.4.9/library`
> LD_LIBRARY_PATH=".:/home/chrisn/tcl/tcl8.4.9/unix:"
> LIBPATH=".:/home/chrisn/tcl/tcl8.4.9/unix:"
> SHLIB_PATH=".:/home/chrisn/tcl/tcl8.4.9/unix:"
> PATH=".:/home/chrisn/tcl/tcl8.4.9/unix:/usr/local/qt/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11/bin:/opt/sixnet/bin:/opt/atmel/bin:/usr/local/java/bin:/home/chrisn/bin"
> TCLLIBPATH="." /home/chrisn/tcl/tcl8.4.9/unix/tclsh
> /bin/sh: /home/chrisn/tcl/tcl8.4.9/unix/tclsh: cannot execute binary
> file
> make: *** [pkgIndex.tcl] Error 126

> and, of course, the PPC binary of tclsh can't run on my ix86 build
> machine.  Any thoughts?

The only thing being done here is generation of the pkgIndex.tcl file.

Generate one for a non-cross-compile build.  That will probably
work, either as-is, or with a minor edit to the file name.

--
| Don Porter          Mathematical and Computational Sciences Division |

| http://math.nist.gov/~DPorter/                                  NIST |
|______________________________________________________________________|



Sat, 03 Nov 2007 04:07:53 GMT  
 Cross compiling Tcl Linux -> Linux

Quote:


> > I'd thought I might base this on Tcl_SocketObjCmd() but that seems
> > too tied to TCP.  So I started looking at Tcl_UDP (I got the source
> > from SourceForge) but I can't cross-build it.  It wants to run
> > tclsh from my target as part of the build process
> > ...
> > and, of course, the PPC binary of tclsh can't run on my ix86 build
> > machine.  Any thoughts?

> The only thing being done here is generation of the pkgIndex.tcl
> file.

> Generate one for a non-cross-compile build.  That will probably
> work, either as-is, or with a minor edit to the file name.

OK.  I made this change to Makefile:

  155c155
  < TCLSH            = $(TCLSH_ENV) $(TCLSH_PROG)
  ---
  > TCLSH            = /usr/bin/tclsh

And it works.  Thanks.



Sat, 03 Nov 2007 20:48:38 GMT  
 Cross compiling Tcl Linux -> Linux

Quote:



>>>I'd thought I might base this on Tcl_SocketObjCmd() but that seems
>>>too tied to TCP.  So I started looking at Tcl_UDP (I got the source
>>>from SourceForge) but I can't cross-build it.  It wants to run
>>>tclsh from my target as part of the build process
>>>...
>>>and, of course, the PPC binary of tclsh can't run on my ix86 build
>>>machine.  Any thoughts?

>>The only thing being done here is generation of the pkgIndex.tcl
>>file.

>>Generate one for a non-cross-compile build.  That will probably
>>work, either as-is, or with a minor edit to the file name.

> OK.  I made this change to Makefile:

>   155c155
>   < TCLSH               = $(TCLSH_ENV) $(TCLSH_PROG)
>   ---
>   > TCLSH               = /usr/bin/tclsh

> And it works.  Thanks.

In a x-compile setup, wouldn't it be more correct to say:

        make TCLSH=/usr/bin/tclsh

seems to be more "declarative" from the build point of view
(no patching needed).

--
   Jeff Hobbs, The Tcl Guy
   http://www.ActiveState.com/, a division of Sophos



Sun, 04 Nov 2007 08:05:15 GMT  
 Cross compiling Tcl Linux -> Linux

Quote:


> > OK.  I made this change to Makefile:

> >   155c155
> >   < TCLSH          = $(TCLSH_ENV) $(TCLSH_PROG)
> >   ---
> >   > TCLSH          = /usr/bin/tclsh

> > And it works.  Thanks.

> In a x-compile setup, wouldn't it be more correct to say:

>    make TCLSH=/usr/bin/tclsh

> seems to be more "declarative" from the build point of view
> (no patching needed).

Yes, that makes sense.  I'm not that familiar with make details that I
think of setting values on the command line.


Sun, 04 Nov 2007 20:12:38 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. elj-win32 Wine cross-compile Linux => Windows

2. support from cross-compilation: linux->dos

3. how to compile code on linux(32bit) for linux(64bit)

4. linux -> arm X compiling

5. Compiling Tcl in Linux

6. Linux compiled TCL/TK files

7. Can't compile Berkeley DB tcl binding on Linux

8. This patch is needed to compile Tcl on Sparc Linux

9. compile tcl/tk 8.3 on RH Linux 5.2

10. Problem compiling tcl and C in Linux RH6.0

11. Problem compiling Tcl/Tk 8.0.4 on Linux Redhat 5.2

12. compiling Tcl/Tk 8.0.4 on Linux

 

 
Powered by phpBB® Forum Software