1 # Autoconf configuration file for groff.
2 # Copyright (C) 1989-2014 Free Software Foundation, Inc.
4 # This file is part of groff.
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.
11 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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/>.
19 # Process this file with autoconf to produce a configure script.
21 dnl Use `VERSION' and `REVISION' files to get version.
22 m4_define([GROFF_VERSION_DATA], m4_include([VERSION]))
23 m4_define([GROFF_REVISION_DATA], m4_include([REVISION]))
25 dnl Strip off newline characters.
26 m4_define([GROFF_VERSION],
27 m4_substr(GROFF_VERSION_DATA,
28 [0], m4_decr(m4_len(GROFF_VERSION_DATA))))
29 m4_define([GROFF_REVISION],
30 m4_substr(GROFF_REVISION_DATA,
31 [0], m4_decr(m4_len(GROFF_REVISION_DATA))))
33 dnl Don't use revision if it is zero.
34 m4_define([GROFF_VERSION_STRING],
35 m4_if(m4_eval(GROFF_REVISION[ > 0]),
37 GROFF_VERSION[.]GROFF_REVISION,
43 [groff-]GROFF_VERSION_STRING)
46 AC_CONFIG_HEADERS([src/include/config.h:src/include/config.hin])
47 AC_CONFIG_SRCDIR([src/roff/groff/groff.cpp])
49 AC_USE_SYSTEM_EXTENSIONS
59 GROFF_APPRESDIR_OPTION
60 GROFF_APPRESDIR_DEFAULT
61 GROFF_LIBPROGRAMDIR_DEFAULT
62 GROFF_GROFFERDIR_OPTION
63 GROFF_GROFFERDIR_DEFAULT
64 GROFF_GLILYPONDDIR_DEFAULT
65 GROFF_GPINYINDIR_DEFAULT
70 GROFF_REFERDIR_DEFAULT
81 # use a dummy substitution if no csh hack is necessary to avoid errors
82 # with non-GNU sed programs
83 GROFF_CSH_HACK([SH_SCRIPT_SED_CMD='1s/.*/:/'], [SH_SCRIPT_SED_CMD='1s/a/a/'])
84 AC_SUBST([SH_SCRIPT_SED_CMD])
87 AC_CHECK_HEADERS([stddef.h stdlib.h unistd.h dirent.h limits.h sys/dir.h \
88 string.h strings.h math.h sys/time.h direct.h process.h])
92 # checks for header stuff
94 GROFF_NEED_DECLARATION([gettimeofday])
95 GROFF_NEED_DECLARATION([hypot])
96 GROFF_NEED_DECLARATION([popen])
97 GROFF_NEED_DECLARATION([pclose])
98 GROFF_NEED_DECLARATION([putenv])
99 GROFF_NEED_DECLARATION([rand])
100 GROFF_NEED_DECLARATION([snprintf])
101 GROFF_NEED_DECLARATION([srand])
102 GROFF_NEED_DECLARATION([strcasecmp])
103 GROFF_NEED_DECLARATION([strncasecmp])
104 GROFF_NEED_DECLARATION([vfprintf])
105 GROFF_NEED_DECLARATION([vsnprintf])
112 # checks for typedefs
113 GROFF_UNSIGNED_LONG_LONG
117 GROFF_STRUCT_EXCEPTION
122 # checks for libraries
131 AC_SUBST([LIBEXT],[$acl_libext])
133 # checks for functions
136 LIBS="$LIBS $LIBC $LIBM"
137 AC_REPLACE_FUNCS([fmod getcwd putenv snprintf strcasecmp \
138 strerror strncasecmp strtol])
139 # vsnprintf is in the same source file as snprintf
140 AC_CHECK_FUNCS([vsnprintf], [], [AC_LIBOBJ([snprintf])])
142 AC_CHECK_FUNCS([gettimeofday isatty kill rename setlocale strsep])
144 AC_CHECK_DECLS([sys_siglist, getc_unlocked])
147 # checks for compiler characteristics
149 GROFF_TRADITIONAL_CPP
151 # checks for operating system services
155 GROFF_BROKEN_SPOOLER_FLAGS
159 GROFF_TARGET_PATH_SEPARATOR
161 GROFF_PDFDOC_PROGRAMS
162 GROFF_PNMTOPS_NOSETPAGE
166 AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
167 AC_CONFIG_FILES([Makefile doc/Makefile src/utils/xtotroff/Makefile])
168 AC_CONFIG_FILES([contrib/gdiffmk/tests/runtests],
169 [chmod +x contrib/gdiffmk/tests/runtests])
170 AC_CONFIG_FILES([test-groff], [chmod +x test-groff])
174 ${PACKAGE_NAME} version ${PACKAGE_VERSION}
175 ----------------------------------------------------------------------
177 Compiler : ${CC} ${CFLAGS} ${CPPFLAGS}"
178 if test "x$groff_no_x" = "xyes"; then
184 X11 resources dir : $appresdir"
186 if test "x$doc" = x; then
194 ----------------------------------------------------------------------"
196 GROFF_APPRESDIR_CHECK