view tools/mk-hg-id.sh @ 5531:eae508c12529

Add build rule for build-octave (bug #49503). * src/build-octave.mk: Add new build rule for build-octave which can be used for cross-building binary packages that depend on Octave as a build tool. * dist-files.mk: Add new file to list. * index.html: Add new package to list. * src/of-communications.mk, src/of-image.mk, src/of-mapping.mk, src/of-optiminterp.mk, src/of-sparsersb.mk, src/of-statistics.mk, src/of-windows.mk: Add optional dependency on build-octave. * configure.ac: Add new configure switch "--disable-system-octave" that is needed to build the build-octave package. * Makefile.in: Add variable "USE_SYSTEM_OCTAVE". Exclude build-octave from the default build tools and build it only if a package explicitly depends on it. Display warning about missing native Octave version only if necessary.
author Markus Mützel <markus.muetzel@gmx.de>
date Tue, 08 Sep 2020 23:04:38 +0200
parents 5b5c47cd2111
children
line wrap: on
line source

#! /bin/sh
#
# Copyright (C) 2016-2018 John W. Eaton
#
# This file is part of Octave.
#
# Octave is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Octave is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Octave; see the file COPYING.  If not, see
# <http://www.gnu.org/licenses/>.

# Generate a file that holds the hg id of the mxe-octave source tree.

# set -e

if [ $# -ne 1 ]; then
  echo "usage: mk-hg-id.sh SRCDIR" 1>&2
  exit 1
fi

srcdir="$1"

hg_id=HG-ID

if [ -d $srcdir/.hg ]; then
  ( cd $srcdir && hg identify --id || echo "unknown" ) > ${hg_id}-t && mv ${hg_id}-t ${hg_id}
elif [ ! -f $srcdir/${hg_id} ]; then
  echo "WARNING: $srcdir/${hg_id} is missing!" 1>&2
  echo "unknown" > ${hg_id}-t && mv ${hg_id}-t ${hg_id}
else
  echo "preserving existing ${hg_id} file" 1>&2
  if [ "x$srcdir" != "x." ] && [ -f $srcdir/${hg_id} ] && [ ! -f ${hg_id} ]; then
    cp ${srcdir}/${hg_id} ${hg_id}
  fi
fi