diff options
author | knarf <knarf@5c1b1641-b641-47ec-b3d9-0f93d4c445ee> | 2010-06-26 04:16:48 +0000 |
---|---|---|
committer | knarf <knarf@5c1b1641-b641-47ec-b3d9-0f93d4c445ee> | 2010-06-26 04:16:48 +0000 |
commit | 7873a280d161202a081b59a5ba48bf5b40012d3a (patch) | |
tree | 1549e4e355608873729e00101cbec35c6562ebbc /LORENE.sh | |
parent | 0044cd7ed1b74aadf40553998c9c4dec412457a2 (diff) |
- Revert change from -I to -i. This makes LORENE compile with fink
again, but breaks it on abe. However, the culprit is abe: there is
a bug in the installed xargs installation (reported).
- Make LORENE abort early when the used version of 'patch' cannot
understand the patch format but fails silently.
- Use given XARGS and FIND environment variables to build Lorene.
This is necessary on machines where the standard 'xargs' and 'find'
tools are too old (like pelican which uses 'patch' from 1988 by default).
- Handle _rien.o better, in particular, don't include it in the
link list, which confused several linkers.
- Use find and xargs to link lorene libraries to avoid problems
on machines with very tight restrictions on command line lengths.
git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/LORENE/trunk@18 5c1b1641-b641-47ec-b3d9-0f93d4c445ee
Diffstat (limited to 'LORENE.sh')
-rw-r--r-- | LORENE.sh | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -59,7 +59,9 @@ if [ -z "${LORENE_DIR}" ]; then # Should we use gmake or make? MAKE=$(gmake --help > /dev/null 2>&1 && echo gmake || echo make) # Should we use gpatch or patch? - PATCH=$(gpatch -v > /dev/null 2>&1 && echo gpatch || echo patch) + if [ -z "$PATCH" ]; then + PATCH=$(gpatch -v > /dev/null 2>&1 && echo gpatch || echo patch) + fi # Should we use gtar or tar? TAR=$(gtar --help > /dev/null 2>&1 && echo gtar || echo tar) @@ -71,6 +73,19 @@ if [ -z "${LORENE_DIR}" ]; then ${PATCH} -p0 < ${SRCDIR}/dist/des.patch ${PATCH} -p0 < ${SRCDIR}/dist/makesystem.patch ${PATCH} -p0 < ${SRCDIR}/dist/pgplot.patch + # Some (ancient but still used) versions of patch don't support the + # patch format used here but also don't report an error using the + # exit code. So we use this patch to test for this + ${PATCH} -p0 < ${SRCDIR}/dist/patchtest.patch + if [ ! -e Lorene/.patch_tmp ]; then + echo 'BEGIN ERROR' + echo 'The version of patch is too old to understand this patch format.' + echo 'Please set the PATCH environment variable to a more recent ' + echo 'version of the patch command.' + echo 'END ERROR' + exit 1 + fi + rm -f Lorene/.patch_tmp # Prevent overly long lines for file in $(find ${NAME} -name '*.f'); do # Remove CVS Header comments @@ -93,7 +108,7 @@ CXXFLAGS_G = ${CXXFLAGS} F77 = ${F77} F77FLAGS = ${F77FLAGS} $($(echo ${F77} | grep -i xlf > /dev/null 2>&1) && echo '' -qfixed) F77FLAGS_G = ${F77FLAGS} $($(echo ${F77} | grep -i xlf > /dev/null 2>&1) && echo '' -qfixed) -INC = -I\$(HOME_LORENE)/C++/Include -I\$(HOME_LORENE)/C++/Include_extra $(echo ${GSL_INC_DIRS} | xargs -n 1 -i@ echo -I@) +INC = -I\$(HOME_LORENE)/C++/Include -I\$(HOME_LORENE)/C++/Include_extra $(echo ${GSL_INC_DIRS} | xargs -n 1 -I @ echo -I@) $($(echo '' ${ARFLAGS} | grep 64 > /dev/null 2>&1) && echo "export OBJECT_MODE=64") RANLIB = ${RANLIB} # We don't need dependencies since we always build from scratch @@ -107,6 +122,8 @@ LIB_PGPLOT = LIB_GSL = ${GSL_LIBS} DONTBUILDDEBUGLIB = yes EOF + if [ -n "$XARGS" ]; then echo "XARGS = $XARGS" >> local_settings; fi + if [ -n "$FIND" ]; then echo "FIND = $FIND" >> local_settings; fi echo "LORENE: Building..." export HOME_LORENE=${LORENE_DIR} |