Download as xls, pdf, or txt
Download as xls, pdf, or txt
You are on page 1of 12

Understanding build scripts and configuration parameters

Specifying build,host and target

BUILD: i686-pc-linux-gnu
HOST: i386-pc-mingw32msvc
TARGET: h8300-elf

Information of the various versions

BINUTILS_VERSION 2.16.92
BINUTILS_MINGW_NATIVE_VERSION 2.15
GCC_VERSION 4.1-20060407
GCC_MINGW_NATIVE_VERSION 3.3
NEWLIB_VERSION 1.14.0
MINGW_RUNTIME_VERSION 3.2
W32API_VERSION 2.5

Setting of all the directory paths

Source directories for GCC: path

GCCSRCDIR : /home/kpit/fsfsrc
GCCSRCDIR_MINGW_NATIVE: /home/kpit/fsfsrc

Source directories for binutils:

BINUTILSRCDIR : /home/kpit/fsfsrc
BINUTILSRCDIR_MINGW_NATIVE : /home/kpit/fsfsrc

Source directories for newlib:

NEWLIBSRCDIR: /home/kpit/fsfsrc

Source directory for mingw:

MINGWSRCDIR: /home/kpit/fsfsrc
W32APISRCDIR: /home/kpit/fsfsrc

Build directory for host and target:

BUILD_X_HOST_DIR: /home/kpit
BUILD_X_TARGET_DIR: /home/kpit
HOST_X_TARGET_DIR: /home/kpit
PREFIX_BUILD_X_HOST: /usr/share
PREFIX_BUILD_X_TARGET: /usr/share
PREFIX_HOST_X_TARGET: /usr/share
Downloading and Extracting binutils, gcc,newlib sources

1, Check if binutil source exists and is a directory file, if not then download else extract.
2. Check if GCC source exists and is a directory file, if not then download else extract.
3. Check if Newlib source exists and is a directory
a directory
file,file,
if noe
if not
then
then download else extract.

Setting path for native versions

GCCSRCDIR_SH_ELF_NATIVE: /home/kpit/fsfsrc
BINUTILSSRCDIR_SH_ELF_NATIVE: /home/kpit/fsfsrc
BUILD_NATIVE_GCC_FOR_SH_ELF: /home/kpit
PREFIX_NATIVE_GCC_FOR_SH_ELF: /usr/share

Checking for a valid native GCC Version

1. Check if object format is sh-elf, check if native GCC version is >2.95.3


2. If yes then continue else set url , download and extract valid native GCC version

Setting LIBGCC2_DEBUG_CFLAGS for release builds

1. move to GCC source directory, get makefile.in to set the variable.


2. move back to the current directory.

Source Directories should be under "$SOURCE_DIR_PATH"

Summarizing all the information:

Main sources:

Binutils: /home/kpit/fsfsrc
GCC: /home/kpit/fsfsrc
Newlib: /home/kpit/fsfsrc

Sources for Mingw native GCC:

Binutils: /home/kpit/fsfsrc
GCC: /home/kpit/fsfsrc
mingw-runtime: /home/kpit/fsfsrc
W32api: /home/kpit/fsfsrc

Sources for sh-elf native GCC:

Binutils: /home/kpit/fsfsrc
GCC: /home/kpit/fsfsrc

Building for target: h8300-elf

Export all the variables to make them environment variable

Building the Native compiler for sh-elf target (required only if native gcc is less than 2.95.3
Main Build directory /home/kpit
Subdirectory build-binutils
Prefix Directory /usr/share

Building Binutils…..

1. Configure
source (binutil src directory) /home/kpit/fsfsrc
target (prefix dir) /usr/share

2. Make

3. Make install

Building GCC…

1. Configure

source /home/kpit/fsfsrc
target /usr/share

2. Make

3. Make Install

Set appropriate path..

Finished building Native GCC for i686-pc-linux-gnu

Apply the coff compatibility patch if required

Create different version files using assign_versions

Removing cygwin includes from newlib sources

Building the linux-x-target compiler (Build -x- target)

1. check for appropriate object format, if target directories are not present , make them

Building Gcc Linux - x - i386-pc-mingw32msvc

Main Build directory /home/kpit


Subdirectories build-binutils
build-gcc
build-newlib
Prefix Directory /usr/share

Building Binutils….

1. Configure
source /home/kpit/fsfsrc
target /usr/share

2. Make

3. Make Install

Set the path..

Building GCC…

1. Configure

source /home/kpit/fsfsrc
target h8300-elf
/usr/share

2. Make
3. Make install

Building Newlib…

1. Configure

source /home/kpit/fsfsrc
target /usr/share

2. Make
3. Make install

Building Final GCC…

1. go to the directory
2. Make, Make proto, Make install
3. set path to the original path.

Finished building GCC Linux - x - h8300-elf

Mingw Native compiler build

1. Download and extract native GCC for mingw.


2. Download and extract binutils.
3. Download and extract mingw runtime version.
4. Download and extract W32api source

Building the compiler (Build - x - host)

Building GCC : Linux - x - Mingw

Main Build Directory /home/kpit


Subdirectories build-binutil
build-gcc
build-w32api
build-mingw
Prefix Directory /usr/share

Building Binutils…

1. Configure
source /home/kpit/fsfsrc
target /usr/share
2. Make
3. Make install

Copy the runtime headers from sources to the prefix directory

Building GCC..

1. Configure
source /home/kpit/fsfsrc
target /usr/share
2. Make
3. Make Install

Building W32api…

1. Configure
source /home/kpit/fsfsrc
target /usr/share
2. Make
3. Make Install

Copy all the libraries & headers to target directory…

Building mingw runtime..

1. Configure
source /home/kpit/fsfsrc
target /usr/share
2. Make
3. Make install

Copy all the libraries & headers to target directory…

Set the path..

Building the mingw -x- target compiler (host -x- target)

Building mingw - x - h8300-elf

Main Build directory /home/kpit


Subdirectory build-binutil
build-gcc
build-newlib
Prefix Directory /usr/share

set path..

Building binutils…

1. Configure
source /home/kpit/fsfsrc
target /usr/share
2. Make
3. Make Install

Building GCC…

1. Configure
source /home/kpit/fsfsrc
target /usr/share
2. Configure libiberty..
3. Make libiberty
4. Make
5. Make Install

Building Newlib..

1. Configure
source /home/kpit/fsfsrc
target /usr/share
2. Make
3. Make Install

Building Final GCC..

1. Make
2. Make install
3. Protoize building - Make proto, Make install.

Restore the original Makefile.in for linux builds

Finished building mingw - x - for h8300-elf


iguration parameters

versions

gcc-4.1-20060407
gcc-3.3

binutils-2.16.92
binutils-2.15

newlib-1.14.0

mingw-runtime-3.2
w32api-2.5

mingw-3.3
h8300-elf,4.1-20060407
mingw-h8300-elf,4.1-20060407
mingw-3.3
gnuh8300_TOOLCHAIN_VERSION_elf-1
mingwgnuh8300_TOOLCHAIN_VERSION_elf-1
download and extract else only extract
download and extract else only extract
download and extract else only extract

gcc-3.4.3
binutils-2.15
i686-pc-linux 3.4.3
i686-pc-linux 3.4.3

ersion is >2.95.3
ct valid native GCC version

he variable.

binutils-2.16.92
gcc-4.1-20060407
newlib-1.14.0

binutils-2.15
gcc-3.3
mingw-runtime-3.2
w32api-2.5

binutils-2.15
gcc-3.4.3

ed only if native gcc is less than 2.95.3


i686-pc-linux 3.4.3
2.15
i686-pc-linux 3.4.3

binutils-2.15
i686-pc-linux 3.4.3

gcc-3.4.3
i686-pc-linux 3.4.3

(sh-elf)

(./assign-version)

(./remove_cygwin_includes)

tories are not present , make them

mingw-3.3
2.16.92
4.1-20060407
1.14.0
mingw-3.3
binutils-2.16.92
gnuh8300_TOOLCHAIN_VERSION_elf-1

gcc-4.1-20060407 (enable languages=c,c++)


(with newlib)
gnuh8300_TOOLCHAIN_VERSION_elf-1

newlib-1.14.0
gnuh8300_TOOLCHAIN_VERSION_elf-1

mingw-3.3
2.15
3.3
2.5
3.2
gnuh8300_TOOLCHAIN_VERSION_elf-1

binutils-2.15
mingw-3.3

gcc-3.3
mingw-3.3

w32api-2.5
mingw-3.3

mingw-runtime-3.2
mingw-3.3

mingw-h8300-elf,4.1-20060407
2.16.92
4.1-20060407
1.14.0
mingwgnuh8300_TOOLCHAIN_VERSION_elf-1

binutils-2.16.92
mingwgnuh8300_TOOLCHAIN_VERSION_elf-1

gcc-4.1-20060407
mingwgnuh8300_TOOLCHAIN_VERSION_elf-1

newlib-1.14.0
mingwgnuh8300_TOOLCHAIN_VERSION_elf-1

You might also like