Imported Upstream version 1.22.4
[platform/upstream/groff.git] / configure.ac
1 # Autoconf configuration file for groff.
2 # Copyright (C) 1989-2018 Free Software Foundation, Inc.
3 #
4 # This file is part of groff.
5 #
6 # groff is free software; you can redistribute it and/or modify it under
7 # the terms of the GNU General Public License as published by the Free
8 # Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 # for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 #
19 # Process this file with autoconf to produce a configure script.
20
21 AC_INIT([GNU Troff],
22         m4_esyscmd([build-aux/git-version-gen --prefix "" .tarball-version]),
23         http://savannah.gnu.org/bugs/?group=groff,
24         [groff])
25
26 AC_PREREQ([2.62])
27
28 # SHORT_VERSION contains only the number of REVISION before the first '.',
29 # e.g. if REVISION is '3.real.434-5aafd' then SHORT_VERSION is 'x.yy.3',
30 # where x and yy are MAJOR_VERSION and MINOR_VERSION, respectively.
31 AC_SUBST([SHORT_VERSION],
32         m4_bregexp(AC_PACKAGE_VERSION,[^\(\w+\.\w+\.\w+\).*$],[\1]))
33
34 # Directories where the helper scripts should be found. This must be consistent
35 # with the variable build_aux in bootstrap.conf
36 AC_CONFIG_AUX_DIR([build-aux])
37
38 AC_CONFIG_HEADERS([src/include/config.h:src/include/config.hin])
39 AC_CONFIG_SRCDIR([src/roff/groff/groff.cpp])
40
41 AC_USE_SYSTEM_EXTENSIONS
42
43 AM_INIT_AUTOMAKE([subdir-objects])
44
45 AM_SILENT_RULES([yes])
46
47 # checks for programs
48 AC_PROG_CC
49 AC_PROG_CXX
50 gl_EARLY
51 gl_INIT
52 GROFF_CXX_CHECK
53 GROFF_EBCDIC
54 GROFF_OS390
55 GROFF_CMD_FILES
56 GROFF_X11
57 GROFF_APPRESDIR_OPTION
58 GROFF_APPRESDIR_DEFAULT
59 GROFF_LIBPROGRAMDIR_DEFAULT
60 GROFF_GROFFERDIR_OPTION
61 GROFF_GROFFERDIR_DEFAULT
62 GROFF_GLILYPONDDIR_DEFAULT
63 GROFF_GPINYINDIR_DEFAULT
64 GROFF_GROGDIR_DEFAULT
65 GROFF_PERL
66 GROFF_PRINT
67 # GROFF_REFER
68 GROFF_REFERDIR_DEFAULT
69 AC_PROG_EGREP
70 GROFF_PROG_YACC
71 GROFF_DOC_CHECK
72 GROFF_MAKEINFO
73 GROFF_TEXI2DVI
74 AC_PROG_RANLIB
75 GROFF_INSTALL_SH
76 GROFF_INSTALL_INFO
77 AC_PROG_INSTALL
78 AC_PROG_LN_S
79 AC_PROG_MKDIR_P
80 GROFF_PROG_XPMTOPPM
81 PKG_PROG_PKG_CONFIG
82 GROFF_UCHARDET
83 GROFF_PDFTOOLS
84
85 # use a dummy substitution if no csh hack is necessary to avoid errors
86 # with non-GNU sed programs
87 GROFF_CSH_HACK([SH_SCRIPT_SED_CMD='1s/.*/:/'], [SH_SCRIPT_SED_CMD='1s/a/a/'])
88 AC_SUBST([SH_SCRIPT_SED_CMD])
89
90 # checks for headers
91 AC_CHECK_HEADERS([stddef.h stdlib.h unistd.h dirent.h limits.h sys/dir.h \
92                   string.h strings.h math.h sys/time.h direct.h process.h])
93 GROFF_ISC_SYSV3
94 GROFF_POSIX
95
96 # checks for header stuff
97 GROFF_SRAND
98 GROFF_NEED_DECLARATION([gettimeofday])
99 GROFF_NEED_DECLARATION([popen])
100 GROFF_NEED_DECLARATION([pclose])
101 GROFF_NEED_DECLARATION([putenv])
102 GROFF_NEED_DECLARATION([rand])
103 GROFF_NEED_DECLARATION([srand])
104 GROFF_NEED_DECLARATION([strcasecmp])
105 GROFF_NEED_DECLARATION([strncasecmp])
106 GROFF_NEED_DECLARATION([vfprintf])
107 GROFF_SYS_NERR
108 GROFF_SYS_ERRLIST
109 GROFF_OSFCN_H
110 GROFF_LIMITS_H
111 GROFF_INTTYPES_H
112
113 # checks for typedefs
114 GROFF_UNSIGNED_LONG_LONG
115 GROFF_UINTMAX_T
116 GROFF_TIME_T
117 GROFF_TYPE_SIGNAL
118 GROFF_STRUCT_EXCEPTION
119
120 # check endianness
121 AC_C_BIGENDIAN
122
123 # checks for libraries
124 GROFF_LIBC
125 GROFF_LIBM
126
127 AC_LANG_PUSH([C++])
128 AM_ICONV
129 AC_LANG_POP([C++])
130
131 # we need LIBEXT
132 AC_SUBST([LIBEXT],[$acl_libext])
133
134 # checks for functions
135 AC_FUNC_MMAP
136 saved_libs="$LIBS"
137 LIBS="$LIBS $LIBC $LIBM"
138 AC_REPLACE_FUNCS([fmod getcwd putenv strcasecmp \
139                   strerror strncasecmp strtol])
140 LIBS="$saved_libs"
141 AC_CHECK_FUNCS([gettimeofday isatty kill rename setlocale strsep])
142 GROFF_MKSTEMP
143 AC_CHECK_DECLS([sys_siglist, getc_unlocked])
144 AM_LANGINFO_CODESET
145
146 # checks for compiler characteristics
147 GROFF_ARRAY_DELETE
148 GROFF_TRADITIONAL_CPP
149
150 # checks for operating system services
151 GROFF_WCOREFLAG
152
153 # URW fonts extra dir
154 GROFF_URW_FONTS_PATH
155
156 # other random stuff
157 GROFF_BROKEN_SPOOLER_FLAGS
158 GROFF_PAGE
159 GROFF_G
160 GROFF_TMAC
161 GROFF_WITH_COMPATIBILITY_WRAPPERS
162 GROFF_TARGET_PATH_SEPARATOR
163 GROFF_HTML_PROGRAMS
164 GROFF_PDFDOC_PROGRAMS
165 GROFF_PNMTOPS_NOSETPAGE
166 GROFF_MAKE_RM
167 GROFF_DIFF_D
168 GROFF_HAVE_TEST_EF_OPTION
169 GROFF_BASH
170 gl_GLIBC21
171 gl_LOCALCHARSET
172
173 # checks for presence of URW fonts (requires ghostscript, which is
174 # checked in GROFF_HTML_PROGRAMS
175 GROFF_URW_FONTS
176
177 AM_CONDITIONAL([BUILD_WINSCRIPTS], [test -n "$make_winscripts"])
178
179 # If X11 is not available, don't build:
180 # font/devX75 
181 # font/devX75-12
182 # font/devX100
183 # font/devX100-12
184 # src/devices/xditview 
185 # src/utils/xtotroff
186 # src/libs/libxutil
187 AM_CONDITIONAL([WITHOUT_X11], [test "x$groff_no_x" = "xyes"])
188
189 # make builtin variable RM
190 AM_CONDITIONAL([MAKE_DONT_HAVE_RM], [test "x$groff_is_rm_defined" = "xno"])
191
192 # Some programs have a "g" prefix if an existing groff installation is detected
193 AM_CONDITIONAL([USEPROGRAMPREFIX], [test x$g = xg])
194
195 AM_CONDITIONAL([BUILD_INFODOC], [test -n "$make_infodoc"])
196 AM_CONDITIONAL([BUILD_HTML], [test -n "$make_htmldoc"])
197 AM_CONDITIONAL([BUILD_HTMLEXAMPLES], [test -n "$make_htmlexamples"])
198 AM_CONDITIONAL([BUILD_PDFDOC], [test -n "$make_pdfdoc"])
199 AM_CONDITIONAL([BUILD_PDFEXAMPLES], [test -n "$make_pdfexamples"])
200 AM_CONDITIONAL([BUILD_OTHERDOC], [test -n "$make_otherdoc"])
201 AM_CONDITIONAL([BUILD_EXAMPLES], [test -n "$make_examples"])
202 AM_CONDITIONAL([INSTALL_SHIPPED_HTML], [test -n "$make_install_shipped_htmldoc"])
203 AM_CONDITIONAL([HAVE_PDFTOOLS], [test "x$groff_have_pdftools" = "xyes" ])
204 AM_CONDITIONAL([HAVE_TEXI2DVI], [test "x$groff_have_texi2dvi" = "xyes" ])
205
206 AC_CONFIG_FILES([Makefile])
207 AC_CONFIG_FILES([test-groff], [chmod +x test-groff])
208 AC_OUTPUT
209
210 echo "
211 ${PACKAGE_NAME} version ${PACKAGE_VERSION}
212 ----------------------------------------------------------------------
213  Prefix                          : ${prefix}
214  Compiler                        : ${CC} ${CFLAGS} ${CPPFLAGS}"
215 if test "x$groff_no_x" = "xyes"; then
216 echo "\
217  X11 support                     : no"
218 else
219 echo "\
220  X11 support                     : yes
221  X11 resources dir               : $appresdir"
222 fi
223 if test "x$doc" = x; then
224 echo "\
225  Doc build                       : no"
226 else
227 echo "\
228  Doc build                       : ${doc} "
229 fi
230 echo "\
231  URW fonts for pdf               : $groff_have_urw_fonts
232  Use uchardet library for preconv: $groff_have_uchardet
233  pdftools for distcheck          : $groff_have_pdftools"
234 echo "\
235 ----------------------------------------------------------------------"
236
237 GROFF_APPRESDIR_CHECK
238 GROFF_URW_FONTS_CHECK
239 GROFF_UCHARDET_CHECK