This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: building egcs on Win32 platforms


Brendan Simon <brendan@dgs.monash.edu.au> wrote:

> I want to build a powerpc cross compiler to hosted on a Win95/98 box.
> RTEMS documentation mention getting cygwin32 beta19.  I'm pretty sure
> this will work but I would like to build with MinGW32.
> This is because the resulting crosscompiler will be native Win32 program
> and will be faster (unless cygwin has changed in the last 6 months to a year).

 Being a native Win32 program causes it to behave just like DJGPP and emx
binaries -- you must toy with all kind of environment settings...  With
cygwin32 the 'mount' command makes most environment settings unnecessary...

 O.K. if someone can show me how the GCC_EXEC_PREFIX must be set so that
all the possible cross-compilers work afterwards, I would reconsider my
pessimism... Hmmm. perhaps just installing all programs, libs and includes to 
the 'install' directory, got with 'gcc-xxx -print-search-dirs', and setting 
GCC_EXEC_PREFIX to be 'D:/usr/local/lib/gcc-lib/' (using the default 
'/usr/local' prefix), where 'D:' is the disk name, could simply make it...
(but I just don't think so) :

C:\users\default>gcc-mgw32 -v
Using builtin specs.
gcc version 2.8.1

C:\users\default>set GCC_EXEC_PREFIX=d:/usr/local/lib/gcc-lib/

C:\users\default>gcc-mgw32 -v
Reading specs from d:/usr/local/lib/gcc-lib/mingw32/2_8_1/specs
gcc version 2.8.1

C:\users\default>gcc-mgw32 -print-search-dirs
install: /usr/local/lib/gcc-lib/mingw32/2_8_1/
programs: d:/usr/local/lib/gcc-lib/mingw32/2_8_1/;d:/usr/local/lib/gcc-lib/;
/usr/local/lib/gcc-lib/mingw32/2_8_1/;/usr/local/lib/gcc-lib/mingw32/;
/usr/lib/gcc/mingw32/2_8_1/;/usr/lib/gcc/mingw32/;
/usr/local/mingw32/bin/mingw32/2_8_1/;/usr/local/mingw32/bin/
libraries: d:/usr/local/lib/gcc-lib/mingw32/2_8_1/;d:/usr/local/lib/gcc-lib/;
/usr/local/lib/gcc-lib/mingw32/2_8_1/;/usr/lib/gcc/mingw32/2_8_1/;
/usr/local/mingw32/lib/mingw32/2_8_1/;/usr/local/mingw32/lib/

 Surely all the programs and libs will be found if installed to the
   /usr/local/lib/gcc-lib/<target>/<version>/
but what about the headers?
 
 I have many times thought that "something must be done to this problem". It
is in DJGPP, emx and mingw32, when used as hosts for multiple GCCs at the
same machine. For quite a lot people this isn't a problem at all... "Just make 
BAT-files to change the environvent settings, before switching from one 
compiler to another" is the normal reaction... But nobody must do this under 
Unix or Cygwin32, so why then when using DJGPP, emx or mingw32 as the host?

 Perhaps this is just the same kind of 'non-problem' as rebooting ones PC many
times during a workday with DOS/Win or Win9x...
 
 If having only GCC in the system, there aren't much troubles, but adding the
first cross-compiler to the system brings all the "how to install and how to
set the environment" problems...

 If someone else thinks this is a problem and wants to do something to it...

 My solution would be to add a new environment variable 'GCC_INSTALL_DISK', 
or something like that, which would be looked in the 'gcc.c' and 'cccp.c'
source code with these 'DOS-like' hosts:

  #if defined (__MINGW32__) || defined (__EMX__) || defined (__DJGPP__)

  if (xyz = getenv("GCC_INSTALL_DISK") == NULL)
  {
      < add the disk prefix to all search directory names>
  }

> How is the naitive MinGW32 built from the sources ?  Using itself or
> Cygwin32 ?

 Feel free to choice... If one has a DOS-to-mingw32 cross-compiler, he
probably thinks to be capable to build all kind of things for Mingw32
host under DOS :>

 I prefer using a real Unix system for building cygwin32, mingw32, emx
and djgpp hosted native and cross-compilers using the Canadian Cross...

 configure --build=i486-linux --host=i386-ming32 --target=i386-mingw32

Cheers, Kai
________________________________________________
To get help for the crossgcc list, send mail to
crossgcc-request@cygnus.com with the text 'help'
(without the quotes) in the body of the message.