-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
116 lines (102 loc) · 3.88 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([Fix ToUnicode CMap in PDF], [0.0.0], ,
[pdf-fix-tuc], [https://github.com/trueroad/pdf-fix-tuc])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_SRCDIR([src/main.cc])
AC_CONFIG_HEADERS([config.h])
PACKAGE_COPYRIGHT="Copyright (C) 2021 Masamichi Hosoda. All rights reserved."
PACKAGE_LICENSE="License: BSD-2-Clause"
AC_SUBST([PACKAGE_COPYRIGHT])
AC_SUBST([PACKAGE_LICENSE])
AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT], ["$PACKAGE_COPYRIGHT"],
[Define to the copyright of this package.])
AC_DEFINE_UNQUOTED([PACKAGE_LICENSE], ["$PACKAGE_LICENSE"],
[Define to the license of this package.])
# Checks for programs.
AC_PROG_CXX
AC_PATH_PROG([DIFF], [diff])
AS_IF([test "x$DIFF" = x],
[AC_MSG_WARN([diff isn't found. `make check' will fail tests.])])
AC_SUBST([DIFF])
AC_PATH_PROG([PDFTOTEXT], [pdftotext])
AS_IF([test "x$PDFTOTEXT" = x],
[AC_MSG_WARN([pdftotext isn't found. `make check' will fail tests.])])
AC_SUBST([PDFTOTEXT])
AC_PATH_PROG([GREP], [grep])
AS_IF([test "x$GREP" = x],
[AC_MSG_WARN([grep isn't found. `make check' will fail tests.])])
AC_SUBST([GREP])
AC_MSG_CHECKING([for pre-generated test PDFs])
AS_IF([test ! -e ${srcdir}/test/bfchar.pdf],
[AC_MSG_RESULT([no])
AC_PATH_PROG([UPTEX], [uptex])
AS_IF([test "x$UPTEX" = x],
[AC_MSG_WARN(
[uptex isn't found. Test PDFs cannot be generated.])
AC_MSG_WARN(
[You cannot use `make check'.])])
AC_PATH_PROG([DVIPDFMX], [dvipdfmx])
AS_IF([test "x$DVIPDFMX" = x],
[AC_MSG_WARN(
[dvipdfmx isn't found. Test PDFs cannot be generated.])
AC_MSG_WARN(
[You cannot use `make check'.])])
AC_PATH_PROG([QPDF], [qpdf])
AS_IF([test "x$QPDF" = x],
[AC_MSG_WARN(
[qpdf isn't found. Test PDFs cannot be generated.])
AC_MSG_WARN(
[You cannot use `make check'.])])
AC_PATH_PROG([FIX_QDF], [fix-qdf])
AS_IF([test "x$FIX_QDF" = x],
[AC_MSG_WARN(
[fix-qdf isn't found. Test PDFs cannot be generated.])
AC_MSG_WARN(
[You cannot use `make check'.])])
AC_PATH_PROG([PYTHON3], [python3])
AS_IF([test "x$PYTHON3" = x],
[AC_MSG_WARN(
[python3 isn't found. Test PDFs cannot be generated.])
AC_MSG_WARN(
[You cannot use `make check'.])])],
[AC_MSG_RESULT([yes])])
AM_CONDITIONAL([GENERATE_TEST_PDF],
[test ! -e ${srcdir}/test/bfchar.pdf])
AC_SUBST([UPTEX])
AC_SUBST([DVIPDFMX])
AC_SUBST([QPDF])
AC_SUBST([FIX_QDF])
AC_ARG_ENABLE([build-table],
[AS_HELP_STRING([--enable-build-table],
[Enable building table (default is disable)])],
[enable_build_table=yes
AC_MSG_CHECKING([for build-table source aj17-kanji.txt])
AS_IF([test ! -e ${srcdir}/src/aj17-kanji.txt],
[AC_MSG_RESULT([no])
AC_PATH_PROG([WGET], [wget])
AS_IF([test "x$WGET" = x],
[AC_MSG_ERROR(
[wget isn't found. aj17-kanji.txt cannot be retrieved.])],
[AC_MSG_NOTICE(
[wget is found. aj17-kanji.txt will be retrieved.])])],
[AC_MSG_RESULT([yes])])
AC_PATH_PROG([PYTHON3], [python3])
AS_IF([test "x$PYTHON3" = x],
[AC_MSG_ERROR([python3 isn't found. You cannot enable build-table.])],
[AC_MSG_NOTICE([python3 is found. The table will build.])])],
[enable_build_table=no])
AM_CONDITIONAL([ENABLE_BUILD_TABLE], [test "x$enable_build_table" = xyes])
AC_SUBST([WGET])
# Checks for libraries.
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([LIBQPDF], [libqpdf])
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
AX_CXX_COMPILE_STDCXX(11, [noext], [mandatory])
# Checks for library functions.
AC_CONFIG_FILES([Makefile
src/Makefile
test/Makefile])
AC_OUTPUT