Difference between revisions of "Building a delivery"

m (Updated path of Delivery)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:Build Scripts]]
 
[[Category:Build Scripts]]
 
[[Category:Compiler]]
 
[[Category:Compiler]]
The following command creates a new delivery of EiffelStudio in the current directory. The script assumes that you are running bash, that you have defined the environment variable '''EIFFEL_SRC''' and that you have followed [[Compiling_EiffelStudio|the instructions to compile EiffelStudio]].
+
The following commands create a new delivery of EiffelStudio in the current directory. The script assumes that you are running bash, that you have defined the environment variable '''EIFFEL_SRC''' and that '''{{Red|you have followed [[Compiling_EiffelStudio|the instructions to compile EiffelStudio]]}}'''.
  
On Windows you may alternativly use the this [[Powershell]] [[media:building_delivery.ps1|script]].
+
==Prerequisites==
 +
Before starting, one has to setup a few things:
 +
export SVNURL=https://svn.eiffel.com/eiffelstudio/trunk
 +
export NEW_ISE_EIFFEL=`pwd`/EiffelXX
 +
svn co $SVNURL/Src/Delivery EiffelXX
  
Platform independent part:
+
==Building a delivery (common part)==
<pre>
+
To build a delivery for any platform, you first need to create the delivery layout correctly. The building of that layout differs between Windows and Unix.
export SVNURL=https://svn.origo.ethz.ch/eiffelstudio/trunk
+
export NEW_ISE_EIFFEL=`pwd`/EiffelXX
+
svn co $SVNURL/Delivery EiffelXX
+
  
cd $NEW_ISE_EIFFEL/studio/spec
+
On Unix, you have to do the following:
mkdir $ISE_PLATFORM
+
cd $NEW_ISE_EIFFEL/studio/config
mkdir $ISE_PLATFORM/bin
+
mv unix $ISE_PLATFORM
mkdir $ISE_PLATFORM/include
+
cd $NEW_ISE_EIFFEL/studio/spec
mkdir $ISE_PLATFORM/lib
+
mv unix $ISE_PLATFORM
 +
mkdir $ISE_PLATFORM/bin
 +
mkdir $ISE_PLATFORM/include
 +
mkdir $ISE_PLATFORM/lib
 +
mv $ISE_PLATFORM/finish_freezing $ISE_PLATFORM/bin
 +
mv $ISE_PLATFORM/prelink $ISE_PLATFORM/bin
  
cp $EIFFEL_SRC/C/run-time/*.h $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/include
+
On Windows, this:
</pre>
+
cd $NEW_ISE_EIFFEL/studio/config
 +
mv windows $ISE_PLATFORM
 +
cd $NEW_ISE_EIFFEL/studio/spec
 +
mkdir $ISE_PLATFORM/include
 +
mkdir $ISE_PLATFORM/lib
 +
cp -f windows/compile_library.bat $ISE_PLATFORM/compile_library.bat
  
On Unix, you need to do the following:
+
==Building a delivery for the same platform==
<pre>
+
After having followed the instructions to compile EiffelStudio, you must have the runtime compiled. Then you first need to copy the new headers:
cp $EIFFEL_SRC/C/config.sh $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/include
+
cp $EIFFEL_SRC/C/run-time/*.h $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/include
cp $EIFFEL_SRC/C/run-time/lib* $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/lib
+
cp $EIFFEL_SRC/C/run-time/x2c $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
+
cp $EIFFEL_SRC/C/ipc/daemon/ecdbgd $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
+
  
cd $NEW_ISE_EIFFEL/studio/config
+
And then the various binary objects that were generated. Again here Windows and Unix have a different set of steps.
cp -r unix $ISE_PLATFORM
+
 
cd $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
+
On Unix, you need to do the following:
ln -s $NEW_ISE_EIFFEL/studio/spec/unix/finish_freezing .
+
cp $EIFFEL_SRC/C/config.sh $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/include
ln -s $NEW_ISE_EIFFEL/studio/spec/unix/prelink .
+
cp $EIFFEL_SRC/C/run-time/lib* $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/lib
</pre>
+
cp $EIFFEL_SRC/C/run-time/x2c $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
 +
cp $EIFFEL_SRC/C/ipc/daemon/ecdbgd $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
  
 
On Windows, you need to do the following:
 
On Windows, you need to do the following:
<pre>
+
mkdir $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/lib/$ISE_C_COMPILER
mkdir $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/lib/$ISE_C_COMPILER
+
cp $EIFFEL_SRC/C/run-time/lib/* $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/lib/$ISE_C_COMPILER
cp $EIFFEL_SRC/C/run-time/lib/* $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/lib/$ISE_C_COMPILER
+
cp $EIFFEL_SRC/C/run-time/x2c.exe $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
cp $EIFFEL_SRC/C/run-time/x2c.exe $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
+
cp $EIFFEL_SRC/C/ipc/daemon/ecdbgd.exe $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
cp $EIFFEL_SRC/C/ipc/daemon/ecdbgd.exe $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
+
 
+
cd $NEW_ISE_EIFFEL/studio/config
+
cp -r windows $ISE_PLATFORM
+
</pre>
+
  
 
Now your delivery is ready to receive the executable that you will have compiled.
 
Now your delivery is ready to receive the executable that you will have compiled.
  
 +
==Building a delivery for cross compilation==
 +
If you are developing on a platform ('''host''') but targeting a different platform ('''target'''), you can reuse all the steps above except the part about copying '''x2c''' and '''ecdbgd'''. First '''ecdbgd''' can be omitted since this is used for debugging and we do not provide an emulator for you that would debug a binary generated for another platform.
  
'''Note''': a solution based on geant is available to build a delivery from the source code: check [[Automatic_Build_Scripts]]
+
What is so special about '''x2c''' then? This program converts our platform independent generated C code into a platform specific C code. However this program has to run on your host platform and the default build of the runtime built it for the target. So you need to do the following two steps to compile the proper executable for your target platform:
 +
 
 +
cd $EIFFEL_SRC/C/run-time
 +
cc -O3 -c offset.c
 +
cc -I. -I./include -Wall -O3 -c x2c.c
 +
cc -o x2c x2c.o offset.o
 +
 
 +
After that you can copy '''x2c''' to the location mentioned above.
 +
 
 +
{{Note| we used '''cc''' as to represent your platform specific C compiler. Most of the time it will be '''gcc'''}}.
 +
 
 +
==Other ways to build a delivery==
 +
Some users have contributed other ways to build a delivery. Check with the authors to ensure they are properly up-to-date.
 +
 
 +
A solution based on geant is available to build a delivery from the source code: check [[Automatic_Build_Scripts]]
 +
 
 +
On Windows you may alternativly use the this [[Powershell]] [[media:building_delivery.ps1|script]].

Latest revision as of 14:20, 27 January 2012

The following commands create a new delivery of EiffelStudio in the current directory. The script assumes that you are running bash, that you have defined the environment variable EIFFEL_SRC and that you have followed the instructions to compile EiffelStudio.

Prerequisites

Before starting, one has to setup a few things:

export SVNURL=https://svn.eiffel.com/eiffelstudio/trunk
export NEW_ISE_EIFFEL=`pwd`/EiffelXX
svn co $SVNURL/Src/Delivery EiffelXX

Building a delivery (common part)

To build a delivery for any platform, you first need to create the delivery layout correctly. The building of that layout differs between Windows and Unix.

On Unix, you have to do the following:

cd $NEW_ISE_EIFFEL/studio/config
mv unix $ISE_PLATFORM
cd $NEW_ISE_EIFFEL/studio/spec
mv unix $ISE_PLATFORM
mkdir $ISE_PLATFORM/bin
mkdir $ISE_PLATFORM/include
mkdir $ISE_PLATFORM/lib
mv $ISE_PLATFORM/finish_freezing $ISE_PLATFORM/bin
mv $ISE_PLATFORM/prelink $ISE_PLATFORM/bin

On Windows, this:

cd $NEW_ISE_EIFFEL/studio/config
mv windows $ISE_PLATFORM
cd $NEW_ISE_EIFFEL/studio/spec
mkdir $ISE_PLATFORM/include
mkdir $ISE_PLATFORM/lib
cp -f windows/compile_library.bat $ISE_PLATFORM/compile_library.bat

Building a delivery for the same platform

After having followed the instructions to compile EiffelStudio, you must have the runtime compiled. Then you first need to copy the new headers:

cp $EIFFEL_SRC/C/run-time/*.h $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/include

And then the various binary objects that were generated. Again here Windows and Unix have a different set of steps.

On Unix, you need to do the following:

cp $EIFFEL_SRC/C/config.sh $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/include
cp $EIFFEL_SRC/C/run-time/lib* $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/lib
cp $EIFFEL_SRC/C/run-time/x2c $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
cp $EIFFEL_SRC/C/ipc/daemon/ecdbgd $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin

On Windows, you need to do the following:

mkdir $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/lib/$ISE_C_COMPILER
cp $EIFFEL_SRC/C/run-time/lib/* $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/lib/$ISE_C_COMPILER
cp $EIFFEL_SRC/C/run-time/x2c.exe $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
cp $EIFFEL_SRC/C/ipc/daemon/ecdbgd.exe $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin

Now your delivery is ready to receive the executable that you will have compiled.

Building a delivery for cross compilation

If you are developing on a platform (host) but targeting a different platform (target), you can reuse all the steps above except the part about copying x2c and ecdbgd. First ecdbgd can be omitted since this is used for debugging and we do not provide an emulator for you that would debug a binary generated for another platform.

What is so special about x2c then? This program converts our platform independent generated C code into a platform specific C code. However this program has to run on your host platform and the default build of the runtime built it for the target. So you need to do the following two steps to compile the proper executable for your target platform:

cd $EIFFEL_SRC/C/run-time
cc -O3 -c offset.c
cc -I. -I./include -Wall -O3 -c x2c.c
cc -o x2c x2c.o offset.o

After that you can copy x2c to the location mentioned above.

Information.png Note: we used cc as to represent your platform specific C compiler. Most of the time it will be gcc

.

Other ways to build a delivery

Some users have contributed other ways to build a delivery. Check with the authors to ensure they are properly up-to-date.

A solution based on geant is available to build a delivery from the source code: check Automatic_Build_Scripts

On Windows you may alternativly use the this Powershell script.