1 # Autoconf configuration file for groff.
2 # Copyright (C) 1989-1995, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
4 # Free Software Foundation, Inc.
6 # This file is part of groff.
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.
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
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/>.
21 # Process this file with autoconf to produce a configure script.
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]))
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))))
35 dnl Don't use revision if it is zero.
36 m4_define([GROFF_VERSION_STRING],
37 m4_if(m4_eval(GROFF_REVISION[ > 0]),
39 GROFF_VERSION[.]GROFF_REVISION,
45 [groff-]GROFF_VERSION_STRING)
48 AC_CONFIG_HEADERS([src/include/config.h:src/include/config.hin])
49 AC_CONFIG_SRCDIR([src/roff/groff/groff.cpp])
51 AC_USE_SYSTEM_EXTENSIONS
60 GROFF_APPRESDIR_OPTION
61 GROFF_APPRESDIR_DEFAULT
64 AC_PATH_PROG([PERLPATH], [perl], [/usr/bin/perl])
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])
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])
84 # checks for header stuff
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])
104 # checks for typedefs
105 GROFF_UNSIGNED_LONG_LONG
109 GROFF_STRUCT_EXCEPTION
114 # checks for libraries
120 AC_SUBST([LIBEXT],[$acl_libext])
122 # checks for functions
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])])
131 AC_CHECK_FUNCS([gettimeofday isatty kill rename setlocale strsep])
133 AC_CHECK_DECLS([sys_siglist, getc_unlocked])
136 # checks for compiler characteristics
138 GROFF_TRADITIONAL_CPP
140 # checks for operating system services
144 GROFF_BROKEN_SPOOLER_FLAGS
148 GROFF_TARGET_PATH_SEPARATOR
150 GROFF_PDFDOC_PROGRAMS
151 GROFF_PNMTOPS_NOSETPAGE
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])
161 GROFF_APPRESDIR_CHECK