From c65e998785a633d290677790776fd46bcc743bfd Mon Sep 17 00:00:00 2001 From: schnetter Date: Fri, 26 Mar 2010 21:01:38 +0000 Subject: Break lines in Fortran 77 code automatically git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/LORENE/trunk@9 5c1b1641-b641-47ec-b3d9-0f93d4c445ee --- LORENE.sh | 26 ++++++++++++++++---------- dist/fortran.patch | 12 ------------ 2 files changed, 16 insertions(+), 22 deletions(-) delete mode 100644 dist/fortran.patch diff --git a/LORENE.sh b/LORENE.sh index 1f9c636..fd2974e 100644 --- a/LORENE.sh +++ b/LORENE.sh @@ -49,19 +49,25 @@ unset MAKEFLAGS pushd build-${NAME} ${TAR} xzf ${SRCDIR}/dist/${NAME}.tar.gz ${PATCH} -p0 < ${SRCDIR}/dist/des.patch - ${PATCH} -p0 < ${SRCDIR}/dist/fortran.patch ${PATCH} -p0 < ${SRCDIR}/dist/pgplot.patch ${PATCH} -p0 < ${SRCDIR}/dist/spheroid.patch - # Prevent overly long lines from CVS Header comments - find ${NAME} -name '*.f' | - xargs perl -pi -e 's/\$Header.*\$/\$Header\$/g' + # Prevent overly long lines + for file in $(find ${NAME} -name '*.f'); do + # Remove CVS Header comments + perl -pi -e 's{\$Header.*\$}{\$Header\$}g' $file + # Replace tabs with eight blanks + perl -pi -e 's{\t}{ }' $file + # Remove in-line comments (in lines without quotes) + perl -pi -e 's{^([^'\''"]*?)!.*$}{$1}' $file + # Break long lines + perl -pi -e 's{^([ 0-9].{71})(.+)}{$1\n \$$2}' $file + done # Do not build the debug version of the Lorene libraries - find ${NAME} -name Makefile | - xargs perl -pi -e 's+ \$\(MAKE\) -f Makefile_lib_g+# \$(MAKE) -f Makefile_lib_g+' - find ${NAME} -name Makefile | - xargs perl -pi -e 's+ mv \*.o Objects_g+# mv *.o Objects_g+' - find ${NAME} -name Makefile | - xargs perl -pi -e 's+install: \$\(LIB\) \$\(LIB\)/liblorenef77_g.a \$\(LIB\)/liblorenef77.a+install: \$(LIB) \$(LIB)/liblorenef77.a+' + for file in $(find ${NAME} -name Makefile); do + perl -pi -e 's{\t\$\(MAKE\) -f Makefile_lib_g}{#\t\$(MAKE) -f Makefile_lib_g}' $file + perl -pi -e 's{\tmv \*.o Objects_g}{#\tmv *.o Objects_g}' $file + perl -pi -e 's{install: \$\(LIB\) \$\(LIB\)/liblorenef77_g.a \$\(LIB\)/liblorenef77.a}{install: \$(LIB) \$(LIB)/liblorenef77.a}' $file + done popd echo "LORENE: Configuring..." diff --git a/dist/fortran.patch b/dist/fortran.patch deleted file mode 100644 index 874c7a9..0000000 --- a/dist/fortran.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ru Lorene.orig/F77/Source/Poisson2d/fcer3s.f Lorene/F77/Source/Poisson2d/fcer3s.f ---- Lorene.orig/F77/Source/Poisson2d/fcer3s.f 2001-11-20 09:19:30.000000000 -0600 -+++ Lorene/F77/Source/Poisson2d/fcer3s.f 2009-11-25 21:48:21.000000000 -0600 -@@ -206,7 +206,7 @@ - C - C INITIALISATION. - C -- IF (NCY.EQ.NY1.AND.NCZ.EQ.NZ1.AND.NCR.EQ.NR1.AND.NEQ.EQ.NNN64) GO TO 800 -+ IF (NCY.EQ.NY1.AND.NCZ.EQ.NZ1.AND.NCR.EQ.NR1.AND.NEQ.EQ.NNN64) GOTO 800 - C - NCR=NR1 - NCY=NY1 -- cgit v1.2.3