User:DavidFlatz

eiffel5710011kk.png

yay \o/

My little Linux Eiffel Compiling Log

# I assume that you have the binary version of Eiffel 5.7 
# installed and that it's working. (ISE_EIFFEL, ISE_PLATFORM and
# PATH set)

# get the sources

svn co https://svn.eiffel.com/eiffelstudio/trunk eiffelsvn
export EIFFEL_SVN=`pwd`/eiffelsvn

# get the automatic build script build-studio

wget http://se.inf.ethz.ch/people/schoeller/download/build-studio
chmod +x build-studio

# roll your first eiffel compiler

./build-studio

# go to sleep and don't touch your computer (your memory's gonna get flushed 
# make sure you have enough swap or the kernel will kill ec)

# build the first delivery

mkdir eiffel01
export EIFFEL01=`pwd`/eiffel01
cp -r $EIFFEL_SVN/Src/Delivery/studio $EIFFEL_SVN/Src/Delivery/eifinit $EIFFEL01
mkdir $EIFFEL01/studio/spec/$ISE_PLATFORM
mkdir $EIFFEL01/studio/spec/$ISE_PLATFORM/bin
mkdir $EIFFEL01/studio/spec/$ISE_PLATFORM/include
mkdir $EIFFEL01/studio/spec/$ISE_PLATFORM/lib
mkdir $EIFFEL01/studio/help/defaults/$ISE_PLATFORM
mkdir $EIFFEL01/studio/config/$ISE_PLATFORM
cp $EIFFEL01/studio/spec/unix/*       $EIFFEL01/studio/spec/$ISE_PLATFORM/bin
cp $EIFFEL01/studio/config/unix/*     $EIFFEL01/studio/config/$ISE_PLATFORM
cp $EIFFEL_SVN/Src/C/run-time/*.h     $EIFFEL01/studio/spec/$ISE_PLATFORM/include
cp $EIFFEL_SVN/Src/C/config.sh        $EIFFEL01/studio/spec/$ISE_PLATFORM/include
cp $EIFFEL_SVN/Src/C/run-time/lib*    $EIFFEL01/studio/spec/$ISE_PLATFORM/lib
cp $EIFFEL_SVN/Src/C/run-time/x2c     $EIFFEL01/studio/spec/$ISE_PLATFORM/bin
cp $EIFFEL_SVN/Src/ipc/daemon/estudio $EIFFEL01/studio/spec/$ISE_PLATFORM/bin
cp build/es                           $EIFFEL01/studio/spec/$ISE_PLATFORM/bin

# now we have a kind of working delivery

export ISE_EIFFEL=$EIFFEL01
export ISE_LIBRARY=$EIFFEL_SVN/Src
export PATH=$EIFFEL01/studio/spec/$ISE_PLATFORM/bin:$PATH

# say hello to your newly compiled
estudio

# now we want to compile the eiffel compiler natively .. we have to patch the 
# build-studio script

cp build-studio build-studio.new

patch -p1 << EOT
diff -Naur a/build-studio.new b/build-studio.new
--- a/build-studio.new  2006-05-02 19:44:12.000000000 +0200
+++ b/build-studio.new  2006-05-02 19:44:18.000000000 +0200
@@ -129,6 +129,7 @@
 cd $BUILD_DIR
 cp "$EIFFEL_SRC/Eiffel/Ace/batch.unix.ace" batch.ace
 cp "$EIFFEL_SRC/Eiffel/Ace/newbench.linux.ace" ide.ace
+cp "$EIFFEL_SRC/Eiffel/Ace/ec.acex" ec.acex
 # sed -i 's+Eiffel/common+common+g' batch.ace
 # sed -i 's+Eiffel/common+common+g' ide.ace
 echo "done."
@@ -137,7 +138,8 @@
 then
     echo -n "Compiling batch ... "
     cd $BUILD_DIR
-    ec -stop -ace batch.ace -finalize > $ROOT_DIR/compile_batch.log 2>&1
+    #ec -stop -ace batch.ace -finalize > $ROOT_DIR/compile_batch.log 2>&1
+    ec -stop -config ec.acex -target batch -finalize > $ROOT_DIR/compile_batch.log 2>&1
     echo "done."
     if [ $? != 0 ]
        then
@@ -147,7 +149,8 @@
     fi
         
     echo -n "Patching the Makefile.SH ... "
-    cd $BUILD_DIR/EIFGEN/F_code
+    cd $BUILD_DIR/EIFGENs/batch/F_code
+    #cd $BUILD_DIR/EIFGEN/F_code
     sed -i 's/libmtcompiler.a/libmtwcompiler.a/g' Makefile.SH
     sed -i 's/\$(EXTERNALS) \$(EIFLIB)/\$\(EIFLIB\) \$\(EXTERNALS\)/g' \
        Makefile.SH
@@ -167,7 +170,8 @@
     echo -n "Compiling the IDE ... "
     cd $BUILD_DIR
     rm -rf EIFGEN *.epr
-    ec -stop -ace ide.ace -finalize > $ROOT_DIR/compile_ide.log 2>&1
+    #ec -stop -ace ide.ace -finalize > $ROOT_DIR/compile_ide.log 2>&1
+    ec -stop -config ec.acex -target bench -finalize > $ROOT_DIR/compile_ide.log 2>&1
     echo "done."
     if [ $? != 0 ]
        then
@@ -176,8 +180,9 @@
        exit 1
     fi
     
-    echo -n "Patching the Makefile ... "
-    cd $BUILD_DIR/EIFGEN/F_code
+    #echo -n "Patching the Makefile ... "
+    cd $BUILD_DIR/EIFGENs/bench/F_code
+    # cd $BUILD_DIR/EIFGEN/F_code
 #    sed -i 's/libmtcompiler.a/libmtwcompiler.a/g' Makefile.SH
 #    sed -i 's/\$(EXTERNALS) \$(EIFLIB)/\$\(EIFLIB\) \$\(EXTERNALS\)/g' \
 #      Makefile.SH
EOT

mv build build.old

chmod +x build-studio.new
./build-studio.new

# zzzz.. huh? ..woah! my first natively compiled ec!

cksfv build/ec $EIFFEL01/studio/spec/$ISE_PLATFORM/bin/ec

# build/ec                                    6E297D24
# $EIFFEL01/studio/spec/$ISE_PLATFORM/bin/ec  97994877
#
# hrm.. next turn:

mv $EIFFEL01/studio/spec/$ISE_PLATFORM/bin/ec $EIFFEL01/studio/spec/$ISE_PLATFORM/bin/ec.old
cp build/ec $EIFFEL01/studio/spec/$ISE_PLATFORM/bin/
mv build build.old2

./build-studio.new

#