Mercurial > mxe-octave
view mk-dist @ 3426:b3554ecfaff2
Makefile.in: If using lib64 directory set PKG_CONFIG_PATH in environment.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 14 Jan 2014 00:12:46 -0500 |
parents | f79780bcc843 |
children |
line wrap: on
line source
#! /bin/bash set -e ## Override with --jobs option or set JOBS variable in settings.mk jobs=0 OCTAVE_TARGET=octave TOPDIR=$(pwd) PATH=$TOPDIR/usr/bin:$PATH TARGET=i686-pc-mingw32 PREFIX=/usr/$TARGET STRIP=$TARGET-strip DATE=$(date +%Y-%m-%d-%H-%M) OCTAVE_DIST_NAME=octave-$DATE INSTALLER_PKG= strip=yes installer=no while [ $# -gt 0 ]; do case "$1" in --jobs) shift if [ $# -gt 0 ]; then jobs=$1 shift else echo "mk-dist: expecting argument for --jobs option" 1>&2 exit 1 fi ;; --stable) # for stable, use octave-version as the folder OCTAVE_TARGET=stable-octave shift ;; --no-strip) strip=no shift ;; --installer) installer=yes echo "making installer" shift ;; *) echo "mk-dist: unrecognized option: $1" 1>&2 exit 1 ;; esac done if [ $installer = "yes" ]; then echo "Adding installer to build dependancies" INSTALLER_PKG="nsis" fi echo "deleting previous dist directory..." rm -rf $TOPDIR/dist echo "building octave and dependencies..." if [ $jobs -gt 0 ]; then make $OCTAVE_TARGET $INSTALLER_PKG msys-base native-gcc native-binutils octave-forge-packages npp units transfig JOBS=$jobs else make $OCTAVE_TARGET $INSTALLER_PKG msys-base native-gcc native-binutils octave-forge-packages npp units transfig fi OCTAVE_VERSION=`head -1 $TOPDIR/octave/octave-version` if [ "$OCTAVE_TARGET" = "stable-octave" ]; then # if building stable version, use the octave version number aspart of # the dist name OCTAVE_DIST_NAME=octave-$OCTAVE_VERSION fi # make dist folder OCTAVE_DIST_DIR=$TOPDIR/dist/$OCTAVE_DIST_NAME mkdir -p $OCTAVE_DIST_DIR echo "generating lists of files to exclude..." echo " native files..." cat > $TOPDIR/excluded-native-files << EOF ./$TARGET ./bin/$TARGET-*.exe EOF echo " gcc cross compiler files..." cd $TOPDIR/cross-tools/$TOPDIR/$PREFIX find . -type f -o -type l | sed "s,./,," > $TOPDIR/excluded-gcc-files echo "copying files..." echo " octave and dependencies..." cd $TOPDIR/$PREFIX tar -c -h -X $TOPDIR/excluded-gcc-files -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - ) cp $TOPDIR/build_packages.m $OCTAVE_DIST_DIR/src echo " octaverc file..." cp $TOPDIR/octaverc $OCTAVE_DIST_DIR/share/octave/site/m/startup/octaverc echo " native tools..." cd $TOPDIR/native-tools/usr tar -c -h -X $TOPDIR/excluded-native-files -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - ) echo " libgcc_s_dw2-1.dll to bin directory" cd $OCTAVE_DIST_DIR cp lib/gcc/i686-pc-mingw32/libgcc_s_dw2-1.dll bin echo " msys base files..." cd $TOPDIR/msys-base tar -c -h -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - ) echo " msys extension files..." cd $TOPDIR/msys-extension tar -c -h -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - ) echo " notepad++..." cd $TOPDIR tar -c -h -f - notepad++ | ( cd $OCTAVE_DIST_DIR ; tar xpf - ) cp $TOPDIR/build_packages.m $OCTAVE_DIST_DIR/src echo "making all files writable by user..." chmod -R u+w $OCTAVE_DIST_DIR if [ $strip = "yes" ]; then echo "stripping files..." cd $OCTAVE_DIST_DIR for f in $(find . -name '*.dll' -o -name '*.exe'); do echo " $f" $STRIP $f done fi cd $TOPDIR/dist if [ $installer = "yes" ]; then ../makeinst-script.sh $OCTAVE_DIST_NAME echo "Generating installer ..." $TOPDIR/usr/bin/$TARGET-makensis octave.nsi > /dev/null if [ -e octave-$OCTAVE_VERSION-installer.exe ]; then echo "Installer created" rm octave.nsi fi else echo "creating zip file..." zip -q -9 -r $OCTAVE_DIST_DIR.zip $OCTAVE_DIST_NAME fi