public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* i686-pc-mingw cross build on linux
@ 2009-06-14  3:12 Gene Smith
  2009-11-17  1:01 ` i686-pc-mingw cross build on linux [now fedora 11] Gene Smith
  0 siblings, 1 reply; 2+ messages in thread
From: Gene Smith @ 2009-06-14  3:12 UTC (permalink / raw)
  To: insight

I have successfully built insight 6.8 on linux using installed mingw32 
tools and copied the insight.exe to windows and it runs OK. (I haven't 
tried copying over all the many other installed files to make sure they 
work, which I will do later.) However, the build process on linux has 
some glitches that I solved with some kludges.

The main problem was that during compile it was unable to find 
tk/xlib/X11/X.h. This was because TK_XINCLUDE was blank. This was 
because gdb/configure was finding the system tkConfig.sh file to use at 
/usr/local/lib/ instead of the one produced by insight build. The system 
file has the macro TK_XINCLUDES='' which prevents the include of X.h and 
kills the build. It is not clear to me how to control this. So I just 
changed two places in my insight_sources/gdb/configure file to hardcode 
the TKCONFIG and TCLCONFIG values to insight's tkConfig.sh and 
tclConfig.sh like this with absolute paths:

line 23293 (approx):
     no_tk=
     # gds (kluge)
  ac_cv_c_tkconfig="/home/gene/4.9.1-rtems/archive/insight_build/tk/win"
     TKCONFIG=${ac_cv_c_tkconfig}/tkConfig.sh

line 23177 (approx):
     no_tcl=
     # gds (kluge)
ac_cv_c_tclconfig="/home/gene/4.9.1-rtems/archive/insight_build/tcl/win"
     TCLCONFIG=${ac_cv_c_tclconfig}/tclConfig.sh

There must be a way to correctly insure that insight's own 
tk/tclConfig.sh files are found at insight_build/tcl/win and 
insight_build/tk/win.

Also, during the build the "resource compiler" i686-pc-mingw32-windres 
was never assigned to the macro "RC" which resulted in cryptic errors 
saying "command o could not be found." The only way I could find to fix 
this was to
export RC="i686-pc-mingw32-windres"
before doing configure. I don't know why this macro remains blank if you 
don't do this. Other similar macros get filled in properly.

(This is not a problem doing a mingw build on windows/cygwin with 
-mno-cygwin gcc option. I assume this is because on my windows 
installation only Insight provides the tk/tclConfig.sh files.)

With these fixes, the make and install on linux (fedora 8) works OK and 
the exe runs on XP. I have not copied over the other installed files and 
tried them.

Also, have not tried the cvs HEAD version, only insight release 6.8.

-gene
P/S: My linux mingw32 is built with this script from mingw project (rpms 
not available for fedora8 afaik):
http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=12644










^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: i686-pc-mingw cross build on linux [now fedora 11]
  2009-06-14  3:12 i686-pc-mingw cross build on linux Gene Smith
@ 2009-11-17  1:01 ` Gene Smith
  0 siblings, 0 replies; 2+ messages in thread
From: Gene Smith @ 2009-11-17  1:01 UTC (permalink / raw)
  To: insight

Gene Smith wrote, On 06/12/2009 07:38 PM:
> I have successfully built insight 6.8 on linux using installed mingw32
> tools and copied the insight.exe to windows and it runs OK. (I haven't
> tried copying over all the many other installed files to make sure they
> work, which I will do later.) However, the build process on linux has
> some glitches that I solved with some kludges.
>
> The main problem was that during compile it was unable to find
> tk/xlib/X11/X.h. This was because TK_XINCLUDE was blank. This was
> because gdb/configure was finding the system tkConfig.sh file to use at
> /usr/local/lib/ instead of the one produced by insight build. The system
> file has the macro TK_XINCLUDES='' which prevents the include of X.h and
> kills the build. It is not clear to me how to control this. So I just
> changed two places in my insight_sources/gdb/configure file to hardcode
> the TKCONFIG and TCLCONFIG values to insight's tkConfig.sh and
> tclConfig.sh like this with absolute paths:
>
> line 23293 (approx):
> no_tk=
> # gds (kluge)
> ac_cv_c_tkconfig="/home/gene/4.9.1-rtems/archive/insight_build/tk/win"
> TKCONFIG=${ac_cv_c_tkconfig}/tkConfig.sh
>
> line 23177 (approx):
> no_tcl=
> # gds (kluge)
> ac_cv_c_tclconfig="/home/gene/4.9.1-rtems/archive/insight_build/tcl/win"
> TCLCONFIG=${ac_cv_c_tclconfig}/tclConfig.sh
>
> There must be a way to correctly insure that insight's own
> tk/tclConfig.sh files are found at insight_build/tcl/win and
> insight_build/tk/win.
>
> Also, during the build the "resource compiler" i686-pc-mingw32-windres
> was never assigned to the macro "RC" which resulted in cryptic errors
> saying "command o could not be found." The only way I could find to fix
> this was to
> export RC="i686-pc-mingw32-windres"
> before doing configure. I don't know why this macro remains blank if you
> don't do this. Other similar macros get filled in properly.
>
> (This is not a problem doing a mingw build on windows/cygwin with
> -mno-cygwin gcc option. I assume this is because on my windows
> installation only Insight provides the tk/tclConfig.sh files.)
>
> With these fixes, the make and install on linux (fedora 8) works OK and
> the exe runs on XP. I have not copied over the other installed files and
> tried them.
>
> Also, have not tried the cvs HEAD version, only insight release 6.8.
>
> -gene
> P/S: My linux mingw32 is built with this script from mingw project (rpms
> not available for fedora8 afaik):
> http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=12644
>

I revisited this with fedora 11 using the mingw32 yum package for f11. 
To build on f11 you have to kluge a few more thing (maybe for f8 too, 
not sure):

insight file tclWinDde.c:
Comment out the line 1178 that says:
  ((Tcl_Obj **) objv) += (async + 3);
The mingw32 compiler chokes on this. This is for DDE which probably not 
even called in insight and someone else thought it was ok to just 
comment this out rather than try to correct the syntax.

insight file tclWinReg.c:
Comment out line 750 that says:
	while (*((Tcl_UniChar *)p)++ != 0) {}
for same reason that insight probably doesn't use the registry ??

insight file tclWinChan.c:
static vars get optimized out. Someone (David Korn of cygwin) patched 
this as follows using the "used" attribute at about line 124:
#ifdef HAVE_NO_SEH
static void *ESP __attribute__ ((used));
static void *EBP __attribute__ ((used));
#endif /* HAVE_NO_SEH */

Also, when run on windows, insight.exe complains about needing a couple 
of dlls that are present on f11 mingw32 /usr area. It needs 
libexpat-1.dll and libconv-2.dll. Then it runs OK once these are copied 
to windows.

Have not tried latest cvs (or new release?) of insight so this might be 
a moot point with it and it builds with f11 mingw32 ok as-is. This just 
applies to release 6.8.

For some reason, the f11 mingw exe is about 16M compared to the f8 mingw 
insight.exe which was 4M. Don't know if possibly debug info needs 
stripped out.

-gene








^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-17  1:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-14  3:12 i686-pc-mingw cross build on linux Gene Smith
2009-11-17  1:01 ` i686-pc-mingw cross build on linux [now fedora 11] Gene Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).