I've attached a new version of the document, it should be on the website
shortly.

On Tue, 2007-02-13 at 22:04 +0100, [EMAIL PROTECTED] wrote:
> ---- Aldo Calpini <[EMAIL PROTECTED]> schrijft: 
> > Danny Backx wrote:
> > > Attached is a first adaptation. Does this help ?
> > 
> > it does indeed. funny how I didn't noticed the two scripts :-)
> 
> Which one to use is beyond me..

Hopefully the new document clarifies that both should be built. Which
one you need depends on which app you're building, and this may be
different every time.

> I have also  a fresh cygwin installation on my pc. This should enable me to 
> build the cegcc compiler. I am unsure which script to use. I have used both 
> cygwin and mingw in the past but currently cygwin also emulates mingw pretty 
> nice.
> 
> So is the script build-mingw32ce.sh intended to be used on MINGW or will it 
> create a MINGW equivalent of cegcc? my hunch is the latter..

Also hopefully the text says this arm-wince-mingw32ce is related to the
nature of the application to build; unrelated to the host PC.

> So under cygwin I should run both scripts to build the 'normal' version and 
> the MINGW equivalent version?

Yes, if arm-wince-cegcc is what you refer to as 'normal'.

> > regarding the doc, maybe mentioning somewhere to start with:
> > 
> > svn co https://cegcc.svn.sourceforge.net/svnroot/cegcc/trunk cegcc
> > 
> > would help the clueless ones. and also, I would add the suggestion to
> > go take a _long_ walk while cegcc is building :-)
> 
> Oh, good thing to mention only to check-out the trunk.. I made the mistake of 
> cheking out the cegcc root.. Takes about 6 hours here...
> 
> > 
> > cheers,
> > Aldo
> 
> Ok, I am off building cegcc now.
> 
> Later,
> 
> Jan Rinze.
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier.
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Cegcc-devel mailing list
> Cegcc-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/cegcc-devel
-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info
Title: How to build the toolchain
CeGCC cross compiler for PocketPC

This document describes how to build CeGCC. We have a set of scripts that can be used to build the toolchain on GNU/Linux as well as on Cygwin (Windows + the Cygnus layer). These scripts are in the src/ directory, they're called src/build-cegcc.sh and src/build-mingw32ce.sh. They can be used to build the toolchain for the arm-wince-cegcc and arm-wince-mingw32ce target platforms, respectively.

We used to have a separate set of scripts in the scripts/linux directory. These have been removed. The only thing still left there is support for building RPM files, these are distribution packages that can be used on many Linux platforms.

We offer two similar implementations of our product. It is recommended to build and install both of them. They're called after the target platforms they represent :

  • arm-wince-cegcc is meant for building apps that rely on a UNIX-style operating system, system calls, etc.
  • arm-wince-mingw32ce is much closer to Windows CE, for apps using the native API.

The examples below all mention the arm-wince-cegcc target. When building for the arm-wince-mingw32ce target, replace cegcc by mingw32ce everywhere, e.g. :

	sh build-mingw32ce.sh

Both toolsets are meant to build applications that run on devices with Windows CE. You may ask "which toolset should I use?" That depends on the application you're trying to build, and because of that, your choice tomorrow may be different from today. If today you're porting a Linux- or Unix-based application to Windows CE, then your best choice is probably the arm-wince-cegcc-gcc compiler. Tomorrow you may be writing a native Windows CE application, and your best choice would then be the arm-wince-mingw32ce-gcc compiler.

Do not confuse your host platform (Linux or Cygwin) with the toolset to use. Both the arm-wince-cegcc and the arm-wince-mingw32ce sets are available on Cygwin (your PC running some version of desktop Windows, with the Cygwin layer installed), as well as on Linux.

1. Building on Linux

This chapter describes building the toolchain on Linux. I would guess that this is similar on Cygwin, but the details on that are in the next chapter. A third chapter in this document describes some common elements, you probably want to look into that. We also assume you've been able to download CeGCC, that's also described below.

The basic steps are very simple :

  • Put yourself in the right directory
  • Clean up old installations
  • Build it

1.1 The right directory

All of the commands and context below rely on the fact that you're in the src directory of the CeGCC distribution.

1.2 Clean up old installations

Cleanup is recommended :

	rm -rf /opt/cegcc/*
	rm -rf build-cegcc

1.3 Build cegcc completely

	sh build-cegcc.sh

This command will rebuild and install all of cegcc. The directory in which everything is installed is /opt/cegcc, which means that you'll need to put /opt/cegcc/bin in your PATH to make use of the new tools.

Be warned that the build takes a while - you may want to go drink some coffee. An example : my Pentium 4 system (single CPU at 2.4 GHz) needs 27 minutes to build CeGCC. Drinking that much coffee can be hazardous :-)

1.4 More complicated stuff : partial builds, etc

The build scripts have a couple of paramters. In this chapter, we'll explain how to use them.

When you pass the --help parameter to the build script, it'll display a summary of its usage :

	dannypc: {55} sh build-cegcc.sh --help
	Using defaults:
	Building cegcc:
	source: /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src
	build: /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/build-cegcc
	prefix: /opt/cegcc
	usage:
	build-cegcc.sh [source dir] [build directory] [prefix dir] [build_opt]
	 
	Valid build options : binutils importlibs w32api dummy_cegccdll
	  bootstrapgcc newlib gcc cegccdll cegccthrd libstdc++ gdb
	  gdbstub docs profile all

	Done. --------------------------

1.4.1 Partial builds

You can rebuild part of CeGCC by saying e.g.

	sh build-cegcc.sh gcc
The script will then only build and install the requested module.

1.4.2 Non-standard prefix

Warning : don't install CeGCC in a generic installation directory such as /usr/local .

1.4.3

2. Building on Cygwin

To be written by someone who knows about Cygwin...

3 Platform independent information

3.1 How the scripts interact

3.2 Installation directory

3.3 The quick overview : how to build a cross compiler

The tools need to be built in a sequence because they rely on each other. The text below is an overview to make you understand the issues involved, the real scripts (src/build-*.sh) are the most (the only?) reliable source of information on this topic.

  • binutils
  • includes
  • gcc bootstrap
  • newlib
  • dll preliminary, not thread-capable
  • CE libraries
  • gcc, g++ complete build
  • dll complete
  • additional libraries (threads support, C++ DLLs)
  • gdb
  • the debugging stub

In this sequence, we always (configure and) build the tools, then immediately install them in $PREFIX. This is uncommon, but is the easiest way for us to deal with this sequence.

3.4 Downloading CeGCC

There are several ways to get CeGCC.

3.4.1 Get the SVN sources from our source repository

You can access our source repository directly using this command :

svn co https://cegcc.svn.sourceforge.net/svnroot/cegcc/trunk/cegcc cegcc

The result will be a large directory tree on your system; currently the size is between 800 and 900 megabytes. After compile, this becomes slightly more than 1.3 GB.

These are such large numbers for two reasons :

  • CeGCC is composed of a number of tools which are large already (e.g. binutils, gcc, gdb)
  • subversion adds a lot of overhead on disk to avoid network traffic

If you want to renew your download after a while, then all you need to do is position yourself inside the cegcc directory (inside cegcc/trunk/cegcc !) and run

svn update

3.4.2 Download a source distribution

Currently we don't offer a packaged source distribution of CeGCC. It is recommended to use subversion (SVN) to download the CeGCC sources.

The downside of distributing such a large quantity of sources would be that every version has to be downloaded completely. Use of subversion cuts a major part of the network traffic away : you can keep up to date with only a fraction of the network traffic (and the download time obviously also decreases).

4. Requirements

There is nothing out of the ordinary in the tools you need to build cegcc, most free software packages require the same :

  • a working C and C++ compiler for your platform, only tested with gcc
  • make
  • (if you're building an RPM) the rpmbuild tool

You don't need automake, autoconf or such tools : the cegcc sources, even the ones in SVN, already contain the files generated by these tools. Note that we need to do this as some of the software that is part of cegcc requires different revisions of the auto tools than other parts of cegcc.

5. A tour of the directory structure

how to download

src The master source directory, contains the master build scripts
src/newlib
src/cegcc/cegccdll
src/cegcc/importlibs/defs Definition files to create libraries to match WinCE DLL's
src/cegcc/importlibs
src/cegcc/cegccthrd
src/cegcc/libstdc++
src/cegcc/fixincludes
src/cegcc
src/gcc The gcc sources
src/gdb The gdb sources
src/binutils The binutils sources (gas, ld, ..) 
src/w32api/include The target system include files
src/w32api/lib an unused part of w32api
src/w32api
src/build-cegcc This directory is created from the source tree
src/build-mingw32ce This directory is created from the source tree
website Our website contents are also managed via the source repository
website/images
docs The CeGCC project's documentation

6 Known problems

6.1 C++ compiler won't build

For some reason, the build process for the C++ compiler chokes. The only explanation - and workaround - that we know of is the one found in this old message saying

Configure creates a softlink in gcc object directory to the new
version of the cross assembler. Problem is that the native compiler
get confused and use the cross assembler instead of the native one.

We found that this only happens if you have the current directory in your PATH, usually in the beginning of the list (before /bin and such). A workaround is to remove . from your path, or to put it at the end.

We've adapted the build scripts so they can cope with this, but this is really a gcc bug.

6.2 Build sometimes fails

I recommend cleaning up the installation directory and all of the build directories prior to using the build scripts. The build tends to be less reliable if part of an old build is still present.

6.3

Attachment: signature.asc
Description: This is a digitally signed message part

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to