diff options
author | axel <axel@liljencrantz.se> | 2006-11-03 23:16:21 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-11-03 23:16:21 +1000 |
commit | 8aac7e82c07b5f3054898506db235cbd2791ad61 (patch) | |
tree | 9bc073d3bc033a4154b73c50d4bdbbac451743fd /configure.ac | |
parent | 49e300d0caa8dfe5f81de09a169c28ec0f26b806 (diff) |
Try to detect seq versions installed by earlier fish versions and replace them
darcs-hash:20061103131621-ac50b-2748c958f8614f39fbaa7a45261877a912de539e.gz
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 2ad2cbd6..0b2b4013 100644 --- a/configure.ac +++ b/configure.ac @@ -147,6 +147,29 @@ AC_PROG_INSTALL AC_CHECK_PROG( SEQ_FALLBACK, seq, [ ], [seq]) +if test "$SEQ_FALLBACK"; then + + # + # We already have seq. Check if the seq version is installed by an + # earlier fish version. If it is, we'll replace it. + # + + file=`which seq` + if test -f "$file"; then + + AC_MSG_CHECKING([if seq comes from a previous fish version]) + shebang=`grep "\(^#!/.*/fish\|^#!/usr/bin/env fish\)" $file` + + if test "$shebang"; then + AC_SUBST( SEQ_FALLBACK, seq ) + AC_MSG_RESULT(yes, replace it) + else + AC_MSG_RESULT(no, keep it) + fi + fi +fi + + # # Optionally drop xsel command # |