annotate GEMBASSY-1.0.3/m4/hpdf.m4 @ 1:84a17b3fad1f draft

Uploaded
author ktnyt
date Fri, 26 Jun 2015 05:20:29 -0400
parents 8300eb051bea
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
1 dnl @synopsis CHECK_HPDF()
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
2 dnl
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
3 dnl This macro searches for an installed libhpdf (libharu) library. If nothing
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
4 dnl was specified when calling configure, it first searches in /usr/local
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
5 dnl and then in /usr. If the --with-hpdf=DIR is specified, it will try
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
6 dnl to find it in DIR/include and DIR/lib.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
7 dnl
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
8 dnl It defines the symbol PLD_pdf if the library is found.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
9 dnl
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
10
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
11
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
12 AC_DEFUN([CHECK_HPDF],
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
13 #
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
14 # Handle user hints
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
15 #
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
16 [AC_MSG_CHECKING([whether to look for pdf support])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
17 AC_ARG_WITH([hpdf],
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
18 [AS_HELP_STRING([--with-hpdf=DIR],
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
19 [root directory path of hpdf installation @<:@defaults to /usr@:>@])],
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
20 [if test "$withval" != no ; then
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
21 AC_MSG_RESULT(yes)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
22 ALT_HOME="$withval"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
23 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
24 AC_MSG_RESULT([no])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
25 fi], [
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
26 AC_MSG_RESULT([yes])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
27 ALT_HOME=/usr
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
28 ])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
29
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
30
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
31 #
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
32 # Locate hpdf
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
33 #
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
34 if test -d "${ALT_HOME}"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
35 then
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
36
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
37 #
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
38 # Keep a copy if it fails
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
39 #
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
40 ALT_LDFLAGS="$LDFLAGS"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
41 ALT_CPPFLAGS="$CPPFLAGS"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
42
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
43 #
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
44 # Set
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
45 #
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
46 LDFLAGS="${LDFLAGS} -L${ALT_HOME}/lib"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
47 CPPFLAGS="$CPPFLAGS -I$ALT_HOME/include"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
48
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
49 #
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
50 # Check for libharu in ALT_HOME
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
51 #
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
52 AC_CHECK_LIB(hpdf, HPDF_New, CHECK=1, CHECK=0, -L${ALT_HOME}/lib)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
53 #
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
54 #
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
55 # If everything found okay then proceed to include png driver in config.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
56 #
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
57 if test $CHECK = "1" ; then
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
58 LIBS="$LIBS -lhpdf"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
59
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
60 case $host_os in
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
61 solaris*)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
62 LDFLAGS="$LDFLAGS -R$ALT_HOME/lib"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
63 ;;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
64 esac
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
65
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
66 AC_DEFINE([PLD_pdf], [1], [Define to 1 if PDF support is available])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
67 AM_CONDITIONAL(AMPDF, true)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
68 echo PDF support found
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
69 if test $ALT_HOME = "/usr" ; then
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
70 LDFLAGS="$ALT_LDFLAGS"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
71 CPPFLAGS="$ALT_CPPFLAGS"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
72 fi
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
73 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
74 #
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
75 # If not okay then reset FLAGS.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
76 #
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
77 AM_CONDITIONAL(AMPDF, false)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
78 LDFLAGS="$ALT_LDFLAGS"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
79 CPPFLAGS="$ALT_CPPFLAGS"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
80 echo "No pdf support (libhpdf) found."
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
81 fi
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
82
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
83 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
84 if test $withval != "no"; then
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
85 echo "Directory $ALT_HOME does not exist"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
86 exit 0
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
87 fi
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
88 fi
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
89 ])