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