about summary refs log tree commit diff
path: root/test/Available-Testprog
blob: 033c7eec685ca9cf0dd90fcd1a8cc80e2a1b662a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#! /bin/bash

# If make target is "check-install" assume that all programs are available
if [ "${CHECK_TYPE}" = "install" ]; then
  exit 0
fi

# Special case: no arguments were passed to this program

if [ $# = 0 ]; then
  exit 0
fi

# Normal operation: Walk through the argument list and exit if an
# unavailable program is encountered.

# See http://netpbm.sourceforge.net/prereq.html and the makefiles in
# each directory (for example converter/other/Makefile) for library
# requirements and relevant variables.

# Note that any variable used to determine whether a program exists
# (BUILD_FIASCO, JASPERLIB, JBIGLIB, JPEGLIB, etc.)
# must be in CHECK_VARS in GNUMakefile to be detected here. 

for i in $@
    do
    case $i in
      fiascotopnm|\
      pnmtofiasco)
        [ "${BUILD_FIASCO}" = "N" ] && exit 1 ;;

      jpeg2ktopam|\
      pamtojpeg2k)
        [ "${JASPERLIB}" = "NONE" ] && exit 1 ;;

      jbigtopnm|\
      pnmtojbig)
        [ "${JBIGLIB}" = "NONE" ] && exit 1 ;;

      jpegtopnm|\
      pnmtojpeg|\
      ppmtojpeg)
        [ "${JPEGLIB}" = "NONE" ] && exit 1 ;;

      pamtotiff|\
      pnmtotiff|\
      pnmtotiffcmyk|\
      tifftopnm)
        [ "${TIFFLIB}" = "NONE" -o \
          "${JPEGLIB}" = "NONE" -o \
          "${ZLIB}" = "NONE" ] && exit 1 ;;

      pnmtorle|\
      rletopnm)
        [ "${URTLIB}" = "NONE" ] && exit 1 ;;

      pamx)
        [ "${X11LIB}" = "NONE" ] && exit 1 ;;

      svgtopam)
        [ "${XML2_LIBS}" = "NONE" ] && exit 1 ;;

      ppmsvgalib)
        [ "${LINUXSVGALIB}" = "NONE" ] && exit 1 ;;

      thinkjettopbm)
        [ -z "${LEX}" ] && exit 1 ;;

      zlib)
        [ "${ZLIB}" = "NONE" ] && exit 1 ;;

    esac
done

# All checks passed.  Exit with success status.
exit 0


# TODO: We don't have a good method for testing whether PNGLIB is
# available for linking.
# Affected programs: pamtopng, pngtopam, pngtopnm, pnmtopng