Просмотр исходного кода

Packaging: make the binary packaging a self-extractible archive with an embedded setup (Patrick).
Update the scripts' description.
Don't use "-n" option of echo if not supported.

git-svn-id: file:///var/svn/tigccpp/trunk@1333 9552661e-59e3-4036-b4f2-dbe53926924f

debrouxl 15 лет назад
Родитель
Сommit
f5ed52dcef

Разница между файлами не показана из-за своего большого размера
+ 0 - 22
tigcc-linux/Install.sh


+ 13 - 5
tigcc-linux/scripts/Install

@@ -20,6 +20,14 @@
 # along with this program; if not, write to the Free Software Foundation,
 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
+oldecho=`echo -n test | grep '\-n'`
+if [ "x$oldecho" = "x" ]; then
+	#This echo supports '-n' (no newline)
+        echon="echo -n"
+else
+        echon=echo
+fi
+
 # Move into the script directory
 cd $(dirname $0)
 
@@ -29,7 +37,7 @@ echo "GCC4TI Installation Wizard"
 if [ -z "$PREFIX_GCC4TI" ]
 then PREFIX_GCC4TI="/usr/local/share/gcc4ti"
 fi
-echo -n "Destination directory ($PREFIX_GCC4TI) - will become \$TIGCC: "
+${echon} "Destination directory ($PREFIX_GCC4TI) - will become \$TIGCC: "
 read PREFIX_GCC4TInew
 # PpHd: use eval so that the user can enter e.g. $HOME/gcc4ti
 PREFIX_GCC4TInew=`eval echo "$PREFIX_GCC4TInew"`
@@ -42,7 +50,7 @@ export PREFIX_GCC4TI
 if [ -z "$CC" ]
 then CC="gcc"
 fi
-echo -n "Bootstrap compiler ($CC): "
+${echon} "Bootstrap compiler ($CC): "
 read CCnew
 if [ ! -z "$CCnew" ]
 then CC="$CCnew"
@@ -57,14 +65,14 @@ fi
 if [ -z "$CFLAGS" ]
 then CFLAGS="-Os -s -fno-exceptions -fomit-frame-pointer"
 fi
-echo -n "Optimization flags ($CFLAGS): "
+${echon} "Optimization flags ($CFLAGS): "
 read CFLAGSnew
 if [ ! -z "$CFLAGSnew" ]
 then CFLAGS="$CFLAGSnew"
 fi
 export CFLAGS
 
-echo -n "Host platform for the generated executables ($GCC4TIHOST), leave empty if not cross-compiling: "
+${echon} "Host platform for the generated executables ($GCC4TIHOST), leave empty if not cross-compiling: "
 read GCC4TIHOSTnew
 if [ ! -z "$GCC4TIHOSTnew" ]
 then GCC4TIHOST="$GCC4TIHOSTnew"
@@ -88,7 +96,7 @@ else
 fi
 
 # Now offer to install environment variables
-echo -n "Add environment settings (\$TIGCC, \$PATH) to bashrc [Y/n]? "
+${echon} "Add environment settings (\$TIGCC, \$PATH) to bashrc [Y/n]? "
 read AddEnvSettings
 echo
 if [ -z "$AddEnvSettings" -o "x$AddEnvSettings" = xy -o "x$AddEnvSettings" = xY ]

+ 10 - 9
tigcc-linux/scripts/SCRIPTS

@@ -4,22 +4,23 @@ User scripts:
 -------------
 
 - Install_All: call the Install_step_1 to Install_step_5 scripts
-- Install_All_nopatch: call the Install_step_2 to Install_step_5 scripts (if the sources are already patched)
+- Install_All_nopatch: call the Install_step_2 to Install_step_5 scripts
 
-- Install_step_1: apply a patch on the unpacked sources (binutils and gcc, placed in the download directory)
+- Install_step_1: unpack the sources if already downloaded (binutils and gcc, placed in ..), apply a patch on them if necessary.
 - Install_step_2: configure, compile, check and install both binutils & gcc from the download dir. Also compile and install a68k, ld-tigcc, tigcc, tprbuilder, patcher, parser.
 - Install_step_3: copy tigcclib files into the install tree
-- Install_step_4: install the TIGCC Tools Suite
+- Install_step_4: install the TI-68k Developer Utilities
 - Install_step_5: install several docs of the different programs
 
 
 Developer/Maintenance scripts:
 ------------------------------
 
-- updatedoc: import the documentation generated under Windows
-- updatesrc: import the cross-platform sources from the Windows tree
+- updatedoc: import the documentation generated under Windows or Wine, create a Qt Assistant 3.x documentation.
+- updatesrc: import the sources to a clean directory
 - launch.XYZ: compile, install and clean up XYZ
-- package_bin: create a bzip2 tarball of the $TIGCC directory. Used for
-               building a 'ready to install' binary package.
-- package_src: create a bzip2 tarball of the sources directory. Used for
-               building a source package.
+- package_bin: create a self-extractible archive of the $TIGCC directory, with a setup script.
+               Used for building a 'ready to install' binary package.
+- package_src: create a bzip2 tarball of the sources directory (created by updatesrc + updatedoc).
+               Used for building a source package.
+- setup.sh: setup script for the self-extractible archive generated by package_bin.

+ 21 - 16
tigcc-linux/scripts/package_bin

@@ -1,22 +1,27 @@
 #! /bin/sh
 #
-# This script creates a tarball of the binaries.
-# Everything must have been build prior to running this script.
+# This script creates an Unix installer (self-extractible archive) using
+# "makeself" ( http://megastep.org/makeself/ , package "makeself").
+# Everything must have been built and installed prior to running this script.
 #
 
-OUTDIR=../gcc4ti-sources
+if test \! -d $TIGCC ; then
+   echo "Directory TIGCC=$TIGCC not found."
+   exit 1
+fi
 
-echo GCC4TI script: Packaging binaries:
-#echo stripping...
-#strip $TIGCC/bin/*
-echo clamscan...
-clamscan -ir $TIGCC
-echo tar...
-PWDSAVE="`pwd`"
-cd $TIGCC
-tar -c --exclude=projects/* --exclude=bin/quill.drv --exclude=lib/quill.drv --exclude=lib/fargo.a -f "$PWDSAVE/$OUTDIR/gcc4ti_bin.tar" bin doc examples include lib projects
-cd "$PWDSAVE/$OUTDIR"
-echo bzip2...
-rm -f gcc4ti_bin.tar.bz2
-bzip2 -9 gcc4ti_bin.tar
+MY_PWD="`dirname $0`/.."
+if type makeself > /dev/null 2> /dev/null ; then
+MAKESELF=makeself
+elif type makeself.sh > /dev/null 2> /dev/null ; then
+MAKESELF=makeself.sh
+else
+    echo "MAKESELF not found. Can't generate installation script. Abort."
+    exit 2
+fi
+rm -rf /tmp/gcc4ti
+cp -r $TIGCC /tmp/gcc4ti
+cp $MY_PWD/scripts/setup.sh /tmp/gcc4ti
+$MAKESELF --bzip2 /tmp/gcc4ti $MY_PWD/gcc4ti-install.sh "GCC4TI Install" ./setup.sh
+rm -rf /tmp/gcc4ti
 echo Done.

+ 55 - 0
tigcc-linux/scripts/setup.sh

@@ -0,0 +1,55 @@
+#!/bin/sh
+
+oldecho=`echo -n test | grep '\-n'`
+if [ "x$oldecho" = "x" ]; then
+	#This echo supports '-n' (no newline)
+        echon="echo -n"
+else
+        echon=echo
+fi
+
+if test -z "$DISPLAY" ; then
+    echo "No X server."
+else
+    if test "x$1" != "x--run-myself" ; then
+	exec xterm -e $0 --run-myself
+    fi
+fi
+
+echo "GCC4TI Installation Wizard"
+
+I_AM_ROOT="`id | grep root`"
+
+# Get GCC4TI prefix directory
+if test -z "$I_AM_ROOT" ; then
+  PREFIX_GCC4TI=$HOME/gcc4ti
+else
+  PREFIX_GCC4TI="/usr/local/share/gcc4ti"
+fi
+${echon} "Destination directory ($PREFIX_GCC4TI) - will become \$TIGCC: "
+read PREFIX_GCC4TInew
+PREFIX_GCC4TInew=`eval echo "$PREFIX_GCC4TInew"`
+if [ ! -z "$PREFIX_GCC4TInew" ]
+then PREFIX_GCC4TI="$PREFIX_GCC4TInew"
+fi
+export PREFIX_GCC4TI
+
+# copy the file except setup.sh
+mkdir -p "$PREFIX_GCC4TI"
+cp -r . "$PREFIX_GCC4TI"
+rm -f "$PREFIX_GCC4TI"/setup.sh
+
+# Now offer to install environment variables
+${echon} "Add environment settings (\$TIGCC, \$PATH) to bashrc [Y/n]? "
+read AddEnvSettings
+echo
+if [ -z "$AddEnvSettings" -o "$AddEnvSettings" = y -o "$AddEnvSettings" = Y ]
+then
+    TIGCC=$PREFIX_GCC4TI
+    export TIGCC
+    $PREFIX_GCC4TI/bin/envreg
+    echo "Done. You must restart bash for the new environment settings to take effect."
+    exit 0;
+fi
+echo "Done. Make sure you set \$TIGCC to \"$PREFIX_GCC4TI\" and add \$TIGCC/bin to your \$PATH before using GCC4TI."
+exit 0

+ 0 - 4
tigcc-linux/scripts/updatesrc

@@ -110,10 +110,6 @@ cp -prf $TIGCCLINUXDIR/INSTALL $OUTDIR/
 cp -prf $TIGCCLINUXDIR/README.linux $OUTDIR/
 cp -prf $TIGCCLINUXDIR/README.osX $OUTDIR/
 
-echo Updating installation wizard...
-cp -prf $TIGCCLINUXDIR/Install.sh $OUTDIR/
-chmod +x $OUTDIR/Install.sh
-
 echo Updating scripts...
 cp -prf $TIGCCLINUXDIR/scripts/ $OUTDIR/
 chmod +x $OUTDIR/scripts/[^S]*

Некоторые файлы не были показаны из-за большого количества измененных файлов