#!/bin/sh # Build Eiffel Studio # Changelog # - 20.4.2006 Update for the move of the 'C' and 'Eiffel' directory # from Src/bench to Src/ # Requirements: # - Checkout of the EiffelStudio trunk pointed to by EIFFEL_SVN ROOT_DIR=`pwd` BUILD_DIR="$ROOT_DIR/build" BATCH_ONLY="NO" if [ ! -d "$EIFFEL_SVN/Src" ] then echo "You must have EIFFEL_SVN setup to the trunk directory." exit 1 fi if [ ! -d "$ISE_EIFFEL" ] then echo "You must have ISE_EIFFEL point to a 57 version of Eiffel." exit 1 fi if [ ! -x `which ec` ] then echo "'ec' must be in you path." exit 1 fi if ! ec -version | grep -q 'version 5.7' then echo "Your eiffel compiler must be version 5.7" echo "Yours reports:" ec -version exit 1 fi if [ -x "$BUILD_DIR" ] then echo -n "Build directory exists, do you want to remove it first? [y/n] " read yesno if [ "$yesno" = "y" ] then rm -rf "$BUILD_DIR" else echo "Building aborted." exit 1 fi fi # ---------------------------------------------------------------------- # We set up a correct directory structure by using links. echo -n "Setting up directory structure ... " mkdir "$BUILD_DIR" cd "$BUILD_DIR" export EIFFEL_SRC=`pwd` for dir in $EIFFEL_SVN/Src/* do ln -s $dir done ln -s $EIFFEL_SVN/Delivery # ln -s $EIFFEL_SVN/Src/bench/Eiffel echo "done." # ---------------------------------------------------------------------- # We have to setup all dependencies echo -n "Unpacking GOBO ... " cd $EIFFEL_SRC/library tar xzf $EIFFEL_SVN/free_add_ons/gobo/gobo_34_unix.tgz echo "done." # ---------------------------------------------------------------------- # Building the run-time echo -n "Building run-time system ... " echo -n "Run-time compilation" > $ROOT_DIR/run_time_compile.log cd $EIFFEL_SRC/C if [ -f Makefile ] then make clobber >> $ROOT_DIR/run_time_compile.log if [ $? != 0 ] then echo "Error cleaning up the run-time system." echo "Check run_time_compile.log" exit 1 fi fi ./quick_configure >> $ROOT_DIR/run_time_compile.log 2>&1 echo "done." if [ $? != 0 ] then echo "Error compiling the run-time system." echo "Check run_time_compile.log" exit 1 fi # ---------------------------------------------------------------------- # Building all C libraries echo "Building C libraries:" echo -n "Event ... " cd $EIFFEL_SRC/library/event/Clib finish_freezing -library > $ROOT_DIR/compile_event_lib.log 2>&1 echo "done." echo -n "Net ... " cd $EIFFEL_SRC/library/net/Clib finish_freezing -library > $ROOT_DIR/compile_net_lib.log 2>&1 echo "done." echo -n "Vision2 ... " cd $EIFFEL_SRC/library/vision2/Clib finish_freezing -library > $ROOT_DIR/compile_vision2_lib.log 2>&1 echo "done." echo -n "Vision2 Implementation ... " cd $EIFFEL_SRC/library/vision2/implementation/gtk/Clib finish_freezing -library > $ROOT_DIR/compile_vision2_impl_lib.log 2>&1 echo "done." # ---------------------------------------------------------------------- # Compiling 'ec' and 'estudio' echo -n "Configuring Ace files ... " cd $BUILD_DIR cp "$EIFFEL_SRC/Eiffel/Ace/batch.unix.ace" batch.ace cp "$EIFFEL_SRC/Eiffel/Ace/newbench.linux.ace" ide.ace # sed -i 's+Eiffel/common+common+g' batch.ace # sed -i 's+Eiffel/common+common+g' ide.ace echo "done." if [ "$BATCH_ONLY" = "YES" ] then echo -n "Compiling batch ... " cd $BUILD_DIR ec -stop -ace batch.ace -finalize > $ROOT_DIR/compile_batch.log 2>&1 echo "done." if [ $? != 0 ] then echo "Error compiling the batch-compiler." echo "Check compile_batch.log" exit 1 fi echo -n "Patching the Makefile.SH ... " 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 echo "done." echo -n "Freezing batch ... " finish_freezing > $ROOT_DIR/freeze_batch.log 2>&1 mv ec $BUILD_DIR echo "done." if [ ! -f "$BUILD_DIR/ec" ] then echo "Error freezing the batch-compiler." echo "Check freeze_batch.log" exit 1 fi else 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 echo "done." if [ $? != 0 ] then echo "Error compiling the IDE." echo "Check compile_ide.log" exit 1 fi echo -n "Patching the Makefile ... " 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 echo "done." echo -n "Freezing the IDE ... " finish_freezing > $ROOT_DIR/freeze_ide.log 2>&1 mv ec $BUILD_DIR echo "done." if [ ! -f "$BUILD_DIR/ec" ] then echo "Error freezing the IDE." echo "Check freeze_ide.log" exit 1 fi fi