From 47ca08ef00abb030e650d8a5c796329cb37302a6 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Fri, 25 Oct 2002 17:16:07 +0000 Subject: [PATCH] New eclass to update old config.guess and config.sub --- eclass/gnuconfig.eclass | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 eclass/gnuconfig.eclass diff --git a/eclass/gnuconfig.eclass b/eclass/gnuconfig.eclass new file mode 100644 index 000000000000..4809e245993d --- /dev/null +++ b/eclass/gnuconfig.eclass @@ -0,0 +1,39 @@ +#!/bin/bash +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author: Will Woods +# $Header: /var/cvsroot/gentoo-x86/eclass/gnuconfig.eclass,v 1.1 2002/10/25 17:16:07 wwoods Exp $ +# This eclass updates config.guess and config.sub. This is useful if +# configure dies from misguessing your canonical system name (CHOST). + +ECLASS=gnuconfig +INHERITED="$INHERITED $ECLASS" + +newdepend sys-devel/automake + +DESCRIPTION="Based on the ${ECLASS} eclass" + +# Copy the newest available config.{guess|sub} on the system over any old +# ones in the source dir +gnuconfig_update() { + local configsubs_dir="$(gnuconfig_findnewest)" + local sub + local f + einfo "Using GNU config files from ${configsubs_dir}" + for sub in config.sub config.guess ; do + for f in `find ${S} -name "${sub}"`; do + einfo "Updating ${f/$S\//}" + cp -f ${configsubs_dir}/${sub} ${f} + done + done +} + +# this searches the standard locations for the newest config.{sub|guess}, and +# returns the directory where they can be found. +gnuconfig_findnewest() { + local locations="/usr/share/automake-1.6/config.sub \ + /usr/share/automake-1.5/config.sub \ + /usr/share/automake-1.4/config.sub \ + /usr/share/libtool/config.sub" + grep -s '^timestamp' ${locations} | sort -n -t\' -k2 | tail -1 | sed 's,/config.sub:.*$,,' +} -- 2.26.2