From 697f6b2ff5a596ab8a6a0f4ff0b4ebfb2a4010e7 Mon Sep 17 00:00:00 2001 From: Craig Burley Date: Sat, 11 Sep 1999 21:53:17 +0000 Subject: [PATCH] New shell scripts to ease dealing with Netlib f2c vis-a-vis g77 libg2c From-SVN: r29346 --- contrib/ChangeLog | 4 +++ contrib/convert_to_f2c | 48 ++++++++++++++++++++++++++ contrib/convert_to_g2c | 48 ++++++++++++++++++++++++++ contrib/download_f2c | 77 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 177 insertions(+) create mode 100755 contrib/convert_to_f2c create mode 100755 contrib/convert_to_g2c create mode 100755 contrib/download_f2c diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 046d4a468bd..fe071c27f06 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,7 @@ +1999-09-11 Craig Burley + + * convert_to_f2c, convert_to_g2c, download_f2c: New file. + 1999-08-16 Gerald Pfeifer * gcc_update: New file. diff --git a/contrib/convert_to_f2c b/contrib/convert_to_f2c new file mode 100755 index 00000000000..9a499fcf14c --- /dev/null +++ b/contrib/convert_to_f2c @@ -0,0 +1,48 @@ +#!/bin/sh +# +# convert_to_f2c [g2c-dir] +# +# Renames certain files in a g2c (libg2c) directory so they no longer have the +# `.netlib' suffix, a la netlib's f2c distribution. If `g2c-dir' is not +# specified, `g2c-YYYYMMDD' is the default, where YYYYMMDD is the current +# date. The directory is renamed such that the first `g' becomes an `f', +# usually `g2c-YYYYMMDD' -> `f2c-YYYYMMDD'. +# +# (C) 1999 Free Software Foundation +# Originally by James Craig Burley , September 1999. +# +# This script is Free Software, and it can be copied, distributed and +# modified as defined in the GNU General Public License. A copy of +# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html + +set -e + +if [ x$1 = x ] +then + dir=g2c-`date +%Y%m%d` +else + dir=$1 +fi + +newdir=`echo $dir | sed -e "s:g:f:"` + +cd $dir + +set +e + +mv -i changes.netlib changes +mv -i disclaimer.netlib disclaimer +mv -i g2c.hin f2c.h +mv -i permission.netlib permission +mv -i readme.netlib readme +cd libF77 +mv -i README.netlib README +mv -i makefile.netlib makefile +cd ../libI77 +mv -i README.netlib README +mv -i makefile.netlib makefile +cd .. + +cd .. + +mv -iv $dir $newdir diff --git a/contrib/convert_to_g2c b/contrib/convert_to_g2c new file mode 100755 index 00000000000..5d05f84e393 --- /dev/null +++ b/contrib/convert_to_g2c @@ -0,0 +1,48 @@ +#!/bin/sh +# +# convert_to_g2c [f2c-dir] +# +# Renames certain files in a netlib f2c directory so they have the `.netlib' +# suffix, a la g77's version of f2c (libg2c). If `f2c-dir' is not specified, +# `f2c-YYYYMMDD' is the default, where YYYYMMDD is the current date. +# The directory is renamed such that the first `f' becomes a `g', +# usually `f2c-YYYYMMDD' -> `g2c-YYYYMMDD'. +# +# (C) 1999 Free Software Foundation +# Originally by James Craig Burley , September 1999. +# +# This script is Free Software, and it can be copied, distributed and +# modified as defined in the GNU General Public License. A copy of +# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html + +set -e + +if [ x$1 = x ] +then + dir=f2c-`date +%Y%m%d` +else + dir=$1 +fi + +newdir=`echo $dir | sed -e "s:f:g:"` + +cd $dir + +set +e + +mv -i changes changes.netlib +mv -i disclaimer disclaimer.netlib +mv -i f2c.h g2c.hin +mv -i permission permission.netlib +mv -i readme readme.netlib +cd libF77 +mv -i README README.netlib +mv -i makefile makefile.netlib +cd ../libI77 +mv -i README README.netlib +mv -i makefile makefile.netlib +cd .. + +cd .. + +mv -iv $dir $newdir diff --git a/contrib/download_f2c b/contrib/download_f2c new file mode 100755 index 00000000000..159c52e7d87 --- /dev/null +++ b/contrib/download_f2c @@ -0,0 +1,77 @@ +#!/bin/sh +# +# download_f2c +# +# Unpacks a directory full of f2c stuff obtained from netlib, naming +# the directory f2c-YYYYMMDD (YYYYMMDD being the current date), +# leaving it in current working directory. +# +# This shell script downloads the tarball from netlib, unpacks everything, +# and strips off the redundant files, leaving a bare-bones (but fully +# reproducible) f2c source directory. (You must have yacc/bison to rebuild +# gram.c, by the way.) +# +# (C) 1999 Free Software Foundation +# Originally by James Craig Burley , September 1999. +# +# This script is Free Software, and it can be copied, distributed and +# modified as defined in the GNU General Public License. A copy of +# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html +# +# FIXME: Replace WHOAMI with whatever is the canonical way to +# obtain the user's email address these days. + +dir=f2c-`date +%Y%m%d` +if [ ! -d $dir ] +then + mkdir $dir +fi +cd $dir + +echo Preparing $dir... + +if [ ! -d tmp ] +then + mkdir tmp +fi + +if [ ! -f tmp/f2c.tar ] +then + cd tmp + echo Downloading f2c.tar via ftp... + ftp -n netlib.bell-labs.com < /dev/null && rm libf77 +rm -f libF77/xsum0.out libF77/libF77.xsum +sh libi77 > /dev/null && rm libi77 +rm -f libI77/xsum0.out libI77/libI77.xsum +rm -f src/xsum0.out +touch src/xsum.out +cmp f2c.h src/f2c.h && rm -fv src/f2c.h +cmp src/readme src/README && rm -fv src/readme + +echo Deleting f2c.tar... +rm tmp/f2c.tar +rmdir tmp + +cd .. + +echo Latest f2c now in $dir.