-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure.ac
135 lines (103 loc) · 3.89 KB
/
configure.ac
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
125
126
127
128
129
130
131
132
133
134
135
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
m4_define([pdftoedn_version],[0.34.3])
AC_PREREQ([2.68])
AC_INIT([pdftoedn], [pdftoedn_version], [[email protected]])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/base_types.cc])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_CONFIG_MACRO_DIR([m4])
dnl check to enable debug flags
AX_CHECK_ENABLE_DEBUG([no])
if test "x$ax_enable_debug" = "xyes"; then
dnl add some internal debug defines
PDFTOEDN_BUILD_CPPFLAGS="-DCHECK_CAP_CHANGE"
fi
AC_SUBST([PDFTOEDN_BUILD_CPPFLAGS])
dnl Checks for programs.
PKG_PROG_PKG_CONFIG
AC_PROG_CXX
AC_PROG_CC
dnl define version in config.h
AC_DEFINE_UNQUOTED([PDFTOEDN_VERSION], ["pdftoedn_version"], [Explicitly named version])
dnl c++-11 is required
AX_CXX_COMPILE_STDCXX_11
dnl -----------------------------------------------
dnl Checks for C libraries
AC_LANG_PUSH(C)
dnl freetype
PKG_CHECK_MODULES([freetype2], freetype2, [], [AC_MSG_ERROR([freetype2 was not found])])
dnl libpng
PKG_CHECK_MODULES([png], [libpng], libpng_ok=yes, libpng_ok=no)
if test "x$libpng_ok" = "xyes"; then
LIBPNG_LDFLAGS="-L`pkg-config --variable=libdir libpng`"
else
AC_MSG_ERROR([libpng was not found])
fi
dnl leptonica
PKG_CHECK_MODULES([lept], [lept >= 1.74], [], [AC_MSG_ERROR([leptonica 1.74 was not found])])
dnl openssl
AX_CHECK_OPENSSL(openssl_found=yes, openssl_found=no)
if test "x$openssl_found" = "xyes"; then
AC_DEFINE([HAVE_LIBOPENSSL], [1], [using openssl md5])
else
AC_MSG_NOTICE([
openssl not found - using local md5 calculation code
If you prefer to use an openssl installed in a non-standard path, pass the following option to this script:
--with-openssl=<path to root openssl dir>
(This path must contain include and lib dirs).
])
fi
AM_CONDITIONAL([LOCAL_MD5], [test x$openssl_found = xno])
AC_LANG_POP
dnl -----------------------------------------------
dnl Checks for c++ libraries.
AC_LANG_PUSH(C++)
dnl boost
AX_BOOST_BASE([1.60],[], [AC_MSG_ERROR([boost was not found in your system])])
AX_BOOST_SYSTEM
AX_BOOST_FILESYSTEM
AX_BOOST_PROGRAM_OPTIONS
AX_BOOST_REGEX
AX_BOOST_LOCALE
dnl poppler
PKG_CHECK_MODULES([poppler], [poppler >= 0.55.0], [], [AC_MSG_ERROR([poppler 0.55.0 was not found])])
PKG_CHECK_MODULES([poppler_cpp], [poppler-cpp >= 0.55.0], [], [AC_MSG_ERROR([poppler cpp lib 0.55.0 not found])])
dnl poppler doesn't scope usage of its x-pdf headers but I prefer to.
dnl This is usually not a problem unless poppler is installed in a
dnl custom location because pkg-config usually returns the path
dnl including the poppler subdirectory (e.g., /usr/some/path/include/poppler)
POPPLER_PARENT_INCLUDE=-I`pkg-config --variable=includedir poppler | sed 's/\/include\/poppler.*/\/include/'`
AC_SUBST([POPPLER_PARENT_INCLUDE])
dnl make sure poppler xpdf headers are installed
save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $poppler_CFLAGS"
AC_CHECK_HEADER([GfxState.h],,[AC_MSG_ERROR([poppler headers not found. Please configure poppler with --enable-xpdf-headers flag])])
CPPFLAGS=$save_CPPFLAGS
dnl rapidjson
PKG_CHECK_MODULES([RapidJSON], RapidJSON, [], [AC_MSG_ERROR([
rapidjson was not found
If you've installed it manually, ensure the RapidJSON.pc file is also
installed (usually in /usr/local/lib/pkgconfig/). If you've installed
it in a custom location, set the PKG_CONFIG_PATH environment variable
to point to the pkgconfig directory.])])
AC_LANG_POP
dnl -----------------------------------------------
dnl Checks for header files.
AC_CHECK_HEADERS([unistd.h wordexp.h])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT8_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
dnl Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_CHECK_FUNCS([memset setlocale strerror strstr])
dnl tests
AC_CONFIG_FILES([tests/Makefile])
AC_OUTPUT