summaryrefslogtreecommitdiffstats
path: root/kpdf/configure.in.in
blob: db883adb47a5bf60fe6b8b7970ae9d383a6e5818 (plain)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
dnl ##### Check for FreeType 2.0.5+.
dnl ##### (Note: FT_Get_Name_Index was added in FT 2.0.5, and is
dnl ##### the reason that Xpdf requires 2.0.5+.)

KDE_FIND_PATH(freetype-config, FREETYPE_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [
  AC_MSG_WARN([Could not find libfreetype anywhere, check http://www.freetype.org/])
])

if test -n "$FREETYPE_CONFIG"; then
  FREETYPE_VERSION=`$FREETYPE_CONFIG --version 2>/dev/null | sed -e 's/libfreetype //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
  if test -n "$FREETYPE_VERSION" && test "$FREETYPE_VERSION" -ge 9000000; then
    LIBFREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
    LIBFREETYPE_RPATH=
    for args in $LIBFREETYPE_LIBS; do
      case $args in
        -L*) LIBFREETYPE_RPATH="$LIBFREETYPE_RPATH $args" ;;
      esac
    done
    LIBFREETYPE_RPATH=`echo $LIBFREETYPE_RPATH | sed -e "s/-L/-R/g"`
    LIBFREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
    AC_DEFINE_UNQUOTED(HAVE_FREETYPE, 1, [Defines if your system has the freetype library])
  else
    AC_MSG_WARN([You need at least libfreetype 2.0.5])
    DO_NOT_COMPILE="$DO_NOT_COMPILE kpdf"
  fi
else
  DO_NOT_COMPILE="$DO_NOT_COMPILE kpdf"
fi

AC_SUBST(FREETYPE_VERSION)
AC_SUBST(LIBFREETYPE_LIBS)
AC_SUBST(LIBFREETYPE_CFLAGS)
AC_SUBST(LIBFREETYPE_RPATH)

# Check for dirent
AC_HEADER_DIRENT

# Check for xft
KDE_PKG_CHECK_MODULES(XFT, xft >= 2.0, ,
  # This older xft-config stuff can (eventually) go away.
  KDE_FIND_PATH(xft-config, XFT_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin],)
  if "$XFT_CONFIG"; then
    XFT_CFLAGS="`$XFT_CONFIG --cflags`"
    XFT_LIBS="`$XFT_CONFIG --libs`"
  fi
  AC_SUBST(XFT_CFLAGS)
  AC_SUBST(XFT_LIBS)
)

if test -z "$XFT_LIBS"; then
        DO_NOT_COMPILE="$DO_NOT_COMPILE kpdf"
fi

dnl ##### Check for libpaper (Debian).
LIBPAPER_LIBS=
KDE_CHECK_HEADER(paper.h, [
  LIBPAPER_LIBS='-lpaper'
  AC_DEFINE_UNQUOTED(HAVE_PAPER_H, 1, [Define to 1 if you have the <paper.h>  header file.])
],
  AC_DEFINE_UNQUOTED(HAVE_PAPER_H, 0, [Define to 1 if you have the <paper.h>  header file.])
)
AC_SUBST(LIBPAPER_LIBS)

AC_CHECK_FUNCS(fseek64 mkstemp mkstemps popen)

AC_FIND_FILE(xpdfrc, [/etc /usr/local/etc /etc/xpdf], xpdfrc)
if test "$xpdfrc" != NO; then
  AC_DEFINE_UNQUOTED(SYSTEM_XPDFRC, "$xpdfrc/xpdfrc", [Define the location your xpdfrc])
fi

dnl #### Check for FSEEK variants
KDE_CHECK_LARGEFILE
AC_FUNC_FSEEKO
AC_CHECK_FUNCS(fseek64, xpdf_cv_func_fseek64=yes, xpdf_cv_func_fseek64=no)
AC_CHECK_FUNCS(ftell64, xpdf_cv_func_ftell64=yes, xpdf_cv_func_ftell64=no)
if test "$xpdf_cv_func_fseek64" = yes -a "$xpdf_cv_func_ftell64" = yes; then
        AC_DEFINE(HAVE_FSEEK64, 1)
else
	AC_DEFINE(HAVE_FSEEK64, 0)
fi
	  
dnl #### Enable the user to enable multithearind on xpdf
AC_ARG_ENABLE(multithreaded-kpdf,
	      AC_HELP_STRING([--enable-multithreaded-kpdf],[include support for multithreading in xpdf code inside kpdf. Has nothing to do with threaded generation of contents, this is configurable via a dialog inside the program itself]),
[
    case $enableval in
	yes)
		AC_DEFINE(MULTITHREADED, 1, [Defines if use multithreading in xpdf code inside kpdf])
		;;
	no)
		AC_DEFINE(MULTITHREADED, 0, [Defines if use multithreading in xpdf code inside kpdf])
		;;
	*)
		AC_DEFINE(MULTITHREADED, 1, [Defines if use multithreading in xpdf code inside kpdf])
		;;
 esac
]
, AC_DEFINE(MULTITHREADED, 0, [Defines if use multithreading in xpdf code inside kpdf])
)

dnl #### Enable the user to decide if he wants to force drm or not
AC_ARG_ENABLE(force-kpdf-drm,
	      AC_HELP_STRING([--enable-force-kpdf-drm],[Forces kpdf to check for DRM to decide if you can copy/print protected pdf. (default=no)]),
[
    case $enableval in
	yes)
		AC_DEFINE(KPDF_FORCE_DRM, 1, [Defines if force the use DRM in kpdf])
		;;
	no)
		AC_DEFINE(KPDF_FORCE_DRM, 0, [Defines if force the use DRM in kpdf])
		;;
	*)
		AC_DEFINE(KPDF_FORCE_DRM, 1, [Defines if force the use DRM in kpdf])
		;;
 esac
]
, AC_DEFINE(KPDF_FORCE_DRM, 0, [Defines if force the use DRM in kpdf])
)

KDE_CHECK_COMPILER_FLAG([fno-regmove], SUPPORTS_NOREGMOVE=true, SUPPORTS_NOREGMOVE=false)
if test "x$SUPPORTS_NOREGMOVE" = xtrue; then
	NOREGMOVE="-fno-regmove"
fi
AC_SUBST(NOREGMOVE)