Imported Upstream version 1.23.0
[platform/upstream/groff.git] / configure.ac
1 # Autoconf configuration file for groff.
2 # Copyright (C) 1989-2023 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
12 # ANY 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 roff],
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.64])
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
30 # 'x.yy.3', where x and yy are MAJOR_VERSION and MINOR_VERSION,
31 # respectively.
32 AC_SUBST([SHORT_VERSION],
33         m4_bregexp(AC_PACKAGE_VERSION,[^\(\w+\.\w+\.\w+\).*$],[\1]))
34
35 # Directories where the helper scripts should be found. This must be
36 # consistent with the variable build_aux in bootstrap.conf.
37 AC_CONFIG_AUX_DIR([build-aux])
38
39 AC_CONFIG_HEADERS([src/include/config.h:src/include/config.hin])
40 AC_CONFIG_SRCDIR([src/roff/groff/groff.cpp])
41
42 AC_USE_SYSTEM_EXTENSIONS
43
44 AM_INIT_AUTOMAKE([subdir-objects])
45
46 AM_SILENT_RULES([yes])
47
48 # checks for programs
49 AC_PROG_CC
50 AC_PROG_CXX
51 gl_EARLY
52 gl_INIT
53 GROFF_CXX_CHECK
54 GROFF_EBCDIC
55 GROFF_OS390
56 GROFF_CMD_FILES
57 GROFF_X11
58 GROFF_APPDEFDIR_OPTION
59 GROFF_APPDEFDIR_DEFAULT
60 GROFF_LIBPROGRAMDIR_DEFAULT
61 GROFF_GLILYPONDDIR_DEFAULT
62 GROFF_GPINYINDIR_DEFAULT
63 GROFF_PERL
64 GROFF_PRINT
65 # GROFF_REFER
66 GROFF_REFERDIR_DEFAULT
67 AC_PROG_EGREP
68 GROFF_PROG_YACC
69 GROFF_PROG_M4
70 GROFF_PROG_MAKEINFO
71 GROFF_PROG_TEXI2DVI
72 GROFF_USE_TEX_CHECK
73 AC_PROG_RANLIB
74 GROFF_INSTALL_SH
75 GROFF_INSTALL_INFO
76 AC_PROG_INSTALL
77 AC_PROG_LN_S
78 AC_PROG_MKDIR_P
79 GROFF_PROG_XPMTOPPM
80 PKG_PROG_PKG_CONFIG
81 GROFF_UCHARDET
82
83 # use a dummy substitution if no csh hack is necessary to avoid errors
84 # with non-GNU sed programs
85 GROFF_CSH_HACK([SH_SCRIPT_SED_CMD='1s/.*/:/'],
86                [SH_SCRIPT_SED_CMD='1s/a/a/'])
87 AC_SUBST([SH_SCRIPT_SED_CMD])
88
89 # checks for headers
90 AC_CHECK_HEADERS([stdbool.h stddef.h stdlib.h unistd.h dirent.h \
91                   limits.h sys/dir.h string.h strings.h math.h \
92                   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 strdup \
142                 strsep])
143 GROFF_MKSTEMP
144 AC_CHECK_DECLS([strsignal, getc_unlocked])
145 AC_CHECK_DECLS([sys_siglist, getc_unlocked])
146 AM_LANGINFO_CODESET
147
148 # checks for compiler characteristics
149 GROFF_ARRAY_DELETE
150 GROFF_TRADITIONAL_CPP
151
152 # checks for operating system services
153 GROFF_WCOREFLAG
154
155 # URW fonts extra dir
156 GROFF_URW_FONTS_PATH
157
158 # use groff's own malloc-based allocator for C++ new/delete operators
159 GROFF_USE_GROFF_ALLOCATOR
160
161 # other random stuff
162 GROFF_BROKEN_SPOOLER_FLAGS
163 GROFF_PAGE
164 GROFF_G
165 GROFF_TMAC
166 GROFF_WITH_COMPATIBILITY_WRAPPERS
167 GROFF_TARGET_PATH_SEPARATOR
168 GROFF_CHECK_GROHTML_PROGRAMS
169 GROFF_PDFROFF_DEPENDENCIES_CHECK
170 GROFF_GROPDF_DEPENDENCIES_CHECK
171 GROFF_PNMTOOLS_CAN_BE_QUIET
172 GROFF_PNMTOPS_NOSETPAGE
173 GROFF_MAKE_DEFINES_RM
174 GROFF_DIFF_D
175 GROFF_HAVE_TEST_EF_OPTION
176 GROFF_BASH
177 GROFF_GHOSTSCRIPT_VERSION_CHECK
178 gl_GLIBC21
179 gl_LOCALCHARSET
180
181 AM_CONDITIONAL([BUILD_WINSCRIPTS], [test -n "$make_winscripts"])
182
183 # If X11 is not available, don't build:
184 # font/devX75
185 # font/devX75-12
186 # font/devX100
187 # font/devX100-12
188 # src/devices/xditview
189 # src/utils/xtotroff
190 # src/libs/libxutil
191 AM_CONDITIONAL([WITHOUT_X11], [test "$groff_no_x" = yes])
192
193 AM_CONDITIONAL([MAKE_DEFINES_RM], [test "$groff_make_defines_rm" = yes])
194
195 # Some programs have a "g" prefix if an existing troff installation is
196 # detected.
197 AM_CONDITIONAL([USEPROGRAMPREFIX], [test "$g" = g])
198
199 AM_CONDITIONAL([USE_GROHTML], [test "$use_grohtml" = yes])
200 AM_CONDITIONAL([USE_PDFROFF], [test "$use_pdfroff" = yes])
201 AM_CONDITIONAL([USE_GROPDF], [test "$use_gropdf" = yes])
202 AM_CONDITIONAL([USE_GROFF_ALLOCATOR],
203                [test "$groff_use_own_allocator" = yes])
204 AM_CONDITIONAL([HAVE_GHOSTSCRIPT], [test "$GHOSTSCRIPT" != no \
205                 && test "$GHOSTSCRIPT" != missing])
206 AM_CONDITIONAL([HAVE_URW_FONTS], [test "$groff_have_urw_fonts" = yes ])
207 AM_CONDITIONAL([HAVE_TEXI2DVI], [test "$groff_have_texi2dvi" = yes ])
208 AM_CONDITIONAL([USE_TEX], [test "$groff_use_tex" = yes ])
209
210 AC_CONFIG_FILES([Makefile])
211 AC_CONFIG_FILES([test-groff], [chmod +x test-groff])
212 AC_OUTPUT
213
214 echo "
215 $PACKAGE_NAME version $PACKAGE_VERSION
216 ----------------------------------------------------------------------
217  installation directory prefix    : $prefix"
218 if test -n "$g"
219 then
220   echo "\
221  command name prefix              : $g"
222   if test -n "$tmac_wrap"
223   then
224   echo "\
225  prefix used for macro packages   : $tmac_wrap"
226   fi
227 fi
228 echo "\
229  C++ compiler and options         : $CXX $CXXFLAGS $CPPFLAGS
230  use libgroff's memory allocator  : $groff_use_own_allocator
231  C compiler and options           : $CC $CFLAGS $CPPFLAGS
232  Perl interpreter version         : $perl_version"
233 if test "$groff_no_x" = yes
234 then
235   echo "\
236  X11 support                      : disabled"
237 else
238   echo "\
239  X11 support                      : enabled
240  X11 app defaults directory       : $appdefdir"
241 fi
242 echo "\
243  'groff -l' uses print spooler    : $groff_have_spooler
244  use URW fonts for PDF output     : $groff_have_urw_fonts"
245 if test "$groff_have_urw_fonts" = yes
246 then
247  echo "\
248  URW fonts directory              : $urwfontsdir"
249 fi
250 echo "\
251  preconv can use uchardet library : $groff_have_uchardet
252  can build groff.dvi, groff.pdf   : $groff_use_tex
253 ----------------------------------------------------------------------"
254
255 GROFF_APPDEFDIR_NOTICE
256 GROFF_AWK_NOTICE
257 GROFF_GHOSTSCRIPT_AVAILABILITY_NOTICE
258 GROFF_GHOSTSCRIPT_VERSION_NOTICE
259 GROFF_URW_FONTS_NOTICE
260 GROFF_UCHARDET_NOTICE
261 GROFF_GROHTML_PROGRAM_NOTICE
262 GROFF_PDFROFF_PROGRAM_NOTICE
263 GROFF_GROPDF_PROGRAM_NOTICE