Hi,
Which specific problem are you faced with?
Tcl and Tk can be cross-compiled the usual way, except some tests still
using AC_TRY_RUN macros in configure script, but they can be bypassed
setting some env variable before running configure. For arm-linux,
something like this should work:
export tcl_cv_type_64bit="long long"
export ac_cv_c_bigendian=no
export tcl_cv_strtod_buggy=1
export ac_cv_func_strstr=yes
export ac_cv_func_opendir=yes
Then, set CC to your cross-compiler (e.g. arm-linux-gcc), and go the
configure/make the usual way.
Last, if you don't want to bother with this, you may also find some
interest in giving eTcl a try.
http://www.evolane.com/software/etcl/index.html
Three variants (compact, standard and full, depending on your storage
constraints) are available for download, as all-in-one static
executable, which requires no installation but copying, and have no
dependencies.
Regards,
Eric
-----
Eric Hassold
Evolane - http://www.evolane.com/
This works for me for Tcl 8.4, building on Intel Linux for ARM.
export CROSS_COMPILE=arm-linux
export CC=arm-linux-gcc
export ac_cv_func_strtod=yes
export tcl_cv_strtod_buggy=1
./configure --prefix=../.. \
--target=arm-linux \
--host=arm-linux \
--build=i386-pc-linux \
--with-endianness=little \
--with-cc=arm-linux-gcc \
--with-ar=arm-linux-ar \
--with-install-prefix=../.. \
--with-cflags="-O2"
I am using ubuntu6.10 OS.
When compiling TCL8.4, Success
PATH= $PATH:/usr/local/arm/oe/bin
export CROSS_COMPILE=arm-linux
export CC=arm-linux-gcc
export tcl_cv_type_64bit="long long"
export ac_cv_c_bigendian=no
export tcl_cv_strtod_buggy=1
export ac_cv_func_strstr=yes
export ac_cv_func_opendir=yes
export ac_cv_func_strtod=yes
export tcl_cv_strtod_buggy=1
./configure ../.. \
--host=arm \
--prefix=/home/zhepeng/Desktop/tcl-for-arm \
--with-tcl=/home/zhepeng/Desktop/tcl-for-arm/lib/tcl8.4 \
--host=arm-linux \
--build=i386-pc-linux \
--with-endianness=little \
--with-cc=arm-linux-gcc \
--with-ar=arm-linux-ar \
--with-install-prefix=../.. \
--with-cflags="-O2"
export tcl_cv_type_64bit="long long"
export ac_cv_c_bigendian=no
export tcl_cv_strtod_buggy=1
export ac_cv_func_strstr=yes
export ac_cv_func_opendir=yes
export ac_cv_func_strtod=yes
export tcl_cv_strtod_buggy=1
./configure ../.. \
--host=arm \
--prefix=/home/zhepeng/Desktop/tcl-for-arm \
--with-tcl=/home/zhepeng/Desktop/tcl-for-arm/lib/tcl8.4 \
--host=arm-linux \
--build=i386-pc-linux \
--with-endianness=little \
--with-cc=arm-linux-gcc \
--with-ar=arm-linux-ar \
--with-install-prefix=../.. \
--with-cflags="-O2"
make
make install
All is OK. NO ERROR
But when compiling TK8.4
PATH= $PATH:/usr/local/arm/oe/bin
export CROSS_COMPILE=arm-linux
export CC=arm-linux-gcc
export tcl_cv_type_64bit="long long"
export ac_cv_c_bigendian=no
export tcl_cv_strtod_buggy=1
export ac_cv_func_strstr=yes
export ac_cv_func_opendir=yes
export ac_cv_func_strtod=yes
export tcl_cv_strtod_buggy=1
./configure ../.. \
--host=arm \
--prefix=/home/zhepeng/Desktop/tk-for-arm \
--with-tcl=/home/zhepeng/Desktop/tcl-for-arm/lib/tcl8.4 \
--host=arm-linux \
--build=i386-pc-linux \
--with-endianness=little \
--with-cc=arm-linux-gcc \
--with-ar=arm-linux-ar \
--with-install-prefix=../.. \
--with-cflags="-O2"
make
ERROR:
gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -fPIC -
I/home/zhepeng/Desktop/tk8.4.14/unix -I/home/zhepeng/Desktop/tk8.4.14/
unix/../generic -I/home/zhepeng/Desktop/tk8.4.14/unix/../bitmaps -I/
home/zhepeng/Desktop/tcl8.4.14/generic -DHAVE_LIMITS_H=1 -
DHAVE_UNISTD_H=1 -DPEEK_XCLOSEIM=1 -D_LARGEFILE64_SOURCE=1 -
DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_OPEN64=1 -
DHAVE_LSEEK64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_SYS_TIME_H=1 -
DTIME_WITH_SYS_TIME=1 -DSTDC_HEADERS=1 -DHAVE_PW_GECOS=1 -
DTCL_NO_DEPRECATED -DUSE_TCL_STUBS -DTK_LIBRARY=\"/home/zhepeng/
Desktop/tk-for-arm/lib/tk8.4\" \
/home/zhepeng/Desktop/tk8.4.14/unix/tkUnixInit.c
rm -f libtk8.4.so
gcc -pipe -shared -o libtk8.4.so tk3d.o tkArgv.o tkAtom.o tkBind.o
tkBitmap.o tkClipboard.o tkCmds.o tkColor.o tkConfig.o tkConsole.o
tkCursor.o tkError.o tkEvent.o tkFocus.o tkFont.o tkGet.o tkGC.o
tkGeometry.o tkGrab.o tkGrid.o tkMain.o tkObj.o tkOldConfig.o
tkOption.o tkPack.o tkPlace.o tkSelect.o tkStyle.o tkUndo.o tkUtil.o
tkVisual.o tkWindow.o tkButton.o tkEntry.o tkFrame.o tkListbox.o
tkMenu.o tkMenubutton.o tkMenuDraw.o tkMessage.o tkPanedWindow.o
tkScale.o tkScrollbar.o tkCanvas.o tkCanvArc.o tkCanvBmap.o
tkCanvImg.o tkCanvLine.o tkCanvPoly.o tkCanvPs.o tkCanvText.o
tkCanvUtil.o tkCanvWind.o tkRectOval.o tkTrig.o tkImage.o tkImgBmap.o
tkImgGIF.o tkImgPPM.o tkImgPhoto.o tkText.o tkTextBTree.o tkTextDisp.o
tkTextImage.o tkTextIndex.o tkTextMark.o tkTextTag.o tkTextWind.o
tkStubInit.o tkStubLib.o tkUnix.o tkUnix3d.o tkUnixButton.o
tkUnixColor.o tkUnixConfig.o tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o
tkUnixEvent.o tkUnixFocus.o tkUnixFont.o tkUnixInit.o tkUnixKey.o
tkUnixMenu.o tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o
tkUnixSelect.o tkUnixSend.o tkUnixWm.o tkUnixXId.o -lX11 -ldl -lieee -
lm -L/home/zhepeng/Desktop/tcl8.4.14/unix -ltclstub8.4
/usr/bin/ld: tk3d.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: tk3d.o: Relocations in generic ELF (EM: 40)
tk3d.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [libtk8.4.so] Error 1
I think the error is beacause the tcl DIRE wrong? not /home/zhepeng/
Desktop/tcl-for-arm/lib/tcl8.4?? Or?
export CROSS_COMPILE=arm-linux
export CC=arm-linux-gcc
export AR=arm-linux-ar
export LD=arm-linux-ld
export tcl_cv_type_64bit="long long"
export ac_cv_c_bigendian=no
export tcl_cv_strtod_buggy=1
export ac_cv_func_strstr=yes
export ac_cv_func_opendir=yes
export ac_cv_func_strtod=yes
./configure --host=arm --prefix=/home/zhepeng/Desktop/tk-for-arm --
with-tcl=/home/zhepeng/Desktop/tcl-for-arm/lib/ --with-cc=arm-linux-
gcc --with-ar=arm-linux-ar --with-ld=arm-linux-ld --with-cflags="-O2"
make
Fixed much of the errors. But not cross compile success.See:
arm-linux-gcc -pipe -O2 tkAppInit.o -L/home/zhepeng/Desktop/
tk8.4.14/unix -ltk8.4 \
-L/home/zhepeng/Desktop/tcl-for-arm/lib -ltcl8.4 -
lX11 -lieee -lm -o wish
/home/zhepeng/Desktop/tk8.4.14/unix/libtk8.4.a(tkWindow.o)(.text
+0xb54): In function `Tk_DestroyWindow':
: undefined reference to `XDestroyIC'
/home/zhepeng/Desktop/tk8.4.14/unix/libtk8.4.a(tkUnixEvent.o)(.text
+0x108): In function `TkpCloseDisplay':
: undefined reference to `XCloseIM'
/home/zhepeng/Desktop/tk8.4.14/unix/libtk8.4.a(tkUnixEvent.o)(.text
+0x594): In function `TkpOpenDisplay':
: undefined reference to `XOpenIM'
/home/zhepeng/Desktop/tk8.4.14/unix/libtk8.4.a(tkUnixEvent.o)(.text
+0x5b0): In function `TkpOpenDisplay':
: undefined reference to `XGetIMValues'
/home/zhepeng/Desktop/tk8.4.14/unix/libtk8.4.a(tkUnixEvent.o)(.text
+0x660): In function `TkpOpenDisplay':
: undefined reference to `XCloseIM'
/home/zhepeng/Desktop/tk8.4.14/unix/libtk8.4.a( tkUnixKey.o)(.text
+0xe0): In function `TkpGetString':
: undefined reference to `XmbLookupString'
/home/zhepeng/Desktop/tk8.4.14/unix/libtk8.4.a(tkUnixKey.o)(.text
+0x150): In function `TkpGetString':
: undefined reference to `XVaCreateNestedList'
/home/zhepeng/Desktop/tk8.4.14/unix/libtk8.4.a(tkUnixKey.o)(.text
+0x168): In function `TkpGetString':
: undefined reference to `XSetICValues'
/home/zhepeng/Desktop/tk8.4.14/unix/libtk8.4.a( tkUnixKey.o)(.text
+0x190): In function `TkpGetString':
: undefined reference to `XmbLookupString'
/home/zhepeng/Desktop/tk8.4.14/unix/libtk8.4.a(tkEvent.o)(.text
+0x7a0): In function `Tk_HandleEvent':
: undefined reference to `XGetICValues'
/home/zhepeng/Desktop/tk8.4.14/unix/libtk8.4.a(tkEvent.o)(.text
+0x7c8): In function `Tk_HandleEvent':
: undefined reference to `XSetICFocus'
/home/zhepeng/Desktop/tk8.4.14/unix/libtk8.4.a( tkEvent.o)(.text
+0x830): In function `Tk_HandleEvent':
: undefined reference to `XVaCreateNestedList'
/home/zhepeng/Desktop/tk8.4.14/unix/libtk8.4.a(tkEvent.o)(.text
+0x880): In function `Tk_HandleEvent':
: undefined reference to `XCreateIC'
/home/zhepeng/Desktop/tk8.4.14/unix/libtk8.4.a(tkEvent.o)(.text
+0x960): In function `Tk_HandleEvent':
: undefined reference to `XCreateIC'
collect2: ld returned 1 exit status
make: *** [wish] Error 1
I don't why...
So unlucky...
Who Can Help Me?
X11 libraries (typically -lX11 -lXext -lXau -lXdmcp) are missing on your
linker command line. Check configure output for correct detection of X11
headers and libraries. You might have to add those options to configure,
to explicitely specify X11 location for arm-linux platform:
--with-x
--x-includes=<your cross root>/usr/X11R6/include
--x-libraries=<your cross root>/usr/X11R6/lib
Also get sure to use correct Tcl headers and libraries thanks to
--with-tcl and --with-tclinclude options, e.g.:
--with-tcl=<your cross root>/lib
--with-tclinclude=<your cross root>/include