aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@5c1b1641-b641-47ec-b3d9-0f93d4c445ee>2010-03-26 21:01:38 +0000
committerschnetter <schnetter@5c1b1641-b641-47ec-b3d9-0f93d4c445ee>2010-03-26 21:01:38 +0000
commitc65e998785a633d290677790776fd46bcc743bfd (patch)
tree7097db2f4ee8460130c8c55816ba4f31551e2791
parent35f3a8aacef038d0e61d494585a5138688f0867e (diff)
Break lines in Fortran 77 code automatically
git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/LORENE/trunk@9 5c1b1641-b641-47ec-b3d9-0f93d4c445ee
-rw-r--r--LORENE.sh26
-rw-r--r--dist/fortran.patch12
2 files changed, 16 insertions, 22 deletions
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