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