Version 4 of I cannot get Tcl (or an extension) to compile

Updated 2003-02-15 09:28:33

Purpose: Document common problems attempting to compile Tcl or some extension.


  I. When I run configure I get:

     loading cache ./config.cache
     checking for ranlib... :
     checking whether cross-compiling... yes
                        .
                        .

Well, I would point you to some threads at http://www.deja.com/ , (You can usually trim most of the junk out of a Deja pathname, as it seems to usually be related to the search that lead you to the info, and not the thread itself - DKF) but they use such bizarre pathnames that it causes Wiki to have heartburn. So here's what I can tell you:

The cross-compiling yes message is generally trouble. Cross-compiling is a feature of at least gcc (and perhaps other compilers as well) where executable code for platform A is generated on platform B. The reason that tests cannot be run is that in general processor B can't execute code for processor A. For instance, if your SGI computer/compiler were generating MSDOS executable code, it is unlikely that configure would know how to run MSDOS code.

Other reasons configure think it's cross-compiling:

  1. licensing difficulties: the compiler is installed, but doesn't generate legit objects because it's somehow disabled
  2. unclean source directory: if
      a.  the source tree is NFS-mounted from a foreign OS, or
      b.  someone duplicated a source tree from a foreign OS, there will
          often be enough configuration information from the foreign OS
          to make configure think it's cross-compiling
  1. dueling compilers: if there are a couple of compilers present (/usr/ucb/cc, /bin/cc, /usr/local/bin/gcc), and your PATH is weird enough to trigger a configure misfeature, configure will be confused about what it's doing, and collapse in the direction of cross-compilation.

JC, regarding the heartburn mentioned above: see the archive of *-URL messages for pointers to deja.com which work: http://www.purl.org/mini/cgi-bin/url/ (like [L1 ] or [L2 ]).


  2. See http://www.tcl.tk/doc/howto/compile.html - '''How to Compile Tcl''' for Unix, Windows, and MacOS.
  3. Be certain to have X11 loaded on Unix and similar systems before attempting to build Tk and related exensions.

Category Porting