Richard Levitte | 2962243 | 2002-05-30 15:19:43 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Nils Larsch | cd202fe | 2005-04-27 08:56:15 +0000 | [diff] [blame] | 3 | # This script is used by test/Makefile to check whether a sane 'pod2man' |
Richard Levitte | 2962243 | 2002-05-30 15:19:43 +0000 | [diff] [blame] | 4 | # is installed. |
| 5 | # ('make install' should not try to run 'pod2man' if it does not exist or if |
| 6 | # it is a broken 'pod2man' version that is known to cause trouble. if we find |
| 7 | # the system 'pod2man' to be broken, we use our own copy instead) |
| 8 | # |
| 9 | # In any case, output an appropriate command line for running (or not |
| 10 | # running) pod2man. |
| 11 | |
| 12 | |
| 13 | IFS=: |
Richard Levitte | ec9ea6a | 2002-07-18 12:37:59 +0000 | [diff] [blame] | 14 | if test "$OSTYPE" = "msdosdjgpp"; then IFS=";"; fi |
Bodo Möller | 623e9e6 | 2002-08-14 14:04:24 +0000 | [diff] [blame] | 15 | |
| 16 | try_without_dir=true |
Richard Levitte | 2962243 | 2002-05-30 15:19:43 +0000 | [diff] [blame] | 17 | # First we try "pod2man", then "$dir/pod2man" for each item in $PATH. |
Richard Levitte | 1cc67fa | 2002-07-23 13:31:04 +0000 | [diff] [blame] | 18 | for dir in dummy${IFS}$PATH; do |
Richard Levitte | 2962243 | 2002-05-30 15:19:43 +0000 | [diff] [blame] | 19 | if [ "$try_without_dir" = true ]; then |
| 20 | # first iteration |
| 21 | pod2man=pod2man |
| 22 | try_without_dir=false |
| 23 | else |
| 24 | # second and later iterations |
| 25 | pod2man="$dir/pod2man" |
| 26 | if [ ! -f "$pod2man" ]; then # '-x' is not available on Ultrix |
| 27 | pod2man='' |
| 28 | fi |
| 29 | fi |
| 30 | |
| 31 | if [ ! "$pod2man" = '' ]; then |
| 32 | failure=none |
| 33 | |
Bodo Möller | 623e9e6 | 2002-08-14 14:04:24 +0000 | [diff] [blame] | 34 | if "$pod2man" --section=1 --center=OpenSSL --release=dev pod2mantest.pod | fgrep OpenSSL >/dev/null; then |
| 35 | : |
| 36 | else |
| 37 | failure=BasicTest |
| 38 | fi |
Richard Levitte | 2962243 | 2002-05-30 15:19:43 +0000 | [diff] [blame] | 39 | |
Bodo Möller | 623e9e6 | 2002-08-14 14:04:24 +0000 | [diff] [blame] | 40 | if [ "$failure" = none ]; then |
| 41 | if "$pod2man" --section=1 --center=OpenSSL --release=dev pod2mantest.pod | grep '^MARKER - ' >/dev/null; then |
| 42 | failure=MultilineTest |
| 43 | fi |
Richard Levitte | 2962243 | 2002-05-30 15:19:43 +0000 | [diff] [blame] | 44 | fi |
| 45 | |
| 46 | |
| 47 | if [ "$failure" = none ]; then |
| 48 | echo "$pod2man" |
| 49 | exit 0 |
| 50 | fi |
| 51 | |
| 52 | echo "$pod2man does not work properly ('$failure' failed). Looking for another pod2man ..." >&2 |
| 53 | fi |
| 54 | done |
| 55 | |
| 56 | echo "No working pod2man found. Consider installing a new version." >&2 |
Bodo Möller | 623e9e6 | 2002-08-14 14:04:24 +0000 | [diff] [blame] | 57 | echo "As a workaround, we'll use a bundled old copy of pod2man.pl." >&2 |
| 58 | echo "$1 ../../util/pod2man.pl" |