summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 4b1e92fb1542bdc5e21bc94d0544e787ede63b6a (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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# Autoconf configuration file for groff.
# Copyright (C) 1989-2023 Free Software Foundation, Inc.
#
# This file is part of groff.
#
# groff is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# groff is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Process this file with autoconf to produce a configure script.

AC_INIT([GNU roff],
        m4_esyscmd([build-aux/git-version-gen --prefix "" .tarball-version]),
        http://savannah.gnu.org/bugs/?group=groff,
        [groff])

AC_PREREQ([2.64])

# SHORT_VERSION contains only the number of REVISION before the first
# '.'; e.g., if REVISION is '3.real.434-5aafd' then SHORT_VERSION is
# 'x.yy.3', where x and yy are MAJOR_VERSION and MINOR_VERSION,
# respectively.
AC_SUBST([SHORT_VERSION],
	m4_bregexp(AC_PACKAGE_VERSION,[^\(\w+\.\w+\.\w+\).*$],[\1]))

# Directories where the helper scripts should be found. This must be
# consistent with the variable build_aux in bootstrap.conf.
AC_CONFIG_AUX_DIR([build-aux])

AC_CONFIG_HEADERS([src/include/config.h:src/include/config.hin])
AC_CONFIG_SRCDIR([src/roff/groff/groff.cpp])

AC_USE_SYSTEM_EXTENSIONS

AM_INIT_AUTOMAKE([subdir-objects])

AM_SILENT_RULES([yes])

# checks for programs
AC_PROG_CC
AC_PROG_CXX
gl_EARLY
gl_INIT
GROFF_CXX_CHECK
GROFF_EBCDIC
GROFF_OS390
GROFF_CMD_FILES
GROFF_X11
GROFF_APPDEFDIR_OPTION
GROFF_APPDEFDIR_DEFAULT
GROFF_LIBPROGRAMDIR_DEFAULT
GROFF_GLILYPONDDIR_DEFAULT
GROFF_GPINYINDIR_DEFAULT
GROFF_PERL
GROFF_PRINT
# GROFF_REFER
GROFF_REFERDIR_DEFAULT
AC_PROG_EGREP
GROFF_PROG_YACC
GROFF_PROG_M4
GROFF_PROG_MAKEINFO
GROFF_PROG_TEXI2DVI
GROFF_USE_TEX_CHECK
AC_PROG_RANLIB
GROFF_INSTALL_SH
GROFF_INSTALL_INFO
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MKDIR_P
GROFF_PROG_XPMTOPPM
PKG_PROG_PKG_CONFIG
GROFF_UCHARDET

# use a dummy substitution if no csh hack is necessary to avoid errors
# with non-GNU sed programs
GROFF_CSH_HACK([SH_SCRIPT_SED_CMD='1s/.*/:/'],
               [SH_SCRIPT_SED_CMD='1s/a/a/'])
AC_SUBST([SH_SCRIPT_SED_CMD])

# checks for headers
AC_CHECK_HEADERS([stdbool.h stddef.h stdlib.h unistd.h dirent.h \
                  limits.h sys/dir.h string.h strings.h math.h \
                  sys/time.h direct.h process.h])
GROFF_ISC_SYSV3
GROFF_POSIX

# checks for header stuff
GROFF_SRAND
GROFF_NEED_DECLARATION([gettimeofday])
GROFF_NEED_DECLARATION([popen])
GROFF_NEED_DECLARATION([pclose])
GROFF_NEED_DECLARATION([putenv])
GROFF_NEED_DECLARATION([rand])
GROFF_NEED_DECLARATION([srand])
GROFF_NEED_DECLARATION([strcasecmp])
GROFF_NEED_DECLARATION([strncasecmp])
GROFF_NEED_DECLARATION([vfprintf])
GROFF_SYS_NERR
GROFF_SYS_ERRLIST
GROFF_OSFCN_H
GROFF_LIMITS_H
GROFF_INTTYPES_H

# checks for typedefs
GROFF_UNSIGNED_LONG_LONG
GROFF_UINTMAX_T
GROFF_TIME_T
GROFF_TYPE_SIGNAL
GROFF_STRUCT_EXCEPTION

# check endianness
AC_C_BIGENDIAN

# checks for libraries
GROFF_LIBC
GROFF_LIBM

AC_LANG_PUSH([C++])
AM_ICONV
AC_LANG_POP([C++])

# we need LIBEXT
AC_SUBST([LIBEXT],[$acl_libext])

# checks for functions
AC_FUNC_MMAP
saved_libs="$LIBS"
LIBS="$LIBS $LIBC $LIBM"
AC_REPLACE_FUNCS([fmod getcwd putenv strcasecmp \
                  strerror strncasecmp strtol])
LIBS="$saved_libs"
AC_CHECK_FUNCS([gettimeofday isatty kill rename setlocale strdup \
                strsep])
GROFF_MKSTEMP
AC_CHECK_DECLS([strsignal, getc_unlocked])
AC_CHECK_DECLS([sys_siglist, getc_unlocked])
AM_LANGINFO_CODESET

# checks for compiler characteristics
GROFF_ARRAY_DELETE
GROFF_TRADITIONAL_CPP

# checks for operating system services
GROFF_WCOREFLAG

# URW fonts extra dir
GROFF_URW_FONTS_PATH

# use groff's own malloc-based allocator for C++ new/delete operators
GROFF_USE_GROFF_ALLOCATOR

# other random stuff
GROFF_BROKEN_SPOOLER_FLAGS
GROFF_PAGE
GROFF_G
GROFF_TMAC
GROFF_WITH_COMPATIBILITY_WRAPPERS
GROFF_TARGET_PATH_SEPARATOR
GROFF_CHECK_GROHTML_PROGRAMS
GROFF_PDFROFF_DEPENDENCIES_CHECK
GROFF_GROPDF_DEPENDENCIES_CHECK
GROFF_PNMTOOLS_CAN_BE_QUIET
GROFF_PNMTOPS_NOSETPAGE
GROFF_MAKE_DEFINES_RM
GROFF_DIFF_D
GROFF_HAVE_TEST_EF_OPTION
GROFF_BASH
GROFF_GHOSTSCRIPT_VERSION_CHECK
gl_GLIBC21
gl_LOCALCHARSET

AM_CONDITIONAL([BUILD_WINSCRIPTS], [test -n "$make_winscripts"])

# If X11 is not available, don't build:
# font/devX75
# font/devX75-12
# font/devX100
# font/devX100-12
# src/devices/xditview
# src/utils/xtotroff
# src/libs/libxutil
AM_CONDITIONAL([WITHOUT_X11], [test "$groff_no_x" = yes])

AM_CONDITIONAL([MAKE_DEFINES_RM], [test "$groff_make_defines_rm" = yes])

# Some programs have a "g" prefix if an existing troff installation is
# detected.
AM_CONDITIONAL([USEPROGRAMPREFIX], [test "$g" = g])

AM_CONDITIONAL([USE_GROHTML], [test "$use_grohtml" = yes])
AM_CONDITIONAL([USE_PDFROFF], [test "$use_pdfroff" = yes])
AM_CONDITIONAL([USE_GROPDF], [test "$use_gropdf" = yes])
AM_CONDITIONAL([USE_GROFF_ALLOCATOR],
               [test "$groff_use_own_allocator" = yes])
AM_CONDITIONAL([HAVE_GHOSTSCRIPT], [test "$GHOSTSCRIPT" != no \
                && test "$GHOSTSCRIPT" != missing])
AM_CONDITIONAL([HAVE_URW_FONTS], [test "$groff_have_urw_fonts" = yes ])
AM_CONDITIONAL([HAVE_TEXI2DVI], [test "$groff_have_texi2dvi" = yes ])
AM_CONDITIONAL([USE_TEX], [test "$groff_use_tex" = yes ])

AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([test-groff], [chmod +x test-groff])
AC_OUTPUT

echo "
$PACKAGE_NAME version $PACKAGE_VERSION
----------------------------------------------------------------------
 installation directory prefix    : $prefix"
if test -n "$g"
then
  echo "\
 command name prefix              : $g"
  if test -n "$tmac_wrap"
  then
  echo "\
 prefix used for macro packages   : $tmac_wrap"
  fi
fi
echo "\
 C++ compiler and options         : $CXX $CXXFLAGS $CPPFLAGS
 use libgroff's memory allocator  : $groff_use_own_allocator
 C compiler and options           : $CC $CFLAGS $CPPFLAGS
 Perl interpreter version         : $perl_version"
if test "$groff_no_x" = yes
then
  echo "\
 X11 support                      : disabled"
else
  echo "\
 X11 support                      : enabled
 X11 app defaults directory       : $appdefdir"
fi
echo "\
 'groff -l' uses print spooler    : $groff_have_spooler
 use URW fonts for PDF output     : $groff_have_urw_fonts"
if test "$groff_have_urw_fonts" = yes
then
 echo "\
 URW fonts directory              : $urwfontsdir"
fi
echo "\
 preconv can use uchardet library : $groff_have_uchardet
 can build groff.dvi, groff.pdf   : $groff_use_tex
----------------------------------------------------------------------"

GROFF_APPDEFDIR_NOTICE
GROFF_AWK_NOTICE
GROFF_GHOSTSCRIPT_AVAILABILITY_NOTICE
GROFF_GHOSTSCRIPT_VERSION_NOTICE
GROFF_URW_FONTS_NOTICE
GROFF_UCHARDET_NOTICE
GROFF_GROHTML_PROGRAM_NOTICE
GROFF_PDFROFF_PROGRAM_NOTICE
GROFF_GROPDF_PROGRAM_NOTICE