Imported Upstream version 1.22.2
[platform/upstream/groff.git] / configure.ac
1 # Autoconf configuration file for groff.
2 # Copyright (C) 1989-1995, 2001-2007, 2009, 2011-2012
3 # Free Software Foundation, Inc.
4 #
5 # This file is part of groff.
6 #
7 # groff is free software; you can redistribute it and/or modify it under
8 # the terms of the GNU General Public License as published by the Free
9 # Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 # for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #
20 # Process this file with autoconf to produce a configure script.
21
22 dnl Use `VERSION' and `REVISION' files to get version.
23 m4_define([GROFF_VERSION_DATA], m4_include([VERSION]))
24 m4_define([GROFF_REVISION_DATA], m4_include([REVISION]))
25
26 dnl Strip off newline characters.
27 m4_define([GROFF_VERSION],
28           m4_substr(GROFF_VERSION_DATA,
29                     [0], m4_decr(m4_len(GROFF_VERSION_DATA))))
30 m4_define([GROFF_REVISION],
31           m4_substr(GROFF_REVISION_DATA,
32                     [0], m4_decr(m4_len(GROFF_REVISION_DATA))))
33
34 dnl Don't use revision if it is zero.
35 m4_define([GROFF_VERSION_STRING],
36           m4_if(m4_eval(GROFF_REVISION[ > 0]),
37                 [1],
38                 GROFF_VERSION[.]GROFF_REVISION,
39                 GROFF_VERSION))
40
41 AC_INIT([groff],
42         GROFF_VERSION_STRING,
43         [bug-groff@gnu.org],
44         [groff-]GROFF_VERSION_STRING)
45 AC_PREREQ([2.62])
46
47 AC_CONFIG_HEADERS([src/include/config.h:src/include/config.hin])
48 AC_CONFIG_SRCDIR([src/roff/groff/groff.cpp])
49
50 AC_USE_SYSTEM_EXTENSIONS
51
52 # checks for programs
53 AC_PROG_CC
54 AC_PROG_CXX
55 GROFF_CXX_CHECK
56 GROFF_EBCDIC
57 GROFF_OS390
58 GROFF_X11
59 GROFF_APPRESDIR_OPTION
60 GROFF_APPRESDIR_DEFAULT
61 GROFF_GROFFERDIR_OPTION
62 GROFF_GROFFERDIR_DEFAULT
63 GROFF_PRINT
64 AC_PROG_EGREP
65 AC_PATH_PROG([PERLPATH], [perl], [/usr/bin/perl])
66 GROFF_PROG_YACC
67 GROFF_MAKEINFO
68 AC_PROG_RANLIB
69 GROFF_INSTALL_SH
70 GROFF_INSTALL_INFO
71 AC_PROG_INSTALL
72 AC_PROG_LN_S
73
74 # use a dummy substitution if no csh hack is necessary to avoid errors
75 # with non-GNU sed programs
76 GROFF_CSH_HACK([SH_SCRIPT_SED_CMD='1s/.*/:/'], [SH_SCRIPT_SED_CMD='1s/a/a/'])
77 AC_SUBST([SH_SCRIPT_SED_CMD])
78
79 # checks for headers
80 AC_CHECK_HEADERS([stddef.h stdlib.h unistd.h dirent.h limits.h sys/dir.h \
81                   string.h strings.h math.h sys/time.h direct.h process.h])
82 GROFF_ISC_SYSV3
83 GROFF_POSIX
84
85 # checks for header stuff
86 GROFF_SRAND
87 GROFF_NEED_DECLARATION([gettimeofday])
88 GROFF_NEED_DECLARATION([hypot])
89 GROFF_NEED_DECLARATION([popen])
90 GROFF_NEED_DECLARATION([pclose])
91 GROFF_NEED_DECLARATION([putenv])
92 GROFF_NEED_DECLARATION([rand])
93 GROFF_NEED_DECLARATION([snprintf])
94 GROFF_NEED_DECLARATION([srand])
95 GROFF_NEED_DECLARATION([strcasecmp])
96 GROFF_NEED_DECLARATION([strncasecmp])
97 GROFF_NEED_DECLARATION([vfprintf])
98 GROFF_NEED_DECLARATION([vsnprintf])
99 GROFF_SYS_NERR
100 GROFF_SYS_ERRLIST
101 GROFF_OSFCN_H
102 GROFF_LIMITS_H
103 GROFF_INTTYPES_H
104
105 # checks for typedefs
106 GROFF_UNSIGNED_LONG_LONG
107 GROFF_UINTMAX_T
108 GROFF_TIME_T
109 GROFF_TYPE_SIGNAL
110 GROFF_STRUCT_EXCEPTION
111
112 # check endianness
113 AC_C_BIGENDIAN
114
115 # checks for libraries
116 GROFF_LIBC
117 GROFF_LIBM
118
119 AC_LANG_PUSH([C++])
120 AM_ICONV
121 AC_LANG_POP([C++])
122
123 # we need LIBEXT
124 AC_SUBST([LIBEXT],[$acl_libext])
125
126 # checks for functions
127 AC_FUNC_MMAP
128 saved_libs="$LIBS"
129 LIBS="$LIBS $LIBC $LIBM"
130 AC_REPLACE_FUNCS([fmod getcwd putenv snprintf strcasecmp \
131                   strerror strncasecmp strtol])
132 # vsnprintf is in the same source file as snprintf
133 AC_CHECK_FUNCS([vsnprintf], [], [AC_LIBOBJ([snprintf])])
134 LIBS="$saved_libs"
135 AC_CHECK_FUNCS([gettimeofday isatty kill rename setlocale strsep])
136 GROFF_MKSTEMP
137 AC_CHECK_DECLS([sys_siglist, getc_unlocked])
138 AM_LANGINFO_CODESET
139
140 # checks for compiler characteristics
141 GROFF_ARRAY_DELETE
142 GROFF_TRADITIONAL_CPP
143
144 # checks for operating system services
145 GROFF_WCOREFLAG
146
147 # other random stuff
148 GROFF_BROKEN_SPOOLER_FLAGS
149 GROFF_PAGE
150 GROFF_G
151 GROFF_TMAC
152 GROFF_TARGET_PATH_SEPARATOR
153 GROFF_HTML_PROGRAMS
154 GROFF_PDFDOC_PROGRAMS
155 GROFF_PNMTOPS_NOSETPAGE
156 gl_GLIBC21
157 gl_LOCALCHARSET
158
159 AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
160 AC_CONFIG_FILES([Makefile doc/Makefile src/utils/xtotroff/Makefile])
161 AC_CONFIG_FILES([contrib/gdiffmk/tests/runtests],
162                 [chmod +x contrib/gdiffmk/tests/runtests])
163 AC_CONFIG_FILES([test-groff], [chmod +x test-groff])
164 AC_OUTPUT
165
166 GROFF_APPRESDIR_CHECK