Codebase list x11-apps / fdb24e5
xman 1.1.5. Timo Aaltonen 4 years ago
20 changed file(s) with 3015 addition(s) and 2618 deletion(s). Raw diff Collapse all Expand all
1616 * xcursorgen 1.0.7.
1717 * xditview 1.0.5.
1818 * xlogo 1.0.5.
19 * xman 1.1.5.
1920
2021 -- Julien Cristau <jcristau@debian.org> Sun, 18 Mar 2018 17:10:35 +0100
2122
0 commit aed0ca367a69a7defd29bbbe357914b1b45ca4b9
1 Author: Alan Coopersmith <alan.coopersmith@oracle.com>
2 Date: Sun Jul 14 13:10:32 2019 -0700
3
4 xman 1.1.5
5
6 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
7
8 commit 8e32cbc5f586ba7382941d355342b1f14bcc1f5e
9 Author: Alan Coopersmith <alan.coopersmith@oracle.com>
10 Date: Fri May 31 13:45:40 2019 -0700
11
12 Pass -D_CONST_X_STRING to make libXt declare String as const char *
13
14 Clears up 62 gcc -Wdiscarded-qualifiers warnings in the xman build
15
16 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
17
18 commit 63973d9097d4f914c7637937f3af502116375d58
19 Author: Alan Coopersmith <alan.coopersmith@oracle.com>
20 Date: Fri May 31 13:43:57 2019 -0700
21
22 Change fallback_resources from char * to String type
23
24 Matches declaration of the libXt XtAppInitialize function that the
25 array is passed to.
26
27 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
28
29 commit 4f5cc99e46d0795615b9adc668b4c738529cb54a
30 Author: Alan Coopersmith <alan.coopersmith@oracle.com>
31 Date: Fri May 31 13:42:50 2019 -0700
32
33 Make CreateManpageWidget use String type for name argument
34
35 Matches declaration of the libXt XtCreatePopupShell function that the
36 name argument is passed to.
37
38 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
39
40 commit c84cd5c224e20e51cee89bf12e07d7c70b75938f
41 Author: Alan Coopersmith <alan.coopersmith@oracle.com>
42 Date: Fri May 31 13:21:37 2019 -0700
43
44 Delete unused function Name() from tkfuncs.c
45
46 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
47
48 commit bda000d1619d18aeeb37e84eda090341f38e81ea
49 Author: Matthieu Herrb <matthieu@herrb.eu>
50 Date: Fri Mar 8 21:35:33 2019 +0100
51
52 Fix typo in manual page.
53
54 reported by Alejandro G. Peregrina on OpenBSD tech@ list
55
56 Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
57 Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
58
59 commit ea5c4d25577b20a459358eff9f2d8a100dcf794f
60 Author: Julien Cristau <jcristau@debian.org>
61 Date: Thu Apr 30 23:38:10 2015 +0200
62
63 If we have man-db, don't try and emulate man's pipeline
64
65 Just let man itself do the formatting / zsoelim / ... dance. This
66 became necessary with man-db 2.7.0 moving zsoelim out of $PATH.
67
68 Debian bug#764792 <https://bugs.debian.org/764792>
69
70 Signed-off-by: Julien Cristau <jcristau@debian.org>
71 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
72
73 commit 6aefab8b5831b52042afc482a50a43e3a4eba5b9
74 Author: Alan Coopersmith <alan.coopersmith@oracle.com>
75 Date: Wed Nov 21 17:14:35 2018 -0800
76
77 Update configure.ac bug URL for gitlab migration
78
79 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
80
81 commit e7e8014eeee800d887f8e0264a4657c7918e7591
82 Author: Alan Coopersmith <alan.coopersmith@oracle.com>
83 Date: Fri Nov 16 22:36:52 2018 -0800
84
85 Update README for gitlab migration
86
87 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
88
89 commit 6758ad5a88b0d64ebbd008a0561239935a7be443
90 Author: Alan Coopersmith <alan.coopersmith@oracle.com>
91 Date: Sat May 5 15:05:45 2018 -0700
92
93 Change fall through comment in ScrollByL.c to match gcc's requirements
94
95 Needs to match one of the regexps shown under
96 https://gcc.gnu.org/onlinedocs/gcc-7.3.0/gcc/Warning-Options.html#index-Wimplicit-fallthrough
97
98 Silences warning from gcc 7.3 of:
99
100 ScrollByL.c: In function ‘PrintText’:
101 ScrollByL.c:1109:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
102 if (*(c + 1) == BACKSPACE) {
103 ^
104 ScrollByL.c:1125:9: note: here
105 default:
106 ^~~~~~~
107
108 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
109
110 commit 652ca3b948f6ae1f84d72b5a5bb841d7c893e5e4
111 Author: Mihail Konev <k.mvc@ya.ru>
112 Date: Thu Jan 26 14:00:21 2017 +1000
113
114 autogen: add default patch prefix
115
116 Signed-off-by: Mihail Konev <k.mvc@ya.ru>
117
118 commit 4e8efb3fca88799f1101020ee7c9af9c34cfe8a4
119 Author: Emil Velikov <emil.l.velikov@gmail.com>
120 Date: Mon Mar 9 12:00:52 2015 +0000
121
122 autogen.sh: use quoted string variables
123
124 Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
125 fall-outs, when they contain space.
126
127 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
128 Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
129 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
130
131 commit 231eec8d26187e4d3bd84d439a9d0a90d28780bb
132 Author: Peter Hutterer <peter.hutterer@who-t.net>
133 Date: Tue Jan 24 10:32:07 2017 +1000
134
135 autogen.sh: use exec instead of waiting for configure to finish
136
137 Syncs the invocation of configure with the one from the server.
138
139 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
140 Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
141
0142 commit 27ae1a020119b5254c0238ef60a1ba602befba56
1143 Author: Alan Coopersmith <alan.coopersmith@oracle.com>
2144 Date: Fri Mar 6 19:06:48 2015 -0800
2424 helpdir=@HELPDIR@
2525 dist_help_DATA = xman.help
2626
27 AM_CFLAGS = $(CWARNFLAGS) $(XMAN_CFLAGS) \
27 AM_CFLAGS = $(CWARNFLAGS) $(XMAN_CFLAGS) -D_CONST_X_STRING \
2828 -D_BSD_SOURCE -DHELPFILE=\"$(helpdir)/xman.help\"
2929 xman_LDADD = $(XMAN_LIBS)
3030
6969 $(CHANGELOG_CMD)
7070
7171 dist-hook: ChangeLog INSTALL
72
73 EXTRA_DIST = README.md
236236 CSCOPE = cscope
237237 DIST_SUBDIRS = $(SUBDIRS)
238238 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in COPYING \
239 ChangeLog INSTALL README compile config.guess config.sub \
240 depcomp install-sh missing
239 ChangeLog INSTALL compile config.guess config.sub depcomp \
240 install-sh missing
241241 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
242242 distdir = $(PACKAGE)-$(VERSION)
243243 top_distdir = $(distdir)
329329 LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
330330 LTLIBOBJS = @LTLIBOBJS@
331331 MAKEINFO = @MAKEINFO@
332 MANDB = @MANDB@
332333 MAN_SUBSTS = @MAN_SUBSTS@
333334 MISC_MAN_DIR = @MISC_MAN_DIR@
334335 MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
343344 PACKAGE_VERSION = @PACKAGE_VERSION@
344345 PATH_SEPARATOR = @PATH_SEPARATOR@
345346 PKG_CONFIG = @PKG_CONFIG@
347 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
348 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
346349 SED = @SED@
347350 SET_MAKE = @SET_MAKE@
348351 SHELL = @SHELL@
406409 SUBDIRS = man
407410 helpdir = @HELPDIR@
408411 dist_help_DATA = xman.help
409 AM_CFLAGS = $(CWARNFLAGS) $(XMAN_CFLAGS) \
412 AM_CFLAGS = $(CWARNFLAGS) $(XMAN_CFLAGS) -D_CONST_X_STRING \
410413 -D_BSD_SOURCE -DHELPFILE=\"$(helpdir)/xman.help\"
411414
412415 xman_LDADD = $(XMAN_LIBS)
437440 DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
438441 dist_appdefault_DATA = app-defaults/Xman
439442 MAINTAINERCLEANFILES = ChangeLog INSTALL
443 EXTRA_DIST = README.md
440444 all: config.h
441445 $(MAKE) $(AM_MAKEFLAGS) all-recursive
442446
+0
-25
xman/README less more
0 xman is a graphical manual page browser using the Athena Widgets (Xaw) toolkit.
1
2 All questions regarding this software should be directed at the
3 Xorg mailing list:
4
5 http://lists.freedesktop.org/mailman/listinfo/xorg
6
7 Please submit bug reports to the Xorg bugzilla:
8
9 https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
10
11 The master development code repository can be found at:
12
13 git://anongit.freedesktop.org/git/xorg/app/xman
14
15 http://cgit.freedesktop.org/xorg/app/xman
16
17 For patch submission instructions, see:
18
19 http://www.x.org/wiki/Development/Documentation/SubmittingPatches
20
21 For more information on the git code manager, see:
22
23 http://wiki.x.org/wiki/GitPage
24
0 xman is a graphical manual page browser using the Athena Widgets (Xaw) toolkit.
1
2 All questions regarding this software should be directed at the
3 Xorg mailing list:
4
5 https://lists.x.org/mailman/listinfo/xorg
6
7 The master development code repository can be found at:
8
9 https://gitlab.freedesktop.org/xorg/app/xman
10
11 Please submit bug reports and requests to merge patches there.
12
13 For patch submission instructions, see:
14
15 https://www.x.org/wiki/Development/Documentation/SubmittingPatches
16
11191119 *bufp++ = *c;
11201120 break;
11211121 }
1122 /* else fall through to default, because this was a real underscore. */
1122 /* else fall through - to default, because this was a real underscore. */
11231123
11241124 default:
11251125 if (italicflag) { /* font change? */
1818 You have another version of autoconf. It may work, but is not guaranteed to.
1919 If you have problems, you may need to regenerate the build system entirely.
2020 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
21
22 dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
23 dnl serial 11 (pkg-config-0.29)
24 dnl
25 dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
26 dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
27 dnl
28 dnl This program is free software; you can redistribute it and/or modify
29 dnl it under the terms of the GNU General Public License as published by
30 dnl the Free Software Foundation; either version 2 of the License, or
31 dnl (at your option) any later version.
32 dnl
33 dnl This program is distributed in the hope that it will be useful, but
34 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
35 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36 dnl General Public License for more details.
37 dnl
38 dnl You should have received a copy of the GNU General Public License
39 dnl along with this program; if not, write to the Free Software
40 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
41 dnl 02111-1307, USA.
42 dnl
43 dnl As a special exception to the GNU General Public License, if you
44 dnl distribute this file as part of a program that contains a
45 dnl configuration script generated by Autoconf, you may include it under
46 dnl the same distribution terms that you use for the rest of that
47 dnl program.
48
49 dnl PKG_PREREQ(MIN-VERSION)
50 dnl -----------------------
51 dnl Since: 0.29
52 dnl
53 dnl Verify that the version of the pkg-config macros are at least
54 dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
55 dnl installed version of pkg-config, this checks the developer's version
56 dnl of pkg.m4 when generating configure.
57 dnl
58 dnl To ensure that this macro is defined, also add:
59 dnl m4_ifndef([PKG_PREREQ],
60 dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
61 dnl
62 dnl See the "Since" comment for each macro you use to see what version
63 dnl of the macros you require.
64 m4_defun([PKG_PREREQ],
65 [m4_define([PKG_MACROS_VERSION], [0.29])
66 m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
67 [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
68 ])dnl PKG_PREREQ
69
70 dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
71 dnl ----------------------------------
72 dnl Since: 0.16
73 dnl
74 dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
75 dnl first found in the path. Checks that the version of pkg-config found
76 dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
77 dnl used since that's the first version where most current features of
78 dnl pkg-config existed.
79 AC_DEFUN([PKG_PROG_PKG_CONFIG],
80 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
81 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
82 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
83 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
84 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
85 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
86
87 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
88 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
89 fi
90 if test -n "$PKG_CONFIG"; then
91 _pkg_min_version=m4_default([$1], [0.9.0])
92 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
93 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
94 AC_MSG_RESULT([yes])
95 else
96 AC_MSG_RESULT([no])
97 PKG_CONFIG=""
98 fi
99 fi[]dnl
100 ])dnl PKG_PROG_PKG_CONFIG
101
102 dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
103 dnl -------------------------------------------------------------------
104 dnl Since: 0.18
105 dnl
106 dnl Check to see whether a particular set of modules exists. Similar to
107 dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
108 dnl
109 dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
110 dnl only at the first occurence in configure.ac, so if the first place
111 dnl it's called might be skipped (such as if it is within an "if", you
112 dnl have to call PKG_CHECK_EXISTS manually
113 AC_DEFUN([PKG_CHECK_EXISTS],
114 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
115 if test -n "$PKG_CONFIG" && \
116 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
117 m4_default([$2], [:])
118 m4_ifvaln([$3], [else
119 $3])dnl
120 fi])
121
122 dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
123 dnl ---------------------------------------------
124 dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
125 dnl pkg_failed based on the result.
126 m4_define([_PKG_CONFIG],
127 [if test -n "$$1"; then
128 pkg_cv_[]$1="$$1"
129 elif test -n "$PKG_CONFIG"; then
130 PKG_CHECK_EXISTS([$3],
131 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
132 test "x$?" != "x0" && pkg_failed=yes ],
133 [pkg_failed=yes])
134 else
135 pkg_failed=untried
136 fi[]dnl
137 ])dnl _PKG_CONFIG
138
139 dnl _PKG_SHORT_ERRORS_SUPPORTED
140 dnl ---------------------------
141 dnl Internal check to see if pkg-config supports short errors.
142 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
143 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
144 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
145 _pkg_short_errors_supported=yes
146 else
147 _pkg_short_errors_supported=no
148 fi[]dnl
149 ])dnl _PKG_SHORT_ERRORS_SUPPORTED
150
151
152 dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
153 dnl [ACTION-IF-NOT-FOUND])
154 dnl --------------------------------------------------------------
155 dnl Since: 0.4.0
156 dnl
157 dnl Note that if there is a possibility the first call to
158 dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
159 dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
160 AC_DEFUN([PKG_CHECK_MODULES],
161 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
162 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
163 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
164
165 pkg_failed=no
166 AC_MSG_CHECKING([for $1])
167
168 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
169 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
170
171 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
172 and $1[]_LIBS to avoid the need to call pkg-config.
173 See the pkg-config man page for more details.])
174
175 if test $pkg_failed = yes; then
176 AC_MSG_RESULT([no])
177 _PKG_SHORT_ERRORS_SUPPORTED
178 if test $_pkg_short_errors_supported = yes; then
179 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
180 else
181 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
182 fi
183 # Put the nasty error message in config.log where it belongs
184 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
185
186 m4_default([$4], [AC_MSG_ERROR(
187 [Package requirements ($2) were not met:
188
189 $$1_PKG_ERRORS
190
191 Consider adjusting the PKG_CONFIG_PATH environment variable if you
192 installed software in a non-standard prefix.
193
194 _PKG_TEXT])[]dnl
195 ])
196 elif test $pkg_failed = untried; then
197 AC_MSG_RESULT([no])
198 m4_default([$4], [AC_MSG_FAILURE(
199 [The pkg-config script could not be found or is too old. Make sure it
200 is in your PATH or set the PKG_CONFIG environment variable to the full
201 path to pkg-config.
202
203 _PKG_TEXT
204
205 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
206 ])
207 else
208 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
209 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
210 AC_MSG_RESULT([yes])
211 $3
212 fi[]dnl
213 ])dnl PKG_CHECK_MODULES
214
215
216 dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
217 dnl [ACTION-IF-NOT-FOUND])
218 dnl ---------------------------------------------------------------------
219 dnl Since: 0.29
220 dnl
221 dnl Checks for existence of MODULES and gathers its build flags with
222 dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
223 dnl and VARIABLE-PREFIX_LIBS from --libs.
224 dnl
225 dnl Note that if there is a possibility the first call to
226 dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
227 dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
228 dnl configure.ac.
229 AC_DEFUN([PKG_CHECK_MODULES_STATIC],
230 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
231 _save_PKG_CONFIG=$PKG_CONFIG
232 PKG_CONFIG="$PKG_CONFIG --static"
233 PKG_CHECK_MODULES($@)
234 PKG_CONFIG=$_save_PKG_CONFIG[]dnl
235 ])dnl PKG_CHECK_MODULES_STATIC
236
237
238 dnl PKG_INSTALLDIR([DIRECTORY])
239 dnl -------------------------
240 dnl Since: 0.27
241 dnl
242 dnl Substitutes the variable pkgconfigdir as the location where a module
243 dnl should install pkg-config .pc files. By default the directory is
244 dnl $libdir/pkgconfig, but the default can be changed by passing
245 dnl DIRECTORY. The user can override through the --with-pkgconfigdir
246 dnl parameter.
247 AC_DEFUN([PKG_INSTALLDIR],
248 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
249 m4_pushdef([pkg_description],
250 [pkg-config installation directory @<:@]pkg_default[@:>@])
251 AC_ARG_WITH([pkgconfigdir],
252 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
253 [with_pkgconfigdir=]pkg_default)
254 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
255 m4_popdef([pkg_default])
256 m4_popdef([pkg_description])
257 ])dnl PKG_INSTALLDIR
258
259
260 dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
261 dnl --------------------------------
262 dnl Since: 0.27
263 dnl
264 dnl Substitutes the variable noarch_pkgconfigdir as the location where a
265 dnl module should install arch-independent pkg-config .pc files. By
266 dnl default the directory is $datadir/pkgconfig, but the default can be
267 dnl changed by passing DIRECTORY. The user can override through the
268 dnl --with-noarch-pkgconfigdir parameter.
269 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
270 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
271 m4_pushdef([pkg_description],
272 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
273 AC_ARG_WITH([noarch-pkgconfigdir],
274 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
275 [with_noarch_pkgconfigdir=]pkg_default)
276 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
277 m4_popdef([pkg_default])
278 m4_popdef([pkg_description])
279 ])dnl PKG_NOARCH_INSTALLDIR
280
281
282 dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
283 dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
284 dnl -------------------------------------------
285 dnl Since: 0.28
286 dnl
287 dnl Retrieves the value of the pkg-config variable for the given module.
288 AC_DEFUN([PKG_CHECK_VAR],
289 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
290 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
291
292 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
293 AS_VAR_COPY([$1], [pkg_cv_][$1])
294
295 AS_VAR_IF([$1], [""], [$5], [$4])dnl
296 ])dnl PKG_CHECK_VAR
297
298 dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
299 dnl
300 dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
301 dnl
302 dnl Permission is hereby granted, free of charge, to any person obtaining a
303 dnl copy of this software and associated documentation files (the "Software"),
304 dnl to deal in the Software without restriction, including without limitation
305 dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
306 dnl and/or sell copies of the Software, and to permit persons to whom the
307 dnl Software is furnished to do so, subject to the following conditions:
308 dnl
309 dnl The above copyright notice and this permission notice (including the next
310 dnl paragraph) shall be included in all copies or substantial portions of the
311 dnl Software.
312 dnl
313 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
314 dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
315 dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
316 dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
317 dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
318 dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
319 dnl DEALINGS IN THE SOFTWARE.
320
321 # XORG_MACROS_VERSION(required-version)
322 # -------------------------------------
323 # Minimum version: 1.1.0
324 #
325 # If you're using a macro added in Version 1.1 or newer, include this in
326 # your configure.ac with the minimum required version, such as:
327 # XORG_MACROS_VERSION(1.1)
328 #
329 # To ensure that this macro is defined, also add:
330 # m4_ifndef([XORG_MACROS_VERSION],
331 # [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
332 #
333 #
334 # See the "minimum version" comment for each macro you use to see what
335 # version you require.
336 m4_defun([XORG_MACROS_VERSION],[
337 m4_define([vers_have], [1.19.0])
338 m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
339 m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
340 m4_if(m4_cmp(maj_have, maj_needed), 0,,
341 [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
342 m4_if(m4_version_compare(vers_have, [$1]), -1,
343 [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
344 m4_undefine([vers_have])
345 m4_undefine([maj_have])
346 m4_undefine([maj_needed])
347 ]) # XORG_MACROS_VERSION
348
349 # XORG_PROG_RAWCPP()
350 # ------------------
351 # Minimum version: 1.0.0
352 #
353 # Find cpp program and necessary flags for use in pre-processing text files
354 # such as man pages and config files
355 AC_DEFUN([XORG_PROG_RAWCPP],[
356 AC_REQUIRE([AC_PROG_CPP])
357 AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
358 [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
359
360 # Check for flag to avoid builtin definitions - assumes unix is predefined,
361 # which is not the best choice for supporting other OS'es, but covers most
362 # of the ones we need for now.
363 AC_MSG_CHECKING([if $RAWCPP requires -undef])
364 AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
365 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
366 AC_MSG_RESULT([no])
367 else
368 if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
369 RAWCPPFLAGS=-undef
370 AC_MSG_RESULT([yes])
371 # under Cygwin unix is still defined even with -undef
372 elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
373 RAWCPPFLAGS="-undef -ansi"
374 AC_MSG_RESULT([yes, with -ansi])
375 else
376 AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
377 fi
378 fi
379 rm -f conftest.$ac_ext
380
381 AC_MSG_CHECKING([if $RAWCPP requires -traditional])
382 AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])])
383 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
384 AC_MSG_RESULT([no])
385 else
386 if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
387 TRADITIONALCPPFLAGS="-traditional"
388 RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
389 AC_MSG_RESULT([yes])
390 else
391 AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
392 fi
393 fi
394 rm -f conftest.$ac_ext
395 AC_SUBST(RAWCPPFLAGS)
396 AC_SUBST(TRADITIONALCPPFLAGS)
397 ]) # XORG_PROG_RAWCPP
398
399 # XORG_MANPAGE_SECTIONS()
400 # -----------------------
401 # Minimum version: 1.0.0
402 #
403 # Determine which sections man pages go in for the different man page types
404 # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
405 # Not sure if there's any better way than just hardcoding by OS name.
406 # Override default settings by setting environment variables
407 # Added MAN_SUBSTS in version 1.8
408 # Added AC_PROG_SED in version 1.8
409
410 AC_DEFUN([XORG_MANPAGE_SECTIONS],[
411 AC_REQUIRE([AC_CANONICAL_HOST])
412 AC_REQUIRE([AC_PROG_SED])
413
414 if test x$APP_MAN_SUFFIX = x ; then
415 APP_MAN_SUFFIX=1
416 fi
417 if test x$APP_MAN_DIR = x ; then
418 APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
419 fi
420
421 if test x$LIB_MAN_SUFFIX = x ; then
422 LIB_MAN_SUFFIX=3
423 fi
424 if test x$LIB_MAN_DIR = x ; then
425 LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
426 fi
427
428 if test x$FILE_MAN_SUFFIX = x ; then
429 case $host_os in
430 # Solaris 2.0 - 11 use SysV man page sections
431 solaris2.?|solaris2.1[[01]]) FILE_MAN_SUFFIX=4 ;;
432 *) FILE_MAN_SUFFIX=5 ;;
433 esac
434 fi
435 if test x$FILE_MAN_DIR = x ; then
436 FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
437 fi
438
439 if test x$MISC_MAN_SUFFIX = x ; then
440 case $host_os in
441 # Solaris 2.0 - 11 use SysV man page sections
442 solaris2.?|solaris2.1[[01]]) MISC_MAN_SUFFIX=5 ;;
443 *) MISC_MAN_SUFFIX=7 ;;
444 esac
445 fi
446 if test x$MISC_MAN_DIR = x ; then
447 MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
448 fi
449
450 if test x$DRIVER_MAN_SUFFIX = x ; then
451 case $host_os in
452 # Solaris 2.0 - 11 use SysV man page sections
453 solaris2.?|solaris2.1[[01]]) DRIVER_MAN_SUFFIX=7 ;;
454 *) DRIVER_MAN_SUFFIX=4 ;;
455 esac
456 fi
457 if test x$DRIVER_MAN_DIR = x ; then
458 DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
459 fi
460
461 if test x$ADMIN_MAN_SUFFIX = x ; then
462 case $host_os in
463 # Solaris 2.0 - 11 use SysV man page sections
464 solaris2.?|solaris2.1[[01]]) ADMIN_MAN_SUFFIX=1m ;;
465 *) ADMIN_MAN_SUFFIX=8 ;;
466 esac
467 fi
468 if test x$ADMIN_MAN_DIR = x ; then
469 ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
470 fi
471
472
473 AC_SUBST([APP_MAN_SUFFIX])
474 AC_SUBST([LIB_MAN_SUFFIX])
475 AC_SUBST([FILE_MAN_SUFFIX])
476 AC_SUBST([MISC_MAN_SUFFIX])
477 AC_SUBST([DRIVER_MAN_SUFFIX])
478 AC_SUBST([ADMIN_MAN_SUFFIX])
479 AC_SUBST([APP_MAN_DIR])
480 AC_SUBST([LIB_MAN_DIR])
481 AC_SUBST([FILE_MAN_DIR])
482 AC_SUBST([MISC_MAN_DIR])
483 AC_SUBST([DRIVER_MAN_DIR])
484 AC_SUBST([ADMIN_MAN_DIR])
485
486 XORG_MAN_PAGE="X Version 11"
487 AC_SUBST([XORG_MAN_PAGE])
488 MAN_SUBSTS="\
489 -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
490 -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
491 -e 's|__xservername__|Xorg|g' \
492 -e 's|__xconfigfile__|xorg.conf|g' \
493 -e 's|__projectroot__|\$(prefix)|g' \
494 -e 's|__apploaddir__|\$(appdefaultdir)|g' \
495 -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
496 -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
497 -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
498 -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
499 -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
500 -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
501 AC_SUBST([MAN_SUBSTS])
502
503 ]) # XORG_MANPAGE_SECTIONS
504
505 # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
506 # ------------------------
507 # Minimum version: 1.7.0
508 #
509 # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
510 # provided by xorg-sgml-doctools, if installed.
511 AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
512 AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
513 XORG_SGML_PATH=
514 PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
515 [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
516 [m4_ifval([$1],[:],
517 [if test x"$cross_compiling" != x"yes" ; then
518 AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
519 [XORG_SGML_PATH=$prefix/share/sgml])
520 fi])
521 ])
522
523 # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
524 # the path and the name of the doc stylesheet
525 if test "x$XORG_SGML_PATH" != "x" ; then
526 AC_MSG_RESULT([$XORG_SGML_PATH])
527 STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
528 XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
529 else
530 AC_MSG_RESULT([no])
531 fi
532
533 AC_SUBST(XORG_SGML_PATH)
534 AC_SUBST(STYLESHEET_SRCDIR)
535 AC_SUBST(XSL_STYLESHEET)
536 AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
537 ]) # XORG_CHECK_SGML_DOCTOOLS
538
539 # XORG_CHECK_LINUXDOC
540 # -------------------
541 # Minimum version: 1.0.0
542 #
543 # Defines the variable MAKE_TEXT if the necessary tools and
544 # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
545 # Whether or not the necessary tools and files are found can be checked
546 # with the AM_CONDITIONAL "BUILD_LINUXDOC"
547 AC_DEFUN([XORG_CHECK_LINUXDOC],[
548 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
549 AC_REQUIRE([XORG_WITH_PS2PDF])
550
551 AC_PATH_PROG(LINUXDOC, linuxdoc)
552
553 AC_MSG_CHECKING([whether to build documentation])
554
555 if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
556 BUILDDOC=yes
557 else
558 BUILDDOC=no
559 fi
560
561 AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
562
563 AC_MSG_RESULT([$BUILDDOC])
564
565 AC_MSG_CHECKING([whether to build pdf documentation])
566
567 if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
568 BUILDPDFDOC=yes
569 else
570 BUILDPDFDOC=no
571 fi
572
573 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
574
575 AC_MSG_RESULT([$BUILDPDFDOC])
576
577 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
578 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
579 MAKE_PDF="$PS2PDF"
580 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
581
582 AC_SUBST(MAKE_TEXT)
583 AC_SUBST(MAKE_PS)
584 AC_SUBST(MAKE_PDF)
585 AC_SUBST(MAKE_HTML)
586 ]) # XORG_CHECK_LINUXDOC
587
588 # XORG_CHECK_DOCBOOK
589 # -------------------
590 # Minimum version: 1.0.0
591 #
592 # Checks for the ability to build output formats from SGML DocBook source.
593 # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
594 # indicates whether the necessary tools and files are found and, if set,
595 # $(MAKE_XXX) blah.sgml will produce blah.xxx.
596 AC_DEFUN([XORG_CHECK_DOCBOOK],[
597 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
598
599 BUILDTXTDOC=no
600 BUILDPDFDOC=no
601 BUILDPSDOC=no
602 BUILDHTMLDOC=no
603
604 AC_PATH_PROG(DOCBOOKPS, docbook2ps)
605 AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
606 AC_PATH_PROG(DOCBOOKHTML, docbook2html)
607 AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
608
609 AC_MSG_CHECKING([whether to build text documentation])
610 if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
611 test x$BUILD_TXTDOC != xno; then
612 BUILDTXTDOC=yes
613 fi
614 AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
615 AC_MSG_RESULT([$BUILDTXTDOC])
616
617 AC_MSG_CHECKING([whether to build PDF documentation])
618 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
619 test x$BUILD_PDFDOC != xno; then
620 BUILDPDFDOC=yes
621 fi
622 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
623 AC_MSG_RESULT([$BUILDPDFDOC])
624
625 AC_MSG_CHECKING([whether to build PostScript documentation])
626 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
627 test x$BUILD_PSDOC != xno; then
628 BUILDPSDOC=yes
629 fi
630 AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
631 AC_MSG_RESULT([$BUILDPSDOC])
632
633 AC_MSG_CHECKING([whether to build HTML documentation])
634 if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
635 test x$BUILD_HTMLDOC != xno; then
636 BUILDHTMLDOC=yes
637 fi
638 AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
639 AC_MSG_RESULT([$BUILDHTMLDOC])
640
641 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
642 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
643 MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
644 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
645
646 AC_SUBST(MAKE_TEXT)
647 AC_SUBST(MAKE_PS)
648 AC_SUBST(MAKE_PDF)
649 AC_SUBST(MAKE_HTML)
650 ]) # XORG_CHECK_DOCBOOK
651
652 # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
653 # ----------------
654 # Minimum version: 1.5.0
655 # Minimum version for optional DEFAULT argument: 1.11.0
656 #
657 # Documentation tools are not always available on all platforms and sometimes
658 # not at the appropriate level. This macro enables a module to test for the
659 # presence of the tool and obtain it's path in separate variables. Coupled with
660 # the --with-xmlto option, it allows maximum flexibilty in making decisions
661 # as whether or not to use the xmlto package. When DEFAULT is not specified,
662 # --with-xmlto assumes 'auto'.
663 #
664 # Interface to module:
665 # HAVE_XMLTO: used in makefiles to conditionally generate documentation
666 # XMLTO: returns the path of the xmlto program found
667 # returns the path set by the user in the environment
668 # --with-xmlto: 'yes' user instructs the module to use xmlto
669 # 'no' user instructs the module not to use xmlto
670 #
671 # Added in version 1.10.0
672 # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
673 # xmlto for text output requires either lynx, links, or w3m browsers
674 #
675 # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
676 #
677 AC_DEFUN([XORG_WITH_XMLTO],[
678 AC_ARG_VAR([XMLTO], [Path to xmlto command])
679 m4_define([_defopt], m4_default([$2], [auto]))
680 AC_ARG_WITH(xmlto,
681 AS_HELP_STRING([--with-xmlto],
682 [Use xmlto to regenerate documentation (default: ]_defopt[)]),
683 [use_xmlto=$withval], [use_xmlto=]_defopt)
684 m4_undefine([_defopt])
685
686 if test "x$use_xmlto" = x"auto"; then
687 AC_PATH_PROG([XMLTO], [xmlto])
688 if test "x$XMLTO" = "x"; then
689 AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
690 have_xmlto=no
691 else
692 have_xmlto=yes
693 fi
694 elif test "x$use_xmlto" = x"yes" ; then
695 AC_PATH_PROG([XMLTO], [xmlto])
696 if test "x$XMLTO" = "x"; then
697 AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
698 fi
699 have_xmlto=yes
700 elif test "x$use_xmlto" = x"no" ; then
701 if test "x$XMLTO" != "x"; then
702 AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
703 fi
704 have_xmlto=no
705 else
706 AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
707 fi
708
709 # Test for a minimum version of xmlto, if provided.
710 m4_ifval([$1],
711 [if test "$have_xmlto" = yes; then
712 # scrape the xmlto version
713 AC_MSG_CHECKING([the xmlto version])
714 xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
715 AC_MSG_RESULT([$xmlto_version])
716 AS_VERSION_COMPARE([$xmlto_version], [$1],
717 [if test "x$use_xmlto" = xauto; then
718 AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
719 have_xmlto=no
720 else
721 AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
722 fi])
723 fi])
724
725 # Test for the ability of xmlto to generate a text target
726 #
727 # NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
728 # following test for empty XML docbook files.
729 # For compatibility reasons use the following empty XML docbook file and if
730 # it fails try it again with a non-empty XML file.
731 have_xmlto_text=no
732 cat > conftest.xml << "EOF"
733 EOF
734 AS_IF([test "$have_xmlto" = yes],
735 [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
736 [have_xmlto_text=yes],
737 [# Try it again with a non-empty XML file.
738 cat > conftest.xml << "EOF"
739 <x></x>
740 EOF
741 AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
742 [have_xmlto_text=yes],
743 [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
744 rm -f conftest.xml
745 AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
746 AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
747 ]) # XORG_WITH_XMLTO
748
749 # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
750 # --------------------------------------------
751 # Minimum version: 1.12.0
752 # Minimum version for optional DEFAULT argument: 1.12.0
753 #
754 # XSLT (Extensible Stylesheet Language Transformations) is a declarative,
755 # XML-based language used for the transformation of XML documents.
756 # The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
757 # It is used under the cover by xmlto to generate html files from DocBook/XML.
758 # The XSLT processor is often used as a standalone tool for transformations.
759 # It should not be assumed that this tool is used only to work with documnetation.
760 # When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
761 #
762 # Interface to module:
763 # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
764 # XSLTPROC: returns the path of the xsltproc program found
765 # returns the path set by the user in the environment
766 # --with-xsltproc: 'yes' user instructs the module to use xsltproc
767 # 'no' user instructs the module not to use xsltproc
768 # have_xsltproc: returns yes if xsltproc found in PATH or no
769 #
770 # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
771 #
772 AC_DEFUN([XORG_WITH_XSLTPROC],[
773 AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
774 # Preserves the interface, should it be implemented later
775 m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
776 m4_define([_defopt], m4_default([$2], [auto]))
777 AC_ARG_WITH(xsltproc,
778 AS_HELP_STRING([--with-xsltproc],
779 [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
780 [use_xsltproc=$withval], [use_xsltproc=]_defopt)
781 m4_undefine([_defopt])
782
783 if test "x$use_xsltproc" = x"auto"; then
784 AC_PATH_PROG([XSLTPROC], [xsltproc])
785 if test "x$XSLTPROC" = "x"; then
786 AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
787 have_xsltproc=no
788 else
789 have_xsltproc=yes
790 fi
791 elif test "x$use_xsltproc" = x"yes" ; then
792 AC_PATH_PROG([XSLTPROC], [xsltproc])
793 if test "x$XSLTPROC" = "x"; then
794 AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
795 fi
796 have_xsltproc=yes
797 elif test "x$use_xsltproc" = x"no" ; then
798 if test "x$XSLTPROC" != "x"; then
799 AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
800 fi
801 have_xsltproc=no
802 else
803 AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
804 fi
805
806 AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
807 ]) # XORG_WITH_XSLTPROC
808
809 # XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
810 # ----------------------------------------
811 # Minimum version: 1.15.0
812 #
813 # PERL (Practical Extraction and Report Language) is a language optimized for
814 # scanning arbitrary text files, extracting information from those text files,
815 # and printing reports based on that information.
816 #
817 # When DEFAULT is not specified, --with-perl assumes 'auto'.
818 #
819 # Interface to module:
820 # HAVE_PERL: used in makefiles to conditionally scan text files
821 # PERL: returns the path of the perl program found
822 # returns the path set by the user in the environment
823 # --with-perl: 'yes' user instructs the module to use perl
824 # 'no' user instructs the module not to use perl
825 # have_perl: returns yes if perl found in PATH or no
826 #
827 # If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
828 #
829 AC_DEFUN([XORG_WITH_PERL],[
830 AC_ARG_VAR([PERL], [Path to perl command])
831 # Preserves the interface, should it be implemented later
832 m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
833 m4_define([_defopt], m4_default([$2], [auto]))
834 AC_ARG_WITH(perl,
835 AS_HELP_STRING([--with-perl],
836 [Use perl for extracting information from files (default: ]_defopt[)]),
837 [use_perl=$withval], [use_perl=]_defopt)
838 m4_undefine([_defopt])
839
840 if test "x$use_perl" = x"auto"; then
841 AC_PATH_PROG([PERL], [perl])
842 if test "x$PERL" = "x"; then
843 AC_MSG_WARN([perl not found - cannot extract information and report])
844 have_perl=no
845 else
846 have_perl=yes
847 fi
848 elif test "x$use_perl" = x"yes" ; then
849 AC_PATH_PROG([PERL], [perl])
850 if test "x$PERL" = "x"; then
851 AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
852 fi
853 have_perl=yes
854 elif test "x$use_perl" = x"no" ; then
855 if test "x$PERL" != "x"; then
856 AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
857 fi
858 have_perl=no
859 else
860 AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
861 fi
862
863 AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
864 ]) # XORG_WITH_PERL
865
866 # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
867 # ----------------
868 # Minimum version: 1.5.0
869 # Minimum version for optional DEFAULT argument: 1.11.0
870 #
871 # Documentation tools are not always available on all platforms and sometimes
872 # not at the appropriate level. This macro enables a module to test for the
873 # presence of the tool and obtain it's path in separate variables. Coupled with
874 # the --with-asciidoc option, it allows maximum flexibilty in making decisions
875 # as whether or not to use the asciidoc package. When DEFAULT is not specified,
876 # --with-asciidoc assumes 'auto'.
877 #
878 # Interface to module:
879 # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
880 # ASCIIDOC: returns the path of the asciidoc program found
881 # returns the path set by the user in the environment
882 # --with-asciidoc: 'yes' user instructs the module to use asciidoc
883 # 'no' user instructs the module not to use asciidoc
884 #
885 # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
886 #
887 AC_DEFUN([XORG_WITH_ASCIIDOC],[
888 AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
889 m4_define([_defopt], m4_default([$2], [auto]))
890 AC_ARG_WITH(asciidoc,
891 AS_HELP_STRING([--with-asciidoc],
892 [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
893 [use_asciidoc=$withval], [use_asciidoc=]_defopt)
894 m4_undefine([_defopt])
895
896 if test "x$use_asciidoc" = x"auto"; then
897 AC_PATH_PROG([ASCIIDOC], [asciidoc])
898 if test "x$ASCIIDOC" = "x"; then
899 AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
900 have_asciidoc=no
901 else
902 have_asciidoc=yes
903 fi
904 elif test "x$use_asciidoc" = x"yes" ; then
905 AC_PATH_PROG([ASCIIDOC], [asciidoc])
906 if test "x$ASCIIDOC" = "x"; then
907 AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
908 fi
909 have_asciidoc=yes
910 elif test "x$use_asciidoc" = x"no" ; then
911 if test "x$ASCIIDOC" != "x"; then
912 AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
913 fi
914 have_asciidoc=no
915 else
916 AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
917 fi
918 m4_ifval([$1],
919 [if test "$have_asciidoc" = yes; then
920 # scrape the asciidoc version
921 AC_MSG_CHECKING([the asciidoc version])
922 asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
923 AC_MSG_RESULT([$asciidoc_version])
924 AS_VERSION_COMPARE([$asciidoc_version], [$1],
925 [if test "x$use_asciidoc" = xauto; then
926 AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
927 have_asciidoc=no
928 else
929 AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
930 fi])
931 fi])
932 AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
933 ]) # XORG_WITH_ASCIIDOC
934
935 # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
936 # -------------------------------------------
937 # Minimum version: 1.5.0
938 # Minimum version for optional DEFAULT argument: 1.11.0
939 # Minimum version for optional DOT checking: 1.18.0
940 #
941 # Documentation tools are not always available on all platforms and sometimes
942 # not at the appropriate level. This macro enables a module to test for the
943 # presence of the tool and obtain it's path in separate variables. Coupled with
944 # the --with-doxygen option, it allows maximum flexibilty in making decisions
945 # as whether or not to use the doxygen package. When DEFAULT is not specified,
946 # --with-doxygen assumes 'auto'.
947 #
948 # Interface to module:
949 # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
950 # DOXYGEN: returns the path of the doxygen program found
951 # returns the path set by the user in the environment
952 # --with-doxygen: 'yes' user instructs the module to use doxygen
953 # 'no' user instructs the module not to use doxygen
954 #
955 # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
956 #
957 AC_DEFUN([XORG_WITH_DOXYGEN],[
958 AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
959 AC_ARG_VAR([DOT], [Path to the dot graphics utility])
960 m4_define([_defopt], m4_default([$2], [auto]))
961 AC_ARG_WITH(doxygen,
962 AS_HELP_STRING([--with-doxygen],
963 [Use doxygen to regenerate documentation (default: ]_defopt[)]),
964 [use_doxygen=$withval], [use_doxygen=]_defopt)
965 m4_undefine([_defopt])
966
967 if test "x$use_doxygen" = x"auto"; then
968 AC_PATH_PROG([DOXYGEN], [doxygen])
969 if test "x$DOXYGEN" = "x"; then
970 AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
971 have_doxygen=no
972 else
973 have_doxygen=yes
974 fi
975 elif test "x$use_doxygen" = x"yes" ; then
976 AC_PATH_PROG([DOXYGEN], [doxygen])
977 if test "x$DOXYGEN" = "x"; then
978 AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
979 fi
980 have_doxygen=yes
981 elif test "x$use_doxygen" = x"no" ; then
982 if test "x$DOXYGEN" != "x"; then
983 AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
984 fi
985 have_doxygen=no
986 else
987 AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
988 fi
989 m4_ifval([$1],
990 [if test "$have_doxygen" = yes; then
991 # scrape the doxygen version
992 AC_MSG_CHECKING([the doxygen version])
993 doxygen_version=`$DOXYGEN --version 2>/dev/null`
994 AC_MSG_RESULT([$doxygen_version])
995 AS_VERSION_COMPARE([$doxygen_version], [$1],
996 [if test "x$use_doxygen" = xauto; then
997 AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
998 have_doxygen=no
999 else
1000 AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1001 fi])
1002 fi])
1003
1004 dnl Check for DOT if we have doxygen. The caller decides if it is mandatory
1005 dnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
1006 dnl HAVE_DOT = @HAVE_DOT@
1007 HAVE_DOT=no
1008 if test "x$have_doxygen" = "xyes"; then
1009 AC_PATH_PROG([DOT], [dot])
1010 if test "x$DOT" != "x"; then
1011 HAVE_DOT=yes
1012 fi
1013 fi
1014
1015 AC_SUBST([HAVE_DOT])
1016 AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
1017 AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1018 ]) # XORG_WITH_DOXYGEN
1019
1020 # XORG_WITH_GROFF([DEFAULT])
1021 # ----------------
1022 # Minimum version: 1.6.0
1023 # Minimum version for optional DEFAULT argument: 1.11.0
1024 #
1025 # Documentation tools are not always available on all platforms and sometimes
1026 # not at the appropriate level. This macro enables a module to test for the
1027 # presence of the tool and obtain it's path in separate variables. Coupled with
1028 # the --with-groff option, it allows maximum flexibilty in making decisions
1029 # as whether or not to use the groff package. When DEFAULT is not specified,
1030 # --with-groff assumes 'auto'.
1031 #
1032 # Interface to module:
1033 # HAVE_GROFF: used in makefiles to conditionally generate documentation
1034 # HAVE_GROFF_MM: the memorandum macros (-mm) package
1035 # HAVE_GROFF_MS: the -ms macros package
1036 # GROFF: returns the path of the groff program found
1037 # returns the path set by the user in the environment
1038 # --with-groff: 'yes' user instructs the module to use groff
1039 # 'no' user instructs the module not to use groff
1040 #
1041 # Added in version 1.9.0:
1042 # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1043 # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1044 # psselect from the psutils package.
1045 # the ghostcript package. Refer to the grohtml man pages
1046 #
1047 # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1048 #
1049 # OS and distros often splits groff in a basic and full package, the former
1050 # having the groff program and the later having devices, fonts and macros
1051 # Checking for the groff executable is not enough.
1052 #
1053 # If macros are missing, we cannot assume that groff is useless, so we don't
1054 # unset HAVE_GROFF or GROFF env variables.
1055 # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1056 #
1057 AC_DEFUN([XORG_WITH_GROFF],[
1058 AC_ARG_VAR([GROFF], [Path to groff command])
1059 m4_define([_defopt], m4_default([$1], [auto]))
1060 AC_ARG_WITH(groff,
1061 AS_HELP_STRING([--with-groff],
1062 [Use groff to regenerate documentation (default: ]_defopt[)]),
1063 [use_groff=$withval], [use_groff=]_defopt)
1064 m4_undefine([_defopt])
1065
1066 if test "x$use_groff" = x"auto"; then
1067 AC_PATH_PROG([GROFF], [groff])
1068 if test "x$GROFF" = "x"; then
1069 AC_MSG_WARN([groff not found - documentation targets will be skipped])
1070 have_groff=no
1071 else
1072 have_groff=yes
1073 fi
1074 elif test "x$use_groff" = x"yes" ; then
1075 AC_PATH_PROG([GROFF], [groff])
1076 if test "x$GROFF" = "x"; then
1077 AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1078 fi
1079 have_groff=yes
1080 elif test "x$use_groff" = x"no" ; then
1081 if test "x$GROFF" != "x"; then
1082 AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1083 fi
1084 have_groff=no
1085 else
1086 AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1087 fi
1088
1089 # We have groff, test for the presence of the macro packages
1090 if test "x$have_groff" = x"yes"; then
1091 AC_MSG_CHECKING([for ${GROFF} -ms macros])
1092 if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1093 groff_ms_works=yes
1094 else
1095 groff_ms_works=no
1096 fi
1097 AC_MSG_RESULT([$groff_ms_works])
1098 AC_MSG_CHECKING([for ${GROFF} -mm macros])
1099 if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1100 groff_mm_works=yes
1101 else
1102 groff_mm_works=no
1103 fi
1104 AC_MSG_RESULT([$groff_mm_works])
1105 fi
1106
1107 # We have groff, test for HTML dependencies, one command per package
1108 if test "x$have_groff" = x"yes"; then
1109 AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1110 AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1111 AC_PATH_PROG(PSSELECT_PATH, [psselect])
1112 if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1113 have_groff_html=yes
1114 else
1115 have_groff_html=no
1116 AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1117 fi
1118 fi
1119
1120 # Set Automake conditionals for Makefiles
1121 AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1122 AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1123 AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1124 AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1125 ]) # XORG_WITH_GROFF
1126
1127 # XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
1128 # ---------------------------------------
1129 # Minimum version: 1.6.0
1130 # Minimum version for optional DEFAULT argument: 1.11.0
1131 # Minimum version for optional MIN-VERSION argument: 1.15.0
1132 #
1133 # Documentation tools are not always available on all platforms and sometimes
1134 # not at the appropriate level. This macro enables a module to test for the
1135 # presence of the tool and obtain it's path in separate variables. Coupled with
1136 # the --with-fop option, it allows maximum flexibilty in making decisions
1137 # as whether or not to use the fop package. When DEFAULT is not specified,
1138 # --with-fop assumes 'auto'.
1139 #
1140 # Interface to module:
1141 # HAVE_FOP: used in makefiles to conditionally generate documentation
1142 # FOP: returns the path of the fop program found
1143 # returns the path set by the user in the environment
1144 # --with-fop: 'yes' user instructs the module to use fop
1145 # 'no' user instructs the module not to use fop
1146 #
1147 # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1148 #
1149 AC_DEFUN([XORG_WITH_FOP],[
1150 AC_ARG_VAR([FOP], [Path to fop command])
1151 m4_define([_defopt], m4_default([$2], [auto]))
1152 AC_ARG_WITH(fop,
1153 AS_HELP_STRING([--with-fop],
1154 [Use fop to regenerate documentation (default: ]_defopt[)]),
1155 [use_fop=$withval], [use_fop=]_defopt)
1156 m4_undefine([_defopt])
1157
1158 if test "x$use_fop" = x"auto"; then
1159 AC_PATH_PROG([FOP], [fop])
1160 if test "x$FOP" = "x"; then
1161 AC_MSG_WARN([fop not found - documentation targets will be skipped])
1162 have_fop=no
1163 else
1164 have_fop=yes
1165 fi
1166 elif test "x$use_fop" = x"yes" ; then
1167 AC_PATH_PROG([FOP], [fop])
1168 if test "x$FOP" = "x"; then
1169 AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1170 fi
1171 have_fop=yes
1172 elif test "x$use_fop" = x"no" ; then
1173 if test "x$FOP" != "x"; then
1174 AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1175 fi
1176 have_fop=no
1177 else
1178 AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1179 fi
1180
1181 # Test for a minimum version of fop, if provided.
1182 m4_ifval([$1],
1183 [if test "$have_fop" = yes; then
1184 # scrape the fop version
1185 AC_MSG_CHECKING([for fop minimum version])
1186 fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
1187 AC_MSG_RESULT([$fop_version])
1188 AS_VERSION_COMPARE([$fop_version], [$1],
1189 [if test "x$use_fop" = xauto; then
1190 AC_MSG_WARN([fop version $fop_version found, but $1 needed])
1191 have_fop=no
1192 else
1193 AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
1194 fi])
1195 fi])
1196 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1197 ]) # XORG_WITH_FOP
1198
1199 # XORG_WITH_M4([MIN-VERSION])
1200 # ---------------------------
1201 # Minimum version: 1.19.0
1202 #
1203 # This macro attempts to locate an m4 macro processor which supports
1204 # -I option and is only useful for modules relying on M4 in order to
1205 # expand macros in source code files.
1206 #
1207 # Interface to module:
1208 # M4: returns the path of the m4 program found
1209 # returns the path set by the user in the environment
1210 #
1211 AC_DEFUN([XORG_WITH_M4], [
1212 AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
1213 [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
1214 [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
1215 ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
1216 [AC_MSG_ERROR([could not find m4 that supports -I option])],
1217 [$PATH:/usr/gnu/bin])])
1218
1219 AC_SUBST([M4], [$ac_cv_path_M4])
1220 ]) # XORG_WITH_M4
1221
1222 # XORG_WITH_PS2PDF([DEFAULT])
1223 # ----------------
1224 # Minimum version: 1.6.0
1225 # Minimum version for optional DEFAULT argument: 1.11.0
1226 #
1227 # Documentation tools are not always available on all platforms and sometimes
1228 # not at the appropriate level. This macro enables a module to test for the
1229 # presence of the tool and obtain it's path in separate variables. Coupled with
1230 # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1231 # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1232 # --with-ps2pdf assumes 'auto'.
1233 #
1234 # Interface to module:
1235 # HAVE_PS2PDF: used in makefiles to conditionally generate documentation
1236 # PS2PDF: returns the path of the ps2pdf program found
1237 # returns the path set by the user in the environment
1238 # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1239 # 'no' user instructs the module not to use ps2pdf
1240 #
1241 # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1242 #
1243 AC_DEFUN([XORG_WITH_PS2PDF],[
1244 AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1245 m4_define([_defopt], m4_default([$1], [auto]))
1246 AC_ARG_WITH(ps2pdf,
1247 AS_HELP_STRING([--with-ps2pdf],
1248 [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1249 [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1250 m4_undefine([_defopt])
1251
1252 if test "x$use_ps2pdf" = x"auto"; then
1253 AC_PATH_PROG([PS2PDF], [ps2pdf])
1254 if test "x$PS2PDF" = "x"; then
1255 AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1256 have_ps2pdf=no
1257 else
1258 have_ps2pdf=yes
1259 fi
1260 elif test "x$use_ps2pdf" = x"yes" ; then
1261 AC_PATH_PROG([PS2PDF], [ps2pdf])
1262 if test "x$PS2PDF" = "x"; then
1263 AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1264 fi
1265 have_ps2pdf=yes
1266 elif test "x$use_ps2pdf" = x"no" ; then
1267 if test "x$PS2PDF" != "x"; then
1268 AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1269 fi
1270 have_ps2pdf=no
1271 else
1272 AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1273 fi
1274 AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1275 ]) # XORG_WITH_PS2PDF
1276
1277 # XORG_ENABLE_DOCS (enable_docs=yes)
1278 # ----------------
1279 # Minimum version: 1.6.0
1280 #
1281 # Documentation tools are not always available on all platforms and sometimes
1282 # not at the appropriate level. This macro enables a builder to skip all
1283 # documentation targets except traditional man pages.
1284 # Combined with the specific tool checking macros XORG_WITH_*, it provides
1285 # maximum flexibilty in controlling documentation building.
1286 # Refer to:
1287 # XORG_WITH_XMLTO --with-xmlto
1288 # XORG_WITH_ASCIIDOC --with-asciidoc
1289 # XORG_WITH_DOXYGEN --with-doxygen
1290 # XORG_WITH_FOP --with-fop
1291 # XORG_WITH_GROFF --with-groff
1292 # XORG_WITH_PS2PDF --with-ps2pdf
1293 #
1294 # Interface to module:
1295 # ENABLE_DOCS: used in makefiles to conditionally generate documentation
1296 # --enable-docs: 'yes' user instructs the module to generate docs
1297 # 'no' user instructs the module not to generate docs
1298 # parm1: specify the default value, yes or no.
1299 #
1300 AC_DEFUN([XORG_ENABLE_DOCS],[
1301 m4_define([docs_default], m4_default([$1], [yes]))
1302 AC_ARG_ENABLE(docs,
1303 AS_HELP_STRING([--enable-docs],
1304 [Enable building the documentation (default: ]docs_default[)]),
1305 [build_docs=$enableval], [build_docs=]docs_default)
1306 m4_undefine([docs_default])
1307 AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1308 AC_MSG_CHECKING([whether to build documentation])
1309 AC_MSG_RESULT([$build_docs])
1310 ]) # XORG_ENABLE_DOCS
1311
1312 # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1313 # ----------------
1314 # Minimum version: 1.6.0
1315 #
1316 # This macro enables a builder to skip all developer documentation.
1317 # Combined with the specific tool checking macros XORG_WITH_*, it provides
1318 # maximum flexibilty in controlling documentation building.
1319 # Refer to:
1320 # XORG_WITH_XMLTO --with-xmlto
1321 # XORG_WITH_ASCIIDOC --with-asciidoc
1322 # XORG_WITH_DOXYGEN --with-doxygen
1323 # XORG_WITH_FOP --with-fop
1324 # XORG_WITH_GROFF --with-groff
1325 # XORG_WITH_PS2PDF --with-ps2pdf
1326 #
1327 # Interface to module:
1328 # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
1329 # --enable-devel-docs: 'yes' user instructs the module to generate developer docs
1330 # 'no' user instructs the module not to generate developer docs
1331 # parm1: specify the default value, yes or no.
1332 #
1333 AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1334 m4_define([devel_default], m4_default([$1], [yes]))
1335 AC_ARG_ENABLE(devel-docs,
1336 AS_HELP_STRING([--enable-devel-docs],
1337 [Enable building the developer documentation (default: ]devel_default[)]),
1338 [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1339 m4_undefine([devel_default])
1340 AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1341 AC_MSG_CHECKING([whether to build developer documentation])
1342 AC_MSG_RESULT([$build_devel_docs])
1343 ]) # XORG_ENABLE_DEVEL_DOCS
1344
1345 # XORG_ENABLE_SPECS (enable_specs=yes)
1346 # ----------------
1347 # Minimum version: 1.6.0
1348 #
1349 # This macro enables a builder to skip all functional specification targets.
1350 # Combined with the specific tool checking macros XORG_WITH_*, it provides
1351 # maximum flexibilty in controlling documentation building.
1352 # Refer to:
1353 # XORG_WITH_XMLTO --with-xmlto
1354 # XORG_WITH_ASCIIDOC --with-asciidoc
1355 # XORG_WITH_DOXYGEN --with-doxygen
1356 # XORG_WITH_FOP --with-fop
1357 # XORG_WITH_GROFF --with-groff
1358 # XORG_WITH_PS2PDF --with-ps2pdf
1359 #
1360 # Interface to module:
1361 # ENABLE_SPECS: used in makefiles to conditionally generate specs
1362 # --enable-specs: 'yes' user instructs the module to generate specs
1363 # 'no' user instructs the module not to generate specs
1364 # parm1: specify the default value, yes or no.
1365 #
1366 AC_DEFUN([XORG_ENABLE_SPECS],[
1367 m4_define([spec_default], m4_default([$1], [yes]))
1368 AC_ARG_ENABLE(specs,
1369 AS_HELP_STRING([--enable-specs],
1370 [Enable building the specs (default: ]spec_default[)]),
1371 [build_specs=$enableval], [build_specs=]spec_default)
1372 m4_undefine([spec_default])
1373 AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1374 AC_MSG_CHECKING([whether to build functional specifications])
1375 AC_MSG_RESULT([$build_specs])
1376 ]) # XORG_ENABLE_SPECS
1377
1378 # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
1379 # ----------------------------------------------
1380 # Minimum version: 1.13.0
1381 #
1382 # This macro enables a builder to enable/disable unit testing
1383 # It makes no assumption about the test cases implementation
1384 # Test cases may or may not use Automake "Support for test suites"
1385 # They may or may not use the software utility library GLib
1386 #
1387 # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
1388 # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
1389 # The variable enable_unit_tests is used by other macros in this file.
1390 #
1391 # Interface to module:
1392 # ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests
1393 # enable_unit_tests: used in configure.ac for additional configuration
1394 # --enable-unit-tests: 'yes' user instructs the module to build tests
1395 # 'no' user instructs the module not to build tests
1396 # parm1: specify the default value, yes or no.
1397 #
1398 AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
1399 AC_BEFORE([$0], [XORG_WITH_GLIB])
1400 AC_BEFORE([$0], [XORG_LD_WRAP])
1401 AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1402 m4_define([_defopt], m4_default([$1], [auto]))
1403 AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
1404 [Enable building unit test cases (default: ]_defopt[)]),
1405 [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
1406 m4_undefine([_defopt])
1407 AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
1408 AC_MSG_CHECKING([whether to build unit test cases])
1409 AC_MSG_RESULT([$enable_unit_tests])
1410 ]) # XORG_ENABLE_UNIT_TESTS
1411
1412 # XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
1413 # ------------------------------------------------------
1414 # Minimum version: 1.17.0
1415 #
1416 # This macro enables a builder to enable/disable integration testing
1417 # It makes no assumption about the test cases' implementation
1418 # Test cases may or may not use Automake "Support for test suites"
1419 #
1420 # Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
1421 # usually requires less dependencies and may be built and run under less
1422 # stringent environments than integration tests.
1423 #
1424 # Interface to module:
1425 # ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests
1426 # enable_integration_tests: used in configure.ac for additional configuration
1427 # --enable-integration-tests: 'yes' user instructs the module to build tests
1428 # 'no' user instructs the module not to build tests
1429 # parm1: specify the default value, yes or no.
1430 #
1431 AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
1432 AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1433 m4_define([_defopt], m4_default([$1], [auto]))
1434 AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
1435 [Enable building integration test cases (default: ]_defopt[)]),
1436 [enable_integration_tests=$enableval],
1437 [enable_integration_tests=]_defopt)
1438 m4_undefine([_defopt])
1439 AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
1440 [test "x$enable_integration_tests" != xno])
1441 AC_MSG_CHECKING([whether to build unit test cases])
1442 AC_MSG_RESULT([$enable_integration_tests])
1443 ]) # XORG_ENABLE_INTEGRATION_TESTS
1444
1445 # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
1446 # ----------------------------------------
1447 # Minimum version: 1.13.0
1448 #
1449 # GLib is a library which provides advanced data structures and functions.
1450 # This macro enables a module to test for the presence of Glib.
1451 #
1452 # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
1453 # Otherwise the value of $enable_unit_tests is blank.
1454 #
1455 # Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
1456 # test support usually requires less dependencies and may be built and run under
1457 # less stringent environments than integration tests.
1458 #
1459 # Interface to module:
1460 # HAVE_GLIB: used in makefiles to conditionally build targets
1461 # with_glib: used in configure.ac to know if GLib has been found
1462 # --with-glib: 'yes' user instructs the module to use glib
1463 # 'no' user instructs the module not to use glib
1464 #
1465 AC_DEFUN([XORG_WITH_GLIB],[
1466 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1467 m4_define([_defopt], m4_default([$2], [auto]))
1468 AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
1469 [Use GLib library for unit testing (default: ]_defopt[)]),
1470 [with_glib=$withval], [with_glib=]_defopt)
1471 m4_undefine([_defopt])
1472
1473 have_glib=no
1474 # Do not probe GLib if user explicitly disabled unit testing
1475 if test "x$enable_unit_tests" != x"no"; then
1476 # Do not probe GLib if user explicitly disabled it
1477 if test "x$with_glib" != x"no"; then
1478 m4_ifval(
1479 [$1],
1480 [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
1481 [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
1482 )
1483 fi
1484 fi
1485
1486 # Not having GLib when unit testing has been explicitly requested is an error
1487 if test "x$enable_unit_tests" = x"yes"; then
1488 if test "x$have_glib" = x"no"; then
1489 AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1490 fi
1491 fi
1492
1493 # Having unit testing disabled when GLib has been explicitly requested is an error
1494 if test "x$enable_unit_tests" = x"no"; then
1495 if test "x$with_glib" = x"yes"; then
1496 AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1497 fi
1498 fi
1499
1500 # Not having GLib when it has been explicitly requested is an error
1501 if test "x$with_glib" = x"yes"; then
1502 if test "x$have_glib" = x"no"; then
1503 AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
1504 fi
1505 fi
1506
1507 AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
1508 ]) # XORG_WITH_GLIB
1509
1510 # XORG_LD_WRAP([required|optional])
1511 # ---------------------------------
1512 # Minimum version: 1.13.0
1513 #
1514 # Check if linker supports -wrap, passed via compiler flags
1515 #
1516 # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
1517 # Otherwise the value of $enable_unit_tests is blank.
1518 #
1519 # Argument added in 1.16.0 - default is "required", to match existing behavior
1520 # of returning an error if enable_unit_tests is yes, and ld -wrap is not
1521 # available, an argument of "optional" allows use when some unit tests require
1522 # ld -wrap and others do not.
1523 #
1524 AC_DEFUN([XORG_LD_WRAP],[
1525 XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
1526 [AC_LANG_PROGRAM([#include <stdlib.h>
1527 void __wrap_exit(int status) { return; }],
1528 [exit(0);])])
1529 # Not having ld wrap when unit testing has been explicitly requested is an error
1530 if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
1531 if test "x$have_ld_wrap" = x"no"; then
1532 AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
1533 fi
1534 fi
1535 AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
1536 #
1537 ]) # XORG_LD_WRAP
1538
1539 # XORG_CHECK_LINKER_FLAGS
1540 # -----------------------
1541 # SYNOPSIS
1542 #
1543 # XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
1544 #
1545 # DESCRIPTION
1546 #
1547 # Check whether the given linker FLAGS work with the current language's
1548 # linker, or whether they give an error.
1549 #
1550 # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
1551 # success/failure.
1552 #
1553 # PROGRAM-SOURCE is the program source to link with, if needed
1554 #
1555 # NOTE: Based on AX_CHECK_COMPILER_FLAGS.
1556 #
1557 # LICENSE
1558 #
1559 # Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
1560 # Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
1561 # Copyright (c) 2009 Matteo Frigo
1562 #
1563 # This program is free software: you can redistribute it and/or modify it
1564 # under the terms of the GNU General Public License as published by the
1565 # Free Software Foundation, either version 3 of the License, or (at your
1566 # option) any later version.
1567 #
1568 # This program is distributed in the hope that it will be useful, but
1569 # WITHOUT ANY WARRANTY; without even the implied warranty of
1570 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1571 # Public License for more details.
1572 #
1573 # You should have received a copy of the GNU General Public License along
1574 # with this program. If not, see <http://www.gnu.org/licenses/>.
1575 #
1576 # As a special exception, the respective Autoconf Macro's copyright owner
1577 # gives unlimited permission to copy, distribute and modify the configure
1578 # scripts that are the output of Autoconf when processing the Macro. You
1579 # need not follow the terms of the GNU General Public License when using
1580 # or distributing such scripts, even though portions of the text of the
1581 # Macro appear in them. The GNU General Public License (GPL) does govern
1582 # all other use of the material that constitutes the Autoconf Macro.
1583 #
1584 # This special exception to the GPL applies to versions of the Autoconf
1585 # Macro released by the Autoconf Archive. When you make and distribute a
1586 # modified version of the Autoconf Macro, you may extend this special
1587 # exception to the GPL to apply to your modified version as well.#
1588 AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
1589 [AC_MSG_CHECKING([whether the linker accepts $1])
1590 dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
1591 AS_LITERAL_IF([$1],
1592 [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
1593 ax_save_FLAGS=$LDFLAGS
1594 LDFLAGS="$1"
1595 AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
1596 AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1597 AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1598 LDFLAGS=$ax_save_FLAGS])],
1599 [ax_save_FLAGS=$LDFLAGS
1600 LDFLAGS="$1"
1601 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1602 eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1603 eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1604 LDFLAGS=$ax_save_FLAGS])
1605 eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
1606 AC_MSG_RESULT($xorg_check_linker_flags)
1607 if test "x$xorg_check_linker_flags" = xyes; then
1608 m4_default([$2], :)
1609 else
1610 m4_default([$3], :)
1611 fi
1612 ]) # XORG_CHECK_LINKER_FLAGS
1613
1614 # XORG_MEMORY_CHECK_FLAGS
1615 # -----------------------
1616 # Minimum version: 1.16.0
1617 #
1618 # This macro attempts to find appropriate memory checking functionality
1619 # for various platforms which unit testing code may use to catch various
1620 # forms of memory allocation and access errors in testing.
1621 #
1622 # Interface to module:
1623 # XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
1624 # Usually added to TESTS_ENVIRONMENT in Makefile.am
1625 #
1626 # If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
1627 #
1628 AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
1629
1630 AC_REQUIRE([AC_CANONICAL_HOST])
1631 AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
1632 [Environment variables to enable memory checking in tests])
1633
1634 # Check for different types of support on different platforms
1635 case $host_os in
1636 solaris*)
1637 AC_CHECK_LIB([umem], [umem_alloc],
1638 [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
1639 ;;
1640 *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
1641 # both directly and inverted, so should not be 0 or 255.
1642 malloc_debug_env='MALLOC_PERTURB_=15'
1643 ;;
1644 darwin*)
1645 malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
1646 ;;
1647 *bsd*)
1648 malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
1649 ;;
1650 esac
1651
1652 # User supplied flags override default flags
1653 if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
1654 malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
1655 fi
1656
1657 AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
1658 ]) # XORG_WITH_LINT
1659
1660 # XORG_CHECK_MALLOC_ZERO
1661 # ----------------------
1662 # Minimum version: 1.0.0
1663 #
1664 # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1665 # malloc(0) returns NULL. Packages should add one of these cflags to
1666 # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1667 AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1668 AC_ARG_ENABLE(malloc0returnsnull,
1669 AS_HELP_STRING([--enable-malloc0returnsnull],
1670 [malloc(0) returns NULL (default: auto)]),
1671 [MALLOC_ZERO_RETURNS_NULL=$enableval],
1672 [MALLOC_ZERO_RETURNS_NULL=auto])
1673
1674 AC_MSG_CHECKING([whether malloc(0) returns NULL])
1675 if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1676 AC_CACHE_VAL([xorg_cv_malloc0_returns_null],
1677 [AC_RUN_IFELSE([AC_LANG_PROGRAM([
1678 #include <stdlib.h>
1679 ],[
1680 char *m0, *r0, *c0, *p;
1681 m0 = malloc(0);
1682 p = malloc(10);
1683 r0 = realloc(p,0);
1684 c0 = calloc(0,10);
1685 exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
1686 ])],
1687 [xorg_cv_malloc0_returns_null=yes],
1688 [xorg_cv_malloc0_returns_null=no])])
1689 MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
1690 fi
1691 AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1692
1693 if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1694 MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1695 XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1696 XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1697 else
1698 MALLOC_ZERO_CFLAGS=""
1699 XMALLOC_ZERO_CFLAGS=""
1700 XTMALLOC_ZERO_CFLAGS=""
1701 fi
1702
1703 AC_SUBST([MALLOC_ZERO_CFLAGS])
1704 AC_SUBST([XMALLOC_ZERO_CFLAGS])
1705 AC_SUBST([XTMALLOC_ZERO_CFLAGS])
1706 ]) # XORG_CHECK_MALLOC_ZERO
1707
1708 # XORG_WITH_LINT()
1709 # ----------------
1710 # Minimum version: 1.1.0
1711 #
1712 # This macro enables the use of a tool that flags some suspicious and
1713 # non-portable constructs (likely to be bugs) in C language source code.
1714 # It will attempt to locate the tool and use appropriate options.
1715 # There are various lint type tools on different platforms.
1716 #
1717 # Interface to module:
1718 # LINT: returns the path to the tool found on the platform
1719 # or the value set to LINT on the configure cmd line
1720 # also an Automake conditional
1721 # LINT_FLAGS: an Automake variable with appropriate flags
1722 #
1723 # --with-lint: 'yes' user instructs the module to use lint
1724 # 'no' user instructs the module not to use lint (default)
1725 #
1726 # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1727 # If the user sets the value of LINT_FLAGS, they are used verbatim.
1728 #
1729 AC_DEFUN([XORG_WITH_LINT],[
1730
1731 AC_ARG_VAR([LINT], [Path to a lint-style command])
1732 AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1733 AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1734 [Use a lint-style source code checker (default: disabled)])],
1735 [use_lint=$withval], [use_lint=no])
1736
1737 # Obtain platform specific info like program name and options
1738 # The lint program on FreeBSD and NetBSD is different from the one on Solaris
1739 case $host_os in
1740 *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1741 lint_name=splint
1742 lint_options="-badflag"
1743 ;;
1744 *freebsd* | *netbsd*)
1745 lint_name=lint
1746 lint_options="-u -b"
1747 ;;
1748 *solaris*)
1749 lint_name=lint
1750 lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1751 ;;
1752 esac
1753
1754 # Test for the presence of the program (either guessed by the code or spelled out by the user)
1755 if test "x$use_lint" = x"yes" ; then
1756 AC_PATH_PROG([LINT], [$lint_name])
1757 if test "x$LINT" = "x"; then
1758 AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1759 fi
1760 elif test "x$use_lint" = x"no" ; then
1761 if test "x$LINT" != "x"; then
1762 AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1763 fi
1764 else
1765 AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1766 fi
1767
1768 # User supplied flags override default flags
1769 if test "x$LINT_FLAGS" != "x"; then
1770 lint_options=$LINT_FLAGS
1771 fi
1772
1773 AC_SUBST([LINT_FLAGS],[$lint_options])
1774 AM_CONDITIONAL(LINT, [test "x$LINT" != x])
1775
1776 ]) # XORG_WITH_LINT
1777
1778 # XORG_LINT_LIBRARY(LIBNAME)
1779 # --------------------------
1780 # Minimum version: 1.1.0
1781 #
1782 # Sets up flags for building lint libraries for checking programs that call
1783 # functions in the library.
1784 #
1785 # Interface to module:
1786 # LINTLIB - Automake variable with the name of lint library file to make
1787 # MAKE_LINT_LIB - Automake conditional
1788 #
1789 # --enable-lint-library: - 'yes' user instructs the module to created a lint library
1790 # - 'no' user instructs the module not to create a lint library (default)
1791
1792 AC_DEFUN([XORG_LINT_LIBRARY],[
1793 AC_REQUIRE([XORG_WITH_LINT])
1794 AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1795 [Create lint library (default: disabled)])],
1796 [make_lint_lib=$enableval], [make_lint_lib=no])
1797
1798 if test "x$make_lint_lib" = x"yes" ; then
1799 LINTLIB=llib-l$1.ln
1800 if test "x$LINT" = "x"; then
1801 AC_MSG_ERROR([Cannot make lint library without --with-lint])
1802 fi
1803 elif test "x$make_lint_lib" != x"no" ; then
1804 AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1805 fi
1806
1807 AC_SUBST(LINTLIB)
1808 AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1809
1810 ]) # XORG_LINT_LIBRARY
1811
1812 # XORG_COMPILER_BRAND
1813 # -------------------
1814 # Minimum version: 1.14.0
1815 #
1816 # Checks for various brands of compilers and sets flags as appropriate:
1817 # GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
1818 # GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
1819 # clang compiler - sets CLANGCC to "yes"
1820 # Intel compiler - sets INTELCC to "yes"
1821 # Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
1822 #
1823 AC_DEFUN([XORG_COMPILER_BRAND], [
1824 AC_LANG_CASE(
1825 [C], [
1826 AC_REQUIRE([AC_PROG_CC_C99])
1827 ],
1828 [C++], [
1829 AC_REQUIRE([AC_PROG_CXX])
1830 ]
1831 )
1832 AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
1833 AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1834 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1835 ]) # XORG_COMPILER_BRAND
1836
1837 # XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
1838 # ---------------
1839 # Minimum version: 1.16.0
1840 #
1841 # Test if the compiler works when passed the given flag as a command line argument.
1842 # If it succeeds, the flag is appeneded to the given variable. If not, it tries the
1843 # next flag in the list until there are no more options.
1844 #
1845 # Note that this does not guarantee that the compiler supports the flag as some
1846 # compilers will simply ignore arguments that they do not understand, but we do
1847 # attempt to weed out false positives by using -Werror=unknown-warning-option and
1848 # -Werror=unused-command-line-argument
1849 #
1850 AC_DEFUN([XORG_TESTSET_CFLAG], [
1851 m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1852 m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1853
1854 AC_LANG_COMPILER_REQUIRE
1855
1856 AC_LANG_CASE(
1857 [C], [
1858 AC_REQUIRE([AC_PROG_CC_C99])
1859 define([PREFIX], [C])
1860 define([CACHE_PREFIX], [cc])
1861 define([COMPILER], [$CC])
1862 ],
1863 [C++], [
1864 define([PREFIX], [CXX])
1865 define([CACHE_PREFIX], [cxx])
1866 define([COMPILER], [$CXX])
1867 ]
1868 )
1869
1870 [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
1871
1872 if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
1873 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1874 AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
1875 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
1876 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1877 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
1878 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
1879 [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
1880 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1881 fi
1882
1883 if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
1884 if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
1885 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1886 fi
1887 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1888 AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
1889 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
1890 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1891 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
1892 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
1893 [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
1894 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1895 fi
1896
1897 found="no"
1898 m4_foreach([flag], m4_cdr($@), [
1899 if test $found = "no" ; then
1900 if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
1901 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1902 fi
1903
1904 if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
1905 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1906 fi
1907
1908 PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
1909
1910 dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
1911 AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
1912 cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
1913 AC_CACHE_VAL($cacheid,
1914 [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
1915 [eval $cacheid=yes],
1916 [eval $cacheid=no])])
1917
1918 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1919
1920 eval supported=\$$cacheid
1921 AC_MSG_RESULT([$supported])
1922 if test "$supported" = "yes" ; then
1923 $1="$$1 ]flag["
1924 found="yes"
1925 fi
1926 fi
1927 ])
1928 ]) # XORG_TESTSET_CFLAG
1929
1930 # XORG_COMPILER_FLAGS
1931 # ---------------
1932 # Minimum version: 1.16.0
1933 #
1934 # Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
1935 # arguments supported by the selected compiler which do NOT alter the generated
1936 # code. These arguments will cause the compiler to print various warnings
1937 # during compilation AND turn a conservative set of warnings into errors.
1938 #
1939 # The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
1940 # future versions of util-macros as options are added to new compilers.
1941 #
1942 AC_DEFUN([XORG_COMPILER_FLAGS], [
1943 AC_REQUIRE([XORG_COMPILER_BRAND])
1944
1945 AC_ARG_ENABLE(selective-werror,
1946 AS_HELP_STRING([--disable-selective-werror],
1947 [Turn off selective compiler errors. (default: enabled)]),
1948 [SELECTIVE_WERROR=$enableval],
1949 [SELECTIVE_WERROR=yes])
1950
1951 AC_LANG_CASE(
1952 [C], [
1953 define([PREFIX], [C])
1954 ],
1955 [C++], [
1956 define([PREFIX], [CXX])
1957 ]
1958 )
1959 # -v is too short to test reliably with XORG_TESTSET_CFLAG
1960 if test "x$SUNCC" = "xyes"; then
1961 [BASE_]PREFIX[FLAGS]="-v"
1962 else
1963 [BASE_]PREFIX[FLAGS]=""
1964 fi
1965
1966 # This chunk of warnings were those that existed in the legacy CWARNFLAGS
1967 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
1968 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
1969 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
1970 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
1971
1972 AC_LANG_CASE(
1973 [C], [
1974 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
1975 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
1976 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
1977 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
1978 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
1979 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
1980 ]
1981 )
1982
1983 # This chunk adds additional warnings that could catch undesired effects.
1984 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
1985 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
1986 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
1987 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
1988 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
1989 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
1990 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
1991
1992 # These are currently disabled because they are noisy. They will be enabled
1993 # in the future once the codebase is sufficiently modernized to silence
1994 # them. For now, I don't want them to drown out the other warnings.
1995 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
1996 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
1997 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
1998
1999 # Turn some warnings into errors, so we don't accidently get successful builds
2000 # when there are problems that should be fixed.
2001
2002 if test "x$SELECTIVE_WERROR" = "xyes" ; then
2003 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
2004 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
2005 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
2006 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
2007 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
2008 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
2009 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
2010 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
2011 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
2012 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
2013 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
2014 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
2015 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
2016 else
2017 AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
2018 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
2019 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
2020 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
2021 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
2022 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
2023 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
2024 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
2025 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
2026 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
2027 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
2028 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
2029 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
2030 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
2031 fi
2032
2033 AC_SUBST([BASE_]PREFIX[FLAGS])
2034 ]) # XORG_COMPILER_FLAGS
2035
2036 # XORG_CWARNFLAGS
2037 # ---------------
2038 # Minimum version: 1.2.0
2039 # Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
2040 #
2041 # Defines CWARNFLAGS to enable C compiler warnings.
2042 #
2043 # This function is deprecated because it defines -fno-strict-aliasing
2044 # which alters the code generated by the compiler. If -fno-strict-aliasing
2045 # is needed, then it should be added explicitly in the module when
2046 # it is updated to use BASE_CFLAGS.
2047 #
2048 AC_DEFUN([XORG_CWARNFLAGS], [
2049 AC_REQUIRE([XORG_COMPILER_FLAGS])
2050 AC_REQUIRE([XORG_COMPILER_BRAND])
2051 AC_LANG_CASE(
2052 [C], [
2053 CWARNFLAGS="$BASE_CFLAGS"
2054 if test "x$GCC" = xyes ; then
2055 CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
2056 fi
2057 AC_SUBST(CWARNFLAGS)
2058 ]
2059 )
2060 ]) # XORG_CWARNFLAGS
2061
2062 # XORG_STRICT_OPTION
2063 # -----------------------
2064 # Minimum version: 1.3.0
2065 #
2066 # Add configure option to enable strict compilation flags, such as treating
2067 # warnings as fatal errors.
2068 # If --enable-strict-compilation is passed to configure, adds strict flags to
2069 # $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
2070 #
2071 # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
2072 # when strict compilation is unconditionally desired.
2073 AC_DEFUN([XORG_STRICT_OPTION], [
2074 AC_REQUIRE([XORG_CWARNFLAGS])
2075 AC_REQUIRE([XORG_COMPILER_FLAGS])
2076
2077 AC_ARG_ENABLE(strict-compilation,
2078 AS_HELP_STRING([--enable-strict-compilation],
2079 [Enable all warnings from compiler and make them errors (default: disabled)]),
2080 [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2081
2082 AC_LANG_CASE(
2083 [C], [
2084 define([PREFIX], [C])
2085 ],
2086 [C++], [
2087 define([PREFIX], [CXX])
2088 ]
2089 )
2090
2091 [STRICT_]PREFIX[FLAGS]=""
2092 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
2093 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
2094
2095 # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
2096 # activate it with -Werror, so we add it here explicitly.
2097 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
2098
2099 if test "x$STRICT_COMPILE" = "xyes"; then
2100 [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
2101 AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
2102 fi
2103 AC_SUBST([STRICT_]PREFIX[FLAGS])
2104 AC_SUBST([BASE_]PREFIX[FLAGS])
2105 AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
2106 ]) # XORG_STRICT_OPTION
2107
2108 # XORG_DEFAULT_OPTIONS
2109 # --------------------
2110 # Minimum version: 1.3.0
2111 #
2112 # Defines default options for X.Org modules.
2113 #
2114 AC_DEFUN([XORG_DEFAULT_OPTIONS], [
2115 AC_REQUIRE([AC_PROG_INSTALL])
2116 XORG_COMPILER_FLAGS
2117 XORG_CWARNFLAGS
2118 XORG_STRICT_OPTION
2119 XORG_RELEASE_VERSION
2120 XORG_CHANGELOG
2121 XORG_INSTALL
2122 XORG_MANPAGE_SECTIONS
2123 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
2124 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
2125 ]) # XORG_DEFAULT_OPTIONS
2126
2127 # XORG_INSTALL()
2128 # ----------------
2129 # Minimum version: 1.4.0
2130 #
2131 # Defines the variable INSTALL_CMD as the command to copy
2132 # INSTALL from $prefix/share/util-macros.
2133 #
2134 AC_DEFUN([XORG_INSTALL], [
2135 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2136 macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
2137 INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
2138 mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
2139 || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
2140 echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
2141 AC_SUBST([INSTALL_CMD])
2142 ]) # XORG_INSTALL
2143 dnl Copyright 2005 Red Hat, Inc
2144 dnl
2145 dnl Permission to use, copy, modify, distribute, and sell this software and its
2146 dnl documentation for any purpose is hereby granted without fee, provided that
2147 dnl the above copyright notice appear in all copies and that both that
2148 dnl copyright notice and this permission notice appear in supporting
2149 dnl documentation.
2150 dnl
2151 dnl The above copyright notice and this permission notice shall be included
2152 dnl in all copies or substantial portions of the Software.
2153 dnl
2154 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2155 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2156 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2157 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
2158 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2159 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2160 dnl OTHER DEALINGS IN THE SOFTWARE.
2161 dnl
2162 dnl Except as contained in this notice, the name of the copyright holders shall
2163 dnl not be used in advertising or otherwise to promote the sale, use or
2164 dnl other dealings in this Software without prior written authorization
2165 dnl from the copyright holders.
2166 dnl
2167
2168 # XORG_RELEASE_VERSION
2169 # --------------------
2170 # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
2171
2172 AC_DEFUN([XORG_RELEASE_VERSION],[
2173 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
2174 [`echo $PACKAGE_VERSION | cut -d . -f 1`],
2175 [Major version of this package])
2176 PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
2177 if test "x$PVM" = "x"; then
2178 PVM="0"
2179 fi
2180 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2181 [$PVM],
2182 [Minor version of this package])
2183 PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2184 if test "x$PVP" = "x"; then
2185 PVP="0"
2186 fi
2187 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2188 [$PVP],
2189 [Patch version of this package])
2190 ])
2191
2192 # XORG_CHANGELOG()
2193 # ----------------
2194 # Minimum version: 1.2.0
2195 #
2196 # Defines the variable CHANGELOG_CMD as the command to generate
2197 # ChangeLog from git.
2198 #
2199 #
2200 AC_DEFUN([XORG_CHANGELOG], [
2201 CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
2202 mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
2203 || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
2204 echo 'git directory not found: installing possibly empty changelog.' >&2)"
2205 AC_SUBST([CHANGELOG_CMD])
2206 ]) # XORG_CHANGELOG
212207
222208 # Copyright (C) 2002-2014 Free Software Foundation, Inc.
232209 #
11493335 AC_SUBST([am__untar])
11503336 ]) # _AM_PROG_TAR
11513337
1152 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1153 #
1154 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1155 #
1156 # This program is free software; you can redistribute it and/or modify
1157 # it under the terms of the GNU General Public License as published by
1158 # the Free Software Foundation; either version 2 of the License, or
1159 # (at your option) any later version.
1160 #
1161 # This program is distributed in the hope that it will be useful, but
1162 # WITHOUT ANY WARRANTY; without even the implied warranty of
1163 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1164 # General Public License for more details.
1165 #
1166 # You should have received a copy of the GNU General Public License
1167 # along with this program; if not, write to the Free Software
1168 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1169 #
1170 # As a special exception to the GNU General Public License, if you
1171 # distribute this file as part of a program that contains a
1172 # configuration script generated by Autoconf, you may include it under
1173 # the same distribution terms that you use for the rest of that program.
1174
1175 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
1176 # ----------------------------------
1177 AC_DEFUN([PKG_PROG_PKG_CONFIG],
1178 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1179 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1180 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1181 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1182 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1183 fi
1184 if test -n "$PKG_CONFIG"; then
1185 _pkg_min_version=m4_default([$1], [0.9.0])
1186 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1187 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1188 AC_MSG_RESULT([yes])
1189 else
1190 AC_MSG_RESULT([no])
1191 PKG_CONFIG=""
1192 fi
1193
1194 fi[]dnl
1195 ])# PKG_PROG_PKG_CONFIG
1196
1197 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1198 #
1199 # Check to see whether a particular set of modules exists. Similar
1200 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
1201 #
1202 #
1203 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
1204 # this or PKG_CHECK_MODULES is called, or make sure to call
1205 # PKG_CHECK_EXISTS manually
1206 # --------------------------------------------------------------
1207 AC_DEFUN([PKG_CHECK_EXISTS],
1208 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1209 if test -n "$PKG_CONFIG" && \
1210 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1211 m4_ifval([$2], [$2], [:])
1212 m4_ifvaln([$3], [else
1213 $3])dnl
1214 fi])
1215
1216
1217 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1218 # ---------------------------------------------
1219 m4_define([_PKG_CONFIG],
1220 [if test -n "$$1"; then
1221 pkg_cv_[]$1="$$1"
1222 elif test -n "$PKG_CONFIG"; then
1223 PKG_CHECK_EXISTS([$3],
1224 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1225 [pkg_failed=yes])
1226 else
1227 pkg_failed=untried
1228 fi[]dnl
1229 ])# _PKG_CONFIG
1230
1231 # _PKG_SHORT_ERRORS_SUPPORTED
1232 # -----------------------------
1233 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1234 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1235 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1236 _pkg_short_errors_supported=yes
1237 else
1238 _pkg_short_errors_supported=no
1239 fi[]dnl
1240 ])# _PKG_SHORT_ERRORS_SUPPORTED
1241
1242
1243 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1244 # [ACTION-IF-NOT-FOUND])
1245 #
1246 #
1247 # Note that if there is a possibility the first call to
1248 # PKG_CHECK_MODULES might not happen, you should be sure to include an
1249 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1250 #
1251 #
1252 # --------------------------------------------------------------
1253 AC_DEFUN([PKG_CHECK_MODULES],
1254 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1255 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1256 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1257
1258 pkg_failed=no
1259 AC_MSG_CHECKING([for $1])
1260
1261 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1262 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
1263
1264 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1265 and $1[]_LIBS to avoid the need to call pkg-config.
1266 See the pkg-config man page for more details.])
1267
1268 if test $pkg_failed = yes; then
1269 _PKG_SHORT_ERRORS_SUPPORTED
1270 if test $_pkg_short_errors_supported = yes; then
1271 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1272 else
1273 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1274 fi
1275 # Put the nasty error message in config.log where it belongs
1276 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1277
1278 ifelse([$4], , [AC_MSG_ERROR(dnl
1279 [Package requirements ($2) were not met:
1280
1281 $$1_PKG_ERRORS
1282
1283 Consider adjusting the PKG_CONFIG_PATH environment variable if you
1284 installed software in a non-standard prefix.
1285
1286 _PKG_TEXT
1287 ])],
1288 [AC_MSG_RESULT([no])
1289 $4])
1290 elif test $pkg_failed = untried; then
1291 ifelse([$4], , [AC_MSG_FAILURE(dnl
1292 [The pkg-config script could not be found or is too old. Make sure it
1293 is in your PATH or set the PKG_CONFIG environment variable to the full
1294 path to pkg-config.
1295
1296 _PKG_TEXT
1297
1298 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
1299 [$4])
1300 else
1301 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1302 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1303 AC_MSG_RESULT([yes])
1304 ifelse([$3], , :, [$3])
1305 fi[]dnl
1306 ])# PKG_CHECK_MODULES
1307
1308 dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1309 dnl
1310 dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
1311 dnl
1312 dnl Permission is hereby granted, free of charge, to any person obtaining a
1313 dnl copy of this software and associated documentation files (the "Software"),
1314 dnl to deal in the Software without restriction, including without limitation
1315 dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1316 dnl and/or sell copies of the Software, and to permit persons to whom the
1317 dnl Software is furnished to do so, subject to the following conditions:
1318 dnl
1319 dnl The above copyright notice and this permission notice (including the next
1320 dnl paragraph) shall be included in all copies or substantial portions of the
1321 dnl Software.
1322 dnl
1323 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1324 dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1325 dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1326 dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1327 dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1328 dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1329 dnl DEALINGS IN THE SOFTWARE.
1330
1331 # XORG_MACROS_VERSION(required-version)
1332 # -------------------------------------
1333 # Minimum version: 1.1.0
1334 #
1335 # If you're using a macro added in Version 1.1 or newer, include this in
1336 # your configure.ac with the minimum required version, such as:
1337 # XORG_MACROS_VERSION(1.1)
1338 #
1339 # To ensure that this macro is defined, also add:
1340 # m4_ifndef([XORG_MACROS_VERSION],
1341 # [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1342 #
1343 #
1344 # See the "minimum version" comment for each macro you use to see what
1345 # version you require.
1346 m4_defun([XORG_MACROS_VERSION],[
1347 m4_define([vers_have], [1.19.0])
1348 m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1349 m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1350 m4_if(m4_cmp(maj_have, maj_needed), 0,,
1351 [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1352 m4_if(m4_version_compare(vers_have, [$1]), -1,
1353 [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1354 m4_undefine([vers_have])
1355 m4_undefine([maj_have])
1356 m4_undefine([maj_needed])
1357 ]) # XORG_MACROS_VERSION
1358
1359 # XORG_PROG_RAWCPP()
1360 # ------------------
1361 # Minimum version: 1.0.0
1362 #
1363 # Find cpp program and necessary flags for use in pre-processing text files
1364 # such as man pages and config files
1365 AC_DEFUN([XORG_PROG_RAWCPP],[
1366 AC_REQUIRE([AC_PROG_CPP])
1367 AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
1368 [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1369
1370 # Check for flag to avoid builtin definitions - assumes unix is predefined,
1371 # which is not the best choice for supporting other OS'es, but covers most
1372 # of the ones we need for now.
1373 AC_MSG_CHECKING([if $RAWCPP requires -undef])
1374 AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
1375 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1376 AC_MSG_RESULT([no])
1377 else
1378 if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1379 RAWCPPFLAGS=-undef
1380 AC_MSG_RESULT([yes])
1381 # under Cygwin unix is still defined even with -undef
1382 elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1383 RAWCPPFLAGS="-undef -ansi"
1384 AC_MSG_RESULT([yes, with -ansi])
1385 else
1386 AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
1387 fi
1388 fi
1389 rm -f conftest.$ac_ext
1390
1391 AC_MSG_CHECKING([if $RAWCPP requires -traditional])
1392 AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])])
1393 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
1394 AC_MSG_RESULT([no])
1395 else
1396 if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
1397 TRADITIONALCPPFLAGS="-traditional"
1398 RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1399 AC_MSG_RESULT([yes])
1400 else
1401 AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
1402 fi
1403 fi
1404 rm -f conftest.$ac_ext
1405 AC_SUBST(RAWCPPFLAGS)
1406 AC_SUBST(TRADITIONALCPPFLAGS)
1407 ]) # XORG_PROG_RAWCPP
1408
1409 # XORG_MANPAGE_SECTIONS()
1410 # -----------------------
1411 # Minimum version: 1.0.0
1412 #
1413 # Determine which sections man pages go in for the different man page types
1414 # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1415 # Not sure if there's any better way than just hardcoding by OS name.
1416 # Override default settings by setting environment variables
1417 # Added MAN_SUBSTS in version 1.8
1418 # Added AC_PROG_SED in version 1.8
1419
1420 AC_DEFUN([XORG_MANPAGE_SECTIONS],[
1421 AC_REQUIRE([AC_CANONICAL_HOST])
1422 AC_REQUIRE([AC_PROG_SED])
1423
1424 if test x$APP_MAN_SUFFIX = x ; then
1425 APP_MAN_SUFFIX=1
1426 fi
1427 if test x$APP_MAN_DIR = x ; then
1428 APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1429 fi
1430
1431 if test x$LIB_MAN_SUFFIX = x ; then
1432 LIB_MAN_SUFFIX=3
1433 fi
1434 if test x$LIB_MAN_DIR = x ; then
1435 LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1436 fi
1437
1438 if test x$FILE_MAN_SUFFIX = x ; then
1439 case $host_os in
1440 solaris*) FILE_MAN_SUFFIX=4 ;;
1441 *) FILE_MAN_SUFFIX=5 ;;
1442 esac
1443 fi
1444 if test x$FILE_MAN_DIR = x ; then
1445 FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1446 fi
1447
1448 if test x$MISC_MAN_SUFFIX = x ; then
1449 case $host_os in
1450 solaris*) MISC_MAN_SUFFIX=5 ;;
1451 *) MISC_MAN_SUFFIX=7 ;;
1452 esac
1453 fi
1454 if test x$MISC_MAN_DIR = x ; then
1455 MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1456 fi
1457
1458 if test x$DRIVER_MAN_SUFFIX = x ; then
1459 case $host_os in
1460 solaris*) DRIVER_MAN_SUFFIX=7 ;;
1461 *) DRIVER_MAN_SUFFIX=4 ;;
1462 esac
1463 fi
1464 if test x$DRIVER_MAN_DIR = x ; then
1465 DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1466 fi
1467
1468 if test x$ADMIN_MAN_SUFFIX = x ; then
1469 case $host_os in
1470 solaris*) ADMIN_MAN_SUFFIX=1m ;;
1471 *) ADMIN_MAN_SUFFIX=8 ;;
1472 esac
1473 fi
1474 if test x$ADMIN_MAN_DIR = x ; then
1475 ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1476 fi
1477
1478
1479 AC_SUBST([APP_MAN_SUFFIX])
1480 AC_SUBST([LIB_MAN_SUFFIX])
1481 AC_SUBST([FILE_MAN_SUFFIX])
1482 AC_SUBST([MISC_MAN_SUFFIX])
1483 AC_SUBST([DRIVER_MAN_SUFFIX])
1484 AC_SUBST([ADMIN_MAN_SUFFIX])
1485 AC_SUBST([APP_MAN_DIR])
1486 AC_SUBST([LIB_MAN_DIR])
1487 AC_SUBST([FILE_MAN_DIR])
1488 AC_SUBST([MISC_MAN_DIR])
1489 AC_SUBST([DRIVER_MAN_DIR])
1490 AC_SUBST([ADMIN_MAN_DIR])
1491
1492 XORG_MAN_PAGE="X Version 11"
1493 AC_SUBST([XORG_MAN_PAGE])
1494 MAN_SUBSTS="\
1495 -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1496 -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1497 -e 's|__xservername__|Xorg|g' \
1498 -e 's|__xconfigfile__|xorg.conf|g' \
1499 -e 's|__projectroot__|\$(prefix)|g' \
1500 -e 's|__apploaddir__|\$(appdefaultdir)|g' \
1501 -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1502 -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1503 -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1504 -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1505 -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1506 -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1507 AC_SUBST([MAN_SUBSTS])
1508
1509 ]) # XORG_MANPAGE_SECTIONS
1510
1511 # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1512 # ------------------------
1513 # Minimum version: 1.7.0
1514 #
1515 # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1516 # provided by xorg-sgml-doctools, if installed.
1517 AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1518 AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1519 XORG_SGML_PATH=
1520 PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1521 [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1522 [m4_ifval([$1],[:],
1523 [if test x"$cross_compiling" != x"yes" ; then
1524 AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1525 [XORG_SGML_PATH=$prefix/share/sgml])
1526 fi])
1527 ])
1528
1529 # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1530 # the path and the name of the doc stylesheet
1531 if test "x$XORG_SGML_PATH" != "x" ; then
1532 AC_MSG_RESULT([$XORG_SGML_PATH])
1533 STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1534 XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1535 else
1536 AC_MSG_RESULT([no])
1537 fi
1538
1539 AC_SUBST(XORG_SGML_PATH)
1540 AC_SUBST(STYLESHEET_SRCDIR)
1541 AC_SUBST(XSL_STYLESHEET)
1542 AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1543 ]) # XORG_CHECK_SGML_DOCTOOLS
1544
1545 # XORG_CHECK_LINUXDOC
1546 # -------------------
1547 # Minimum version: 1.0.0
1548 #
1549 # Defines the variable MAKE_TEXT if the necessary tools and
1550 # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1551 # Whether or not the necessary tools and files are found can be checked
1552 # with the AM_CONDITIONAL "BUILD_LINUXDOC"
1553 AC_DEFUN([XORG_CHECK_LINUXDOC],[
1554 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1555 AC_REQUIRE([XORG_WITH_PS2PDF])
1556
1557 AC_PATH_PROG(LINUXDOC, linuxdoc)
1558
1559 AC_MSG_CHECKING([whether to build documentation])
1560
1561 if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1562 BUILDDOC=yes
1563 else
1564 BUILDDOC=no
1565 fi
1566
1567 AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1568
1569 AC_MSG_RESULT([$BUILDDOC])
1570
1571 AC_MSG_CHECKING([whether to build pdf documentation])
1572
1573 if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1574 BUILDPDFDOC=yes
1575 else
1576 BUILDPDFDOC=no
1577 fi
1578
1579 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1580
1581 AC_MSG_RESULT([$BUILDPDFDOC])
1582
1583 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1584 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1585 MAKE_PDF="$PS2PDF"
1586 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
1587
1588 AC_SUBST(MAKE_TEXT)
1589 AC_SUBST(MAKE_PS)
1590 AC_SUBST(MAKE_PDF)
1591 AC_SUBST(MAKE_HTML)
1592 ]) # XORG_CHECK_LINUXDOC
1593
1594 # XORG_CHECK_DOCBOOK
1595 # -------------------
1596 # Minimum version: 1.0.0
1597 #
1598 # Checks for the ability to build output formats from SGML DocBook source.
1599 # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1600 # indicates whether the necessary tools and files are found and, if set,
1601 # $(MAKE_XXX) blah.sgml will produce blah.xxx.
1602 AC_DEFUN([XORG_CHECK_DOCBOOK],[
1603 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1604
1605 BUILDTXTDOC=no
1606 BUILDPDFDOC=no
1607 BUILDPSDOC=no
1608 BUILDHTMLDOC=no
1609
1610 AC_PATH_PROG(DOCBOOKPS, docbook2ps)
1611 AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1612 AC_PATH_PROG(DOCBOOKHTML, docbook2html)
1613 AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1614
1615 AC_MSG_CHECKING([whether to build text documentation])
1616 if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1617 test x$BUILD_TXTDOC != xno; then
1618 BUILDTXTDOC=yes
1619 fi
1620 AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1621 AC_MSG_RESULT([$BUILDTXTDOC])
1622
1623 AC_MSG_CHECKING([whether to build PDF documentation])
1624 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1625 test x$BUILD_PDFDOC != xno; then
1626 BUILDPDFDOC=yes
1627 fi
1628 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1629 AC_MSG_RESULT([$BUILDPDFDOC])
1630
1631 AC_MSG_CHECKING([whether to build PostScript documentation])
1632 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1633 test x$BUILD_PSDOC != xno; then
1634 BUILDPSDOC=yes
1635 fi
1636 AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1637 AC_MSG_RESULT([$BUILDPSDOC])
1638
1639 AC_MSG_CHECKING([whether to build HTML documentation])
1640 if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1641 test x$BUILD_HTMLDOC != xno; then
1642 BUILDHTMLDOC=yes
1643 fi
1644 AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1645 AC_MSG_RESULT([$BUILDHTMLDOC])
1646
1647 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1648 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1649 MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1650 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1651
1652 AC_SUBST(MAKE_TEXT)
1653 AC_SUBST(MAKE_PS)
1654 AC_SUBST(MAKE_PDF)
1655 AC_SUBST(MAKE_HTML)
1656 ]) # XORG_CHECK_DOCBOOK
1657
1658 # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1659 # ----------------
1660 # Minimum version: 1.5.0
1661 # Minimum version for optional DEFAULT argument: 1.11.0
1662 #
1663 # Documentation tools are not always available on all platforms and sometimes
1664 # not at the appropriate level. This macro enables a module to test for the
1665 # presence of the tool and obtain it's path in separate variables. Coupled with
1666 # the --with-xmlto option, it allows maximum flexibilty in making decisions
1667 # as whether or not to use the xmlto package. When DEFAULT is not specified,
1668 # --with-xmlto assumes 'auto'.
1669 #
1670 # Interface to module:
1671 # HAVE_XMLTO: used in makefiles to conditionally generate documentation
1672 # XMLTO: returns the path of the xmlto program found
1673 # returns the path set by the user in the environment
1674 # --with-xmlto: 'yes' user instructs the module to use xmlto
1675 # 'no' user instructs the module not to use xmlto
1676 #
1677 # Added in version 1.10.0
1678 # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1679 # xmlto for text output requires either lynx, links, or w3m browsers
1680 #
1681 # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1682 #
1683 AC_DEFUN([XORG_WITH_XMLTO],[
1684 AC_ARG_VAR([XMLTO], [Path to xmlto command])
1685 m4_define([_defopt], m4_default([$2], [auto]))
1686 AC_ARG_WITH(xmlto,
1687 AS_HELP_STRING([--with-xmlto],
1688 [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1689 [use_xmlto=$withval], [use_xmlto=]_defopt)
1690 m4_undefine([_defopt])
1691
1692 if test "x$use_xmlto" = x"auto"; then
1693 AC_PATH_PROG([XMLTO], [xmlto])
1694 if test "x$XMLTO" = "x"; then
1695 AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1696 have_xmlto=no
1697 else
1698 have_xmlto=yes
1699 fi
1700 elif test "x$use_xmlto" = x"yes" ; then
1701 AC_PATH_PROG([XMLTO], [xmlto])
1702 if test "x$XMLTO" = "x"; then
1703 AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1704 fi
1705 have_xmlto=yes
1706 elif test "x$use_xmlto" = x"no" ; then
1707 if test "x$XMLTO" != "x"; then
1708 AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1709 fi
1710 have_xmlto=no
1711 else
1712 AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1713 fi
1714
1715 # Test for a minimum version of xmlto, if provided.
1716 m4_ifval([$1],
1717 [if test "$have_xmlto" = yes; then
1718 # scrape the xmlto version
1719 AC_MSG_CHECKING([the xmlto version])
1720 xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1721 AC_MSG_RESULT([$xmlto_version])
1722 AS_VERSION_COMPARE([$xmlto_version], [$1],
1723 [if test "x$use_xmlto" = xauto; then
1724 AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1725 have_xmlto=no
1726 else
1727 AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1728 fi])
1729 fi])
1730
1731 # Test for the ability of xmlto to generate a text target
1732 have_xmlto_text=no
1733 cat > conftest.xml << "EOF"
1734 EOF
1735 AS_IF([test "$have_xmlto" = yes],
1736 [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1737 [have_xmlto_text=yes],
1738 [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
1739 rm -f conftest.xml
1740 AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1741 AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1742 ]) # XORG_WITH_XMLTO
1743
1744 # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
1745 # --------------------------------------------
1746 # Minimum version: 1.12.0
1747 # Minimum version for optional DEFAULT argument: 1.12.0
1748 #
1749 # XSLT (Extensible Stylesheet Language Transformations) is a declarative,
1750 # XML-based language used for the transformation of XML documents.
1751 # The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
1752 # It is used under the cover by xmlto to generate html files from DocBook/XML.
1753 # The XSLT processor is often used as a standalone tool for transformations.
1754 # It should not be assumed that this tool is used only to work with documnetation.
1755 # When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
1756 #
1757 # Interface to module:
1758 # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
1759 # XSLTPROC: returns the path of the xsltproc program found
1760 # returns the path set by the user in the environment
1761 # --with-xsltproc: 'yes' user instructs the module to use xsltproc
1762 # 'no' user instructs the module not to use xsltproc
1763 # have_xsltproc: returns yes if xsltproc found in PATH or no
1764 #
1765 # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
1766 #
1767 AC_DEFUN([XORG_WITH_XSLTPROC],[
1768 AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
1769 # Preserves the interface, should it be implemented later
1770 m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
1771 m4_define([_defopt], m4_default([$2], [auto]))
1772 AC_ARG_WITH(xsltproc,
1773 AS_HELP_STRING([--with-xsltproc],
1774 [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
1775 [use_xsltproc=$withval], [use_xsltproc=]_defopt)
1776 m4_undefine([_defopt])
1777
1778 if test "x$use_xsltproc" = x"auto"; then
1779 AC_PATH_PROG([XSLTPROC], [xsltproc])
1780 if test "x$XSLTPROC" = "x"; then
1781 AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
1782 have_xsltproc=no
1783 else
1784 have_xsltproc=yes
1785 fi
1786 elif test "x$use_xsltproc" = x"yes" ; then
1787 AC_PATH_PROG([XSLTPROC], [xsltproc])
1788 if test "x$XSLTPROC" = "x"; then
1789 AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
1790 fi
1791 have_xsltproc=yes
1792 elif test "x$use_xsltproc" = x"no" ; then
1793 if test "x$XSLTPROC" != "x"; then
1794 AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
1795 fi
1796 have_xsltproc=no
1797 else
1798 AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
1799 fi
1800
1801 AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
1802 ]) # XORG_WITH_XSLTPROC
1803
1804 # XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
1805 # ----------------------------------------
1806 # Minimum version: 1.15.0
1807 #
1808 # PERL (Practical Extraction and Report Language) is a language optimized for
1809 # scanning arbitrary text files, extracting information from those text files,
1810 # and printing reports based on that information.
1811 #
1812 # When DEFAULT is not specified, --with-perl assumes 'auto'.
1813 #
1814 # Interface to module:
1815 # HAVE_PERL: used in makefiles to conditionally scan text files
1816 # PERL: returns the path of the perl program found
1817 # returns the path set by the user in the environment
1818 # --with-perl: 'yes' user instructs the module to use perl
1819 # 'no' user instructs the module not to use perl
1820 # have_perl: returns yes if perl found in PATH or no
1821 #
1822 # If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
1823 #
1824 AC_DEFUN([XORG_WITH_PERL],[
1825 AC_ARG_VAR([PERL], [Path to perl command])
1826 # Preserves the interface, should it be implemented later
1827 m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
1828 m4_define([_defopt], m4_default([$2], [auto]))
1829 AC_ARG_WITH(perl,
1830 AS_HELP_STRING([--with-perl],
1831 [Use perl for extracting information from files (default: ]_defopt[)]),
1832 [use_perl=$withval], [use_perl=]_defopt)
1833 m4_undefine([_defopt])
1834
1835 if test "x$use_perl" = x"auto"; then
1836 AC_PATH_PROG([PERL], [perl])
1837 if test "x$PERL" = "x"; then
1838 AC_MSG_WARN([perl not found - cannot extract information and report])
1839 have_perl=no
1840 else
1841 have_perl=yes
1842 fi
1843 elif test "x$use_perl" = x"yes" ; then
1844 AC_PATH_PROG([PERL], [perl])
1845 if test "x$PERL" = "x"; then
1846 AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
1847 fi
1848 have_perl=yes
1849 elif test "x$use_perl" = x"no" ; then
1850 if test "x$PERL" != "x"; then
1851 AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
1852 fi
1853 have_perl=no
1854 else
1855 AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
1856 fi
1857
1858 AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
1859 ]) # XORG_WITH_PERL
1860
1861 # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
1862 # ----------------
1863 # Minimum version: 1.5.0
1864 # Minimum version for optional DEFAULT argument: 1.11.0
1865 #
1866 # Documentation tools are not always available on all platforms and sometimes
1867 # not at the appropriate level. This macro enables a module to test for the
1868 # presence of the tool and obtain it's path in separate variables. Coupled with
1869 # the --with-asciidoc option, it allows maximum flexibilty in making decisions
1870 # as whether or not to use the asciidoc package. When DEFAULT is not specified,
1871 # --with-asciidoc assumes 'auto'.
1872 #
1873 # Interface to module:
1874 # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1875 # ASCIIDOC: returns the path of the asciidoc program found
1876 # returns the path set by the user in the environment
1877 # --with-asciidoc: 'yes' user instructs the module to use asciidoc
1878 # 'no' user instructs the module not to use asciidoc
1879 #
1880 # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
1881 #
1882 AC_DEFUN([XORG_WITH_ASCIIDOC],[
1883 AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1884 m4_define([_defopt], m4_default([$2], [auto]))
1885 AC_ARG_WITH(asciidoc,
1886 AS_HELP_STRING([--with-asciidoc],
1887 [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
1888 [use_asciidoc=$withval], [use_asciidoc=]_defopt)
1889 m4_undefine([_defopt])
1890
1891 if test "x$use_asciidoc" = x"auto"; then
1892 AC_PATH_PROG([ASCIIDOC], [asciidoc])
1893 if test "x$ASCIIDOC" = "x"; then
1894 AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1895 have_asciidoc=no
1896 else
1897 have_asciidoc=yes
1898 fi
1899 elif test "x$use_asciidoc" = x"yes" ; then
1900 AC_PATH_PROG([ASCIIDOC], [asciidoc])
1901 if test "x$ASCIIDOC" = "x"; then
1902 AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1903 fi
1904 have_asciidoc=yes
1905 elif test "x$use_asciidoc" = x"no" ; then
1906 if test "x$ASCIIDOC" != "x"; then
1907 AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1908 fi
1909 have_asciidoc=no
1910 else
1911 AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1912 fi
1913 m4_ifval([$1],
1914 [if test "$have_asciidoc" = yes; then
1915 # scrape the asciidoc version
1916 AC_MSG_CHECKING([the asciidoc version])
1917 asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1918 AC_MSG_RESULT([$asciidoc_version])
1919 AS_VERSION_COMPARE([$asciidoc_version], [$1],
1920 [if test "x$use_asciidoc" = xauto; then
1921 AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1922 have_asciidoc=no
1923 else
1924 AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1925 fi])
1926 fi])
1927 AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1928 ]) # XORG_WITH_ASCIIDOC
1929
1930 # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1931 # -------------------------------------------
1932 # Minimum version: 1.5.0
1933 # Minimum version for optional DEFAULT argument: 1.11.0
1934 # Minimum version for optional DOT checking: 1.18.0
1935 #
1936 # Documentation tools are not always available on all platforms and sometimes
1937 # not at the appropriate level. This macro enables a module to test for the
1938 # presence of the tool and obtain it's path in separate variables. Coupled with
1939 # the --with-doxygen option, it allows maximum flexibilty in making decisions
1940 # as whether or not to use the doxygen package. When DEFAULT is not specified,
1941 # --with-doxygen assumes 'auto'.
1942 #
1943 # Interface to module:
1944 # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1945 # DOXYGEN: returns the path of the doxygen program found
1946 # returns the path set by the user in the environment
1947 # --with-doxygen: 'yes' user instructs the module to use doxygen
1948 # 'no' user instructs the module not to use doxygen
1949 #
1950 # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1951 #
1952 AC_DEFUN([XORG_WITH_DOXYGEN],[
1953 AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1954 AC_ARG_VAR([DOT], [Path to the dot graphics utility])
1955 m4_define([_defopt], m4_default([$2], [auto]))
1956 AC_ARG_WITH(doxygen,
1957 AS_HELP_STRING([--with-doxygen],
1958 [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1959 [use_doxygen=$withval], [use_doxygen=]_defopt)
1960 m4_undefine([_defopt])
1961
1962 if test "x$use_doxygen" = x"auto"; then
1963 AC_PATH_PROG([DOXYGEN], [doxygen])
1964 if test "x$DOXYGEN" = "x"; then
1965 AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1966 have_doxygen=no
1967 else
1968 have_doxygen=yes
1969 fi
1970 elif test "x$use_doxygen" = x"yes" ; then
1971 AC_PATH_PROG([DOXYGEN], [doxygen])
1972 if test "x$DOXYGEN" = "x"; then
1973 AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1974 fi
1975 have_doxygen=yes
1976 elif test "x$use_doxygen" = x"no" ; then
1977 if test "x$DOXYGEN" != "x"; then
1978 AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1979 fi
1980 have_doxygen=no
1981 else
1982 AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1983 fi
1984 m4_ifval([$1],
1985 [if test "$have_doxygen" = yes; then
1986 # scrape the doxygen version
1987 AC_MSG_CHECKING([the doxygen version])
1988 doxygen_version=`$DOXYGEN --version 2>/dev/null`
1989 AC_MSG_RESULT([$doxygen_version])
1990 AS_VERSION_COMPARE([$doxygen_version], [$1],
1991 [if test "x$use_doxygen" = xauto; then
1992 AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1993 have_doxygen=no
1994 else
1995 AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1996 fi])
1997 fi])
1998
1999 dnl Check for DOT if we have doxygen. The caller decides if it is mandatory
2000 dnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
2001 dnl HAVE_DOT = @HAVE_DOT@
2002 HAVE_DOT=no
2003 if test "x$have_doxygen" = "xyes"; then
2004 AC_PATH_PROG([DOT], [dot])
2005 if test "x$DOT" != "x"; then
2006 HAVE_DOT=yes
2007 fi
2008 fi
2009
2010 AC_SUBST([HAVE_DOT])
2011 AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
2012 AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
2013 ]) # XORG_WITH_DOXYGEN
2014
2015 # XORG_WITH_GROFF([DEFAULT])
2016 # ----------------
2017 # Minimum version: 1.6.0
2018 # Minimum version for optional DEFAULT argument: 1.11.0
2019 #
2020 # Documentation tools are not always available on all platforms and sometimes
2021 # not at the appropriate level. This macro enables a module to test for the
2022 # presence of the tool and obtain it's path in separate variables. Coupled with
2023 # the --with-groff option, it allows maximum flexibilty in making decisions
2024 # as whether or not to use the groff package. When DEFAULT is not specified,
2025 # --with-groff assumes 'auto'.
2026 #
2027 # Interface to module:
2028 # HAVE_GROFF: used in makefiles to conditionally generate documentation
2029 # HAVE_GROFF_MM: the memorandum macros (-mm) package
2030 # HAVE_GROFF_MS: the -ms macros package
2031 # GROFF: returns the path of the groff program found
2032 # returns the path set by the user in the environment
2033 # --with-groff: 'yes' user instructs the module to use groff
2034 # 'no' user instructs the module not to use groff
2035 #
2036 # Added in version 1.9.0:
2037 # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
2038 # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
2039 # psselect from the psutils package.
2040 # the ghostcript package. Refer to the grohtml man pages
2041 #
2042 # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
2043 #
2044 # OS and distros often splits groff in a basic and full package, the former
2045 # having the groff program and the later having devices, fonts and macros
2046 # Checking for the groff executable is not enough.
2047 #
2048 # If macros are missing, we cannot assume that groff is useless, so we don't
2049 # unset HAVE_GROFF or GROFF env variables.
2050 # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
2051 #
2052 AC_DEFUN([XORG_WITH_GROFF],[
2053 AC_ARG_VAR([GROFF], [Path to groff command])
2054 m4_define([_defopt], m4_default([$1], [auto]))
2055 AC_ARG_WITH(groff,
2056 AS_HELP_STRING([--with-groff],
2057 [Use groff to regenerate documentation (default: ]_defopt[)]),
2058 [use_groff=$withval], [use_groff=]_defopt)
2059 m4_undefine([_defopt])
2060
2061 if test "x$use_groff" = x"auto"; then
2062 AC_PATH_PROG([GROFF], [groff])
2063 if test "x$GROFF" = "x"; then
2064 AC_MSG_WARN([groff not found - documentation targets will be skipped])
2065 have_groff=no
2066 else
2067 have_groff=yes
2068 fi
2069 elif test "x$use_groff" = x"yes" ; then
2070 AC_PATH_PROG([GROFF], [groff])
2071 if test "x$GROFF" = "x"; then
2072 AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
2073 fi
2074 have_groff=yes
2075 elif test "x$use_groff" = x"no" ; then
2076 if test "x$GROFF" != "x"; then
2077 AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
2078 fi
2079 have_groff=no
2080 else
2081 AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
2082 fi
2083
2084 # We have groff, test for the presence of the macro packages
2085 if test "x$have_groff" = x"yes"; then
2086 AC_MSG_CHECKING([for ${GROFF} -ms macros])
2087 if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
2088 groff_ms_works=yes
2089 else
2090 groff_ms_works=no
2091 fi
2092 AC_MSG_RESULT([$groff_ms_works])
2093 AC_MSG_CHECKING([for ${GROFF} -mm macros])
2094 if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
2095 groff_mm_works=yes
2096 else
2097 groff_mm_works=no
2098 fi
2099 AC_MSG_RESULT([$groff_mm_works])
2100 fi
2101
2102 # We have groff, test for HTML dependencies, one command per package
2103 if test "x$have_groff" = x"yes"; then
2104 AC_PATH_PROGS(GS_PATH, [gs gswin32c])
2105 AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
2106 AC_PATH_PROG(PSSELECT_PATH, [psselect])
2107 if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
2108 have_groff_html=yes
2109 else
2110 have_groff_html=no
2111 AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
2112 fi
2113 fi
2114
2115 # Set Automake conditionals for Makefiles
2116 AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
2117 AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
2118 AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
2119 AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
2120 ]) # XORG_WITH_GROFF
2121
2122 # XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
2123 # ---------------------------------------
2124 # Minimum version: 1.6.0
2125 # Minimum version for optional DEFAULT argument: 1.11.0
2126 # Minimum version for optional MIN-VERSION argument: 1.15.0
2127 #
2128 # Documentation tools are not always available on all platforms and sometimes
2129 # not at the appropriate level. This macro enables a module to test for the
2130 # presence of the tool and obtain it's path in separate variables. Coupled with
2131 # the --with-fop option, it allows maximum flexibilty in making decisions
2132 # as whether or not to use the fop package. When DEFAULT is not specified,
2133 # --with-fop assumes 'auto'.
2134 #
2135 # Interface to module:
2136 # HAVE_FOP: used in makefiles to conditionally generate documentation
2137 # FOP: returns the path of the fop program found
2138 # returns the path set by the user in the environment
2139 # --with-fop: 'yes' user instructs the module to use fop
2140 # 'no' user instructs the module not to use fop
2141 #
2142 # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
2143 #
2144 AC_DEFUN([XORG_WITH_FOP],[
2145 AC_ARG_VAR([FOP], [Path to fop command])
2146 m4_define([_defopt], m4_default([$2], [auto]))
2147 AC_ARG_WITH(fop,
2148 AS_HELP_STRING([--with-fop],
2149 [Use fop to regenerate documentation (default: ]_defopt[)]),
2150 [use_fop=$withval], [use_fop=]_defopt)
2151 m4_undefine([_defopt])
2152
2153 if test "x$use_fop" = x"auto"; then
2154 AC_PATH_PROG([FOP], [fop])
2155 if test "x$FOP" = "x"; then
2156 AC_MSG_WARN([fop not found - documentation targets will be skipped])
2157 have_fop=no
2158 else
2159 have_fop=yes
2160 fi
2161 elif test "x$use_fop" = x"yes" ; then
2162 AC_PATH_PROG([FOP], [fop])
2163 if test "x$FOP" = "x"; then
2164 AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
2165 fi
2166 have_fop=yes
2167 elif test "x$use_fop" = x"no" ; then
2168 if test "x$FOP" != "x"; then
2169 AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
2170 fi
2171 have_fop=no
2172 else
2173 AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
2174 fi
2175
2176 # Test for a minimum version of fop, if provided.
2177 m4_ifval([$1],
2178 [if test "$have_fop" = yes; then
2179 # scrape the fop version
2180 AC_MSG_CHECKING([for fop minimum version])
2181 fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
2182 AC_MSG_RESULT([$fop_version])
2183 AS_VERSION_COMPARE([$fop_version], [$1],
2184 [if test "x$use_fop" = xauto; then
2185 AC_MSG_WARN([fop version $fop_version found, but $1 needed])
2186 have_fop=no
2187 else
2188 AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
2189 fi])
2190 fi])
2191 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
2192 ]) # XORG_WITH_FOP
2193
2194 # XORG_WITH_M4([MIN-VERSION])
2195 # ---------------------------
2196 # Minimum version: 1.19.0
2197 #
2198 # This macro attempts to locate an m4 macro processor which supports
2199 # -I option and is only useful for modules relying on M4 in order to
2200 # expand macros in source code files.
2201 #
2202 # Interface to module:
2203 # M4: returns the path of the m4 program found
2204 # returns the path set by the user in the environment
2205 #
2206 AC_DEFUN([XORG_WITH_M4], [
2207 AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
2208 [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
2209 [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
2210 ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
2211 [AC_MSG_ERROR([could not find m4 that supports -I option])],
2212 [$PATH:/usr/gnu/bin])])
2213
2214 AC_SUBST([M4], [$ac_cv_path_M4])
2215 ]) # XORG_WITH_M4
2216
2217 # XORG_WITH_PS2PDF([DEFAULT])
2218 # ----------------
2219 # Minimum version: 1.6.0
2220 # Minimum version for optional DEFAULT argument: 1.11.0
2221 #
2222 # Documentation tools are not always available on all platforms and sometimes
2223 # not at the appropriate level. This macro enables a module to test for the
2224 # presence of the tool and obtain it's path in separate variables. Coupled with
2225 # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
2226 # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
2227 # --with-ps2pdf assumes 'auto'.
2228 #
2229 # Interface to module:
2230 # HAVE_PS2PDF: used in makefiles to conditionally generate documentation
2231 # PS2PDF: returns the path of the ps2pdf program found
2232 # returns the path set by the user in the environment
2233 # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
2234 # 'no' user instructs the module not to use ps2pdf
2235 #
2236 # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
2237 #
2238 AC_DEFUN([XORG_WITH_PS2PDF],[
2239 AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
2240 m4_define([_defopt], m4_default([$1], [auto]))
2241 AC_ARG_WITH(ps2pdf,
2242 AS_HELP_STRING([--with-ps2pdf],
2243 [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
2244 [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
2245 m4_undefine([_defopt])
2246
2247 if test "x$use_ps2pdf" = x"auto"; then
2248 AC_PATH_PROG([PS2PDF], [ps2pdf])
2249 if test "x$PS2PDF" = "x"; then
2250 AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
2251 have_ps2pdf=no
2252 else
2253 have_ps2pdf=yes
2254 fi
2255 elif test "x$use_ps2pdf" = x"yes" ; then
2256 AC_PATH_PROG([PS2PDF], [ps2pdf])
2257 if test "x$PS2PDF" = "x"; then
2258 AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
2259 fi
2260 have_ps2pdf=yes
2261 elif test "x$use_ps2pdf" = x"no" ; then
2262 if test "x$PS2PDF" != "x"; then
2263 AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
2264 fi
2265 have_ps2pdf=no
2266 else
2267 AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
2268 fi
2269 AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
2270 ]) # XORG_WITH_PS2PDF
2271
2272 # XORG_ENABLE_DOCS (enable_docs=yes)
2273 # ----------------
2274 # Minimum version: 1.6.0
2275 #
2276 # Documentation tools are not always available on all platforms and sometimes
2277 # not at the appropriate level. This macro enables a builder to skip all
2278 # documentation targets except traditional man pages.
2279 # Combined with the specific tool checking macros XORG_WITH_*, it provides
2280 # maximum flexibilty in controlling documentation building.
2281 # Refer to:
2282 # XORG_WITH_XMLTO --with-xmlto
2283 # XORG_WITH_ASCIIDOC --with-asciidoc
2284 # XORG_WITH_DOXYGEN --with-doxygen
2285 # XORG_WITH_FOP --with-fop
2286 # XORG_WITH_GROFF --with-groff
2287 # XORG_WITH_PS2PDF --with-ps2pdf
2288 #
2289 # Interface to module:
2290 # ENABLE_DOCS: used in makefiles to conditionally generate documentation
2291 # --enable-docs: 'yes' user instructs the module to generate docs
2292 # 'no' user instructs the module not to generate docs
2293 # parm1: specify the default value, yes or no.
2294 #
2295 AC_DEFUN([XORG_ENABLE_DOCS],[
2296 m4_define([docs_default], m4_default([$1], [yes]))
2297 AC_ARG_ENABLE(docs,
2298 AS_HELP_STRING([--enable-docs],
2299 [Enable building the documentation (default: ]docs_default[)]),
2300 [build_docs=$enableval], [build_docs=]docs_default)
2301 m4_undefine([docs_default])
2302 AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
2303 AC_MSG_CHECKING([whether to build documentation])
2304 AC_MSG_RESULT([$build_docs])
2305 ]) # XORG_ENABLE_DOCS
2306
2307 # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
2308 # ----------------
2309 # Minimum version: 1.6.0
2310 #
2311 # This macro enables a builder to skip all developer documentation.
2312 # Combined with the specific tool checking macros XORG_WITH_*, it provides
2313 # maximum flexibilty in controlling documentation building.
2314 # Refer to:
2315 # XORG_WITH_XMLTO --with-xmlto
2316 # XORG_WITH_ASCIIDOC --with-asciidoc
2317 # XORG_WITH_DOXYGEN --with-doxygen
2318 # XORG_WITH_FOP --with-fop
2319 # XORG_WITH_GROFF --with-groff
2320 # XORG_WITH_PS2PDF --with-ps2pdf
2321 #
2322 # Interface to module:
2323 # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
2324 # --enable-devel-docs: 'yes' user instructs the module to generate developer docs
2325 # 'no' user instructs the module not to generate developer docs
2326 # parm1: specify the default value, yes or no.
2327 #
2328 AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
2329 m4_define([devel_default], m4_default([$1], [yes]))
2330 AC_ARG_ENABLE(devel-docs,
2331 AS_HELP_STRING([--enable-devel-docs],
2332 [Enable building the developer documentation (default: ]devel_default[)]),
2333 [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
2334 m4_undefine([devel_default])
2335 AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
2336 AC_MSG_CHECKING([whether to build developer documentation])
2337 AC_MSG_RESULT([$build_devel_docs])
2338 ]) # XORG_ENABLE_DEVEL_DOCS
2339
2340 # XORG_ENABLE_SPECS (enable_specs=yes)
2341 # ----------------
2342 # Minimum version: 1.6.0
2343 #
2344 # This macro enables a builder to skip all functional specification targets.
2345 # Combined with the specific tool checking macros XORG_WITH_*, it provides
2346 # maximum flexibilty in controlling documentation building.
2347 # Refer to:
2348 # XORG_WITH_XMLTO --with-xmlto
2349 # XORG_WITH_ASCIIDOC --with-asciidoc
2350 # XORG_WITH_DOXYGEN --with-doxygen
2351 # XORG_WITH_FOP --with-fop
2352 # XORG_WITH_GROFF --with-groff
2353 # XORG_WITH_PS2PDF --with-ps2pdf
2354 #
2355 # Interface to module:
2356 # ENABLE_SPECS: used in makefiles to conditionally generate specs
2357 # --enable-specs: 'yes' user instructs the module to generate specs
2358 # 'no' user instructs the module not to generate specs
2359 # parm1: specify the default value, yes or no.
2360 #
2361 AC_DEFUN([XORG_ENABLE_SPECS],[
2362 m4_define([spec_default], m4_default([$1], [yes]))
2363 AC_ARG_ENABLE(specs,
2364 AS_HELP_STRING([--enable-specs],
2365 [Enable building the specs (default: ]spec_default[)]),
2366 [build_specs=$enableval], [build_specs=]spec_default)
2367 m4_undefine([spec_default])
2368 AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
2369 AC_MSG_CHECKING([whether to build functional specifications])
2370 AC_MSG_RESULT([$build_specs])
2371 ]) # XORG_ENABLE_SPECS
2372
2373 # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
2374 # ----------------------------------------------
2375 # Minimum version: 1.13.0
2376 #
2377 # This macro enables a builder to enable/disable unit testing
2378 # It makes no assumption about the test cases implementation
2379 # Test cases may or may not use Automake "Support for test suites"
2380 # They may or may not use the software utility library GLib
2381 #
2382 # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
2383 # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
2384 # The variable enable_unit_tests is used by other macros in this file.
2385 #
2386 # Interface to module:
2387 # ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests
2388 # enable_unit_tests: used in configure.ac for additional configuration
2389 # --enable-unit-tests: 'yes' user instructs the module to build tests
2390 # 'no' user instructs the module not to build tests
2391 # parm1: specify the default value, yes or no.
2392 #
2393 AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
2394 AC_BEFORE([$0], [XORG_WITH_GLIB])
2395 AC_BEFORE([$0], [XORG_LD_WRAP])
2396 AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2397 m4_define([_defopt], m4_default([$1], [auto]))
2398 AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
2399 [Enable building unit test cases (default: ]_defopt[)]),
2400 [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
2401 m4_undefine([_defopt])
2402 AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
2403 AC_MSG_CHECKING([whether to build unit test cases])
2404 AC_MSG_RESULT([$enable_unit_tests])
2405 ]) # XORG_ENABLE_UNIT_TESTS
2406
2407 # XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
2408 # ------------------------------------------------------
2409 # Minimum version: 1.17.0
2410 #
2411 # This macro enables a builder to enable/disable integration testing
2412 # It makes no assumption about the test cases' implementation
2413 # Test cases may or may not use Automake "Support for test suites"
2414 #
2415 # Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
2416 # usually requires less dependencies and may be built and run under less
2417 # stringent environments than integration tests.
2418 #
2419 # Interface to module:
2420 # ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests
2421 # enable_integration_tests: used in configure.ac for additional configuration
2422 # --enable-integration-tests: 'yes' user instructs the module to build tests
2423 # 'no' user instructs the module not to build tests
2424 # parm1: specify the default value, yes or no.
2425 #
2426 AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
2427 AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2428 m4_define([_defopt], m4_default([$1], [auto]))
2429 AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
2430 [Enable building integration test cases (default: ]_defopt[)]),
2431 [enable_integration_tests=$enableval],
2432 [enable_integration_tests=]_defopt)
2433 m4_undefine([_defopt])
2434 AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
2435 [test "x$enable_integration_tests" != xno])
2436 AC_MSG_CHECKING([whether to build unit test cases])
2437 AC_MSG_RESULT([$enable_integration_tests])
2438 ]) # XORG_ENABLE_INTEGRATION_TESTS
2439
2440 # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
2441 # ----------------------------------------
2442 # Minimum version: 1.13.0
2443 #
2444 # GLib is a library which provides advanced data structures and functions.
2445 # This macro enables a module to test for the presence of Glib.
2446 #
2447 # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
2448 # Otherwise the value of $enable_unit_tests is blank.
2449 #
2450 # Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
2451 # test support usually requires less dependencies and may be built and run under
2452 # less stringent environments than integration tests.
2453 #
2454 # Interface to module:
2455 # HAVE_GLIB: used in makefiles to conditionally build targets
2456 # with_glib: used in configure.ac to know if GLib has been found
2457 # --with-glib: 'yes' user instructs the module to use glib
2458 # 'no' user instructs the module not to use glib
2459 #
2460 AC_DEFUN([XORG_WITH_GLIB],[
2461 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2462 m4_define([_defopt], m4_default([$2], [auto]))
2463 AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
2464 [Use GLib library for unit testing (default: ]_defopt[)]),
2465 [with_glib=$withval], [with_glib=]_defopt)
2466 m4_undefine([_defopt])
2467
2468 have_glib=no
2469 # Do not probe GLib if user explicitly disabled unit testing
2470 if test "x$enable_unit_tests" != x"no"; then
2471 # Do not probe GLib if user explicitly disabled it
2472 if test "x$with_glib" != x"no"; then
2473 m4_ifval(
2474 [$1],
2475 [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
2476 [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
2477 )
2478 fi
2479 fi
2480
2481 # Not having GLib when unit testing has been explicitly requested is an error
2482 if test "x$enable_unit_tests" = x"yes"; then
2483 if test "x$have_glib" = x"no"; then
2484 AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2485 fi
2486 fi
2487
2488 # Having unit testing disabled when GLib has been explicitly requested is an error
2489 if test "x$enable_unit_tests" = x"no"; then
2490 if test "x$with_glib" = x"yes"; then
2491 AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2492 fi
2493 fi
2494
2495 # Not having GLib when it has been explicitly requested is an error
2496 if test "x$with_glib" = x"yes"; then
2497 if test "x$have_glib" = x"no"; then
2498 AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
2499 fi
2500 fi
2501
2502 AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
2503 ]) # XORG_WITH_GLIB
2504
2505 # XORG_LD_WRAP([required|optional])
2506 # ---------------------------------
2507 # Minimum version: 1.13.0
2508 #
2509 # Check if linker supports -wrap, passed via compiler flags
2510 #
2511 # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
2512 # Otherwise the value of $enable_unit_tests is blank.
2513 #
2514 # Argument added in 1.16.0 - default is "required", to match existing behavior
2515 # of returning an error if enable_unit_tests is yes, and ld -wrap is not
2516 # available, an argument of "optional" allows use when some unit tests require
2517 # ld -wrap and others do not.
2518 #
2519 AC_DEFUN([XORG_LD_WRAP],[
2520 XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
2521 [AC_LANG_PROGRAM([#include <stdlib.h>
2522 void __wrap_exit(int status) { return; }],
2523 [exit(0);])])
2524 # Not having ld wrap when unit testing has been explicitly requested is an error
2525 if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
2526 if test "x$have_ld_wrap" = x"no"; then
2527 AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
2528 fi
2529 fi
2530 AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
2531 #
2532 ]) # XORG_LD_WRAP
2533
2534 # XORG_CHECK_LINKER_FLAGS
2535 # -----------------------
2536 # SYNOPSIS
2537 #
2538 # XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
2539 #
2540 # DESCRIPTION
2541 #
2542 # Check whether the given linker FLAGS work with the current language's
2543 # linker, or whether they give an error.
2544 #
2545 # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
2546 # success/failure.
2547 #
2548 # PROGRAM-SOURCE is the program source to link with, if needed
2549 #
2550 # NOTE: Based on AX_CHECK_COMPILER_FLAGS.
2551 #
2552 # LICENSE
2553 #
2554 # Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
2555 # Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
2556 # Copyright (c) 2009 Matteo Frigo
2557 #
2558 # This program is free software: you can redistribute it and/or modify it
2559 # under the terms of the GNU General Public License as published by the
2560 # Free Software Foundation, either version 3 of the License, or (at your
2561 # option) any later version.
2562 #
2563 # This program is distributed in the hope that it will be useful, but
2564 # WITHOUT ANY WARRANTY; without even the implied warranty of
2565 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
2566 # Public License for more details.
2567 #
2568 # You should have received a copy of the GNU General Public License along
2569 # with this program. If not, see <http://www.gnu.org/licenses/>.
2570 #
2571 # As a special exception, the respective Autoconf Macro's copyright owner
2572 # gives unlimited permission to copy, distribute and modify the configure
2573 # scripts that are the output of Autoconf when processing the Macro. You
2574 # need not follow the terms of the GNU General Public License when using
2575 # or distributing such scripts, even though portions of the text of the
2576 # Macro appear in them. The GNU General Public License (GPL) does govern
2577 # all other use of the material that constitutes the Autoconf Macro.
2578 #
2579 # This special exception to the GPL applies to versions of the Autoconf
2580 # Macro released by the Autoconf Archive. When you make and distribute a
2581 # modified version of the Autoconf Macro, you may extend this special
2582 # exception to the GPL to apply to your modified version as well.#
2583 AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
2584 [AC_MSG_CHECKING([whether the linker accepts $1])
2585 dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
2586 AS_LITERAL_IF([$1],
2587 [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
2588 ax_save_FLAGS=$LDFLAGS
2589 LDFLAGS="$1"
2590 AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
2591 AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2592 AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2593 LDFLAGS=$ax_save_FLAGS])],
2594 [ax_save_FLAGS=$LDFLAGS
2595 LDFLAGS="$1"
2596 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
2597 eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2598 eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2599 LDFLAGS=$ax_save_FLAGS])
2600 eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
2601 AC_MSG_RESULT($xorg_check_linker_flags)
2602 if test "x$xorg_check_linker_flags" = xyes; then
2603 m4_default([$2], :)
2604 else
2605 m4_default([$3], :)
2606 fi
2607 ]) # XORG_CHECK_LINKER_FLAGS
2608
2609 # XORG_MEMORY_CHECK_FLAGS
2610 # -----------------------
2611 # Minimum version: 1.16.0
2612 #
2613 # This macro attempts to find appropriate memory checking functionality
2614 # for various platforms which unit testing code may use to catch various
2615 # forms of memory allocation and access errors in testing.
2616 #
2617 # Interface to module:
2618 # XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
2619 # Usually added to TESTS_ENVIRONMENT in Makefile.am
2620 #
2621 # If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
2622 #
2623 AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
2624
2625 AC_REQUIRE([AC_CANONICAL_HOST])
2626 AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
2627 [Environment variables to enable memory checking in tests])
2628
2629 # Check for different types of support on different platforms
2630 case $host_os in
2631 solaris*)
2632 AC_CHECK_LIB([umem], [umem_alloc],
2633 [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
2634 ;;
2635 *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
2636 # both directly and inverted, so should not be 0 or 255.
2637 malloc_debug_env='MALLOC_PERTURB_=15'
2638 ;;
2639 darwin*)
2640 malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
2641 ;;
2642 *bsd*)
2643 malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
2644 ;;
2645 esac
2646
2647 # User supplied flags override default flags
2648 if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
2649 malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
2650 fi
2651
2652 AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
2653 ]) # XORG_WITH_LINT
2654
2655 # XORG_CHECK_MALLOC_ZERO
2656 # ----------------------
2657 # Minimum version: 1.0.0
2658 #
2659 # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
2660 # malloc(0) returns NULL. Packages should add one of these cflags to
2661 # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
2662 AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
2663 AC_ARG_ENABLE(malloc0returnsnull,
2664 AS_HELP_STRING([--enable-malloc0returnsnull],
2665 [malloc(0) returns NULL (default: auto)]),
2666 [MALLOC_ZERO_RETURNS_NULL=$enableval],
2667 [MALLOC_ZERO_RETURNS_NULL=auto])
2668
2669 AC_MSG_CHECKING([whether malloc(0) returns NULL])
2670 if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
2671 AC_CACHE_VAL([xorg_cv_malloc0_returns_null],
2672 [AC_RUN_IFELSE([AC_LANG_PROGRAM([
2673 #include <stdlib.h>
2674 ],[
2675 char *m0, *r0, *c0, *p;
2676 m0 = malloc(0);
2677 p = malloc(10);
2678 r0 = realloc(p,0);
2679 c0 = calloc(0,10);
2680 exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
2681 ])],
2682 [xorg_cv_malloc0_returns_null=yes],
2683 [xorg_cv_malloc0_returns_null=no])])
2684 MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
2685 fi
2686 AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
2687
2688 if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
2689 MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
2690 XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
2691 XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
2692 else
2693 MALLOC_ZERO_CFLAGS=""
2694 XMALLOC_ZERO_CFLAGS=""
2695 XTMALLOC_ZERO_CFLAGS=""
2696 fi
2697
2698 AC_SUBST([MALLOC_ZERO_CFLAGS])
2699 AC_SUBST([XMALLOC_ZERO_CFLAGS])
2700 AC_SUBST([XTMALLOC_ZERO_CFLAGS])
2701 ]) # XORG_CHECK_MALLOC_ZERO
2702
2703 # XORG_WITH_LINT()
2704 # ----------------
2705 # Minimum version: 1.1.0
2706 #
2707 # This macro enables the use of a tool that flags some suspicious and
2708 # non-portable constructs (likely to be bugs) in C language source code.
2709 # It will attempt to locate the tool and use appropriate options.
2710 # There are various lint type tools on different platforms.
2711 #
2712 # Interface to module:
2713 # LINT: returns the path to the tool found on the platform
2714 # or the value set to LINT on the configure cmd line
2715 # also an Automake conditional
2716 # LINT_FLAGS: an Automake variable with appropriate flags
2717 #
2718 # --with-lint: 'yes' user instructs the module to use lint
2719 # 'no' user instructs the module not to use lint (default)
2720 #
2721 # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
2722 # If the user sets the value of LINT_FLAGS, they are used verbatim.
2723 #
2724 AC_DEFUN([XORG_WITH_LINT],[
2725
2726 AC_ARG_VAR([LINT], [Path to a lint-style command])
2727 AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
2728 AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
2729 [Use a lint-style source code checker (default: disabled)])],
2730 [use_lint=$withval], [use_lint=no])
2731
2732 # Obtain platform specific info like program name and options
2733 # The lint program on FreeBSD and NetBSD is different from the one on Solaris
2734 case $host_os in
2735 *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
2736 lint_name=splint
2737 lint_options="-badflag"
2738 ;;
2739 *freebsd* | *netbsd*)
2740 lint_name=lint
2741 lint_options="-u -b"
2742 ;;
2743 *solaris*)
2744 lint_name=lint
2745 lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2746 ;;
2747 esac
2748
2749 # Test for the presence of the program (either guessed by the code or spelled out by the user)
2750 if test "x$use_lint" = x"yes" ; then
2751 AC_PATH_PROG([LINT], [$lint_name])
2752 if test "x$LINT" = "x"; then
2753 AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
2754 fi
2755 elif test "x$use_lint" = x"no" ; then
2756 if test "x$LINT" != "x"; then
2757 AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
2758 fi
2759 else
2760 AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2761 fi
2762
2763 # User supplied flags override default flags
2764 if test "x$LINT_FLAGS" != "x"; then
2765 lint_options=$LINT_FLAGS
2766 fi
2767
2768 AC_SUBST([LINT_FLAGS],[$lint_options])
2769 AM_CONDITIONAL(LINT, [test "x$LINT" != x])
2770
2771 ]) # XORG_WITH_LINT
2772
2773 # XORG_LINT_LIBRARY(LIBNAME)
2774 # --------------------------
2775 # Minimum version: 1.1.0
2776 #
2777 # Sets up flags for building lint libraries for checking programs that call
2778 # functions in the library.
2779 #
2780 # Interface to module:
2781 # LINTLIB - Automake variable with the name of lint library file to make
2782 # MAKE_LINT_LIB - Automake conditional
2783 #
2784 # --enable-lint-library: - 'yes' user instructs the module to created a lint library
2785 # - 'no' user instructs the module not to create a lint library (default)
2786
2787 AC_DEFUN([XORG_LINT_LIBRARY],[
2788 AC_REQUIRE([XORG_WITH_LINT])
2789 AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2790 [Create lint library (default: disabled)])],
2791 [make_lint_lib=$enableval], [make_lint_lib=no])
2792
2793 if test "x$make_lint_lib" = x"yes" ; then
2794 LINTLIB=llib-l$1.ln
2795 if test "x$LINT" = "x"; then
2796 AC_MSG_ERROR([Cannot make lint library without --with-lint])
2797 fi
2798 elif test "x$make_lint_lib" != x"no" ; then
2799 AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2800 fi
2801
2802 AC_SUBST(LINTLIB)
2803 AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2804
2805 ]) # XORG_LINT_LIBRARY
2806
2807 # XORG_COMPILER_BRAND
2808 # -------------------
2809 # Minimum version: 1.14.0
2810 #
2811 # Checks for various brands of compilers and sets flags as appropriate:
2812 # GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
2813 # GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
2814 # clang compiler - sets CLANGCC to "yes"
2815 # Intel compiler - sets INTELCC to "yes"
2816 # Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
2817 #
2818 AC_DEFUN([XORG_COMPILER_BRAND], [
2819 AC_LANG_CASE(
2820 [C], [
2821 AC_REQUIRE([AC_PROG_CC_C99])
2822 ],
2823 [C++], [
2824 AC_REQUIRE([AC_PROG_CXX])
2825 ]
2826 )
2827 AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
2828 AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2829 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2830 ]) # XORG_COMPILER_BRAND
2831
2832 # XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
2833 # ---------------
2834 # Minimum version: 1.16.0
2835 #
2836 # Test if the compiler works when passed the given flag as a command line argument.
2837 # If it succeeds, the flag is appeneded to the given variable. If not, it tries the
2838 # next flag in the list until there are no more options.
2839 #
2840 # Note that this does not guarantee that the compiler supports the flag as some
2841 # compilers will simply ignore arguments that they do not understand, but we do
2842 # attempt to weed out false positives by using -Werror=unknown-warning-option and
2843 # -Werror=unused-command-line-argument
2844 #
2845 AC_DEFUN([XORG_TESTSET_CFLAG], [
2846 m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
2847 m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
2848
2849 AC_LANG_COMPILER_REQUIRE
2850
2851 AC_LANG_CASE(
2852 [C], [
2853 AC_REQUIRE([AC_PROG_CC_C99])
2854 define([PREFIX], [C])
2855 define([CACHE_PREFIX], [cc])
2856 define([COMPILER], [$CC])
2857 ],
2858 [C++], [
2859 define([PREFIX], [CXX])
2860 define([CACHE_PREFIX], [cxx])
2861 define([COMPILER], [$CXX])
2862 ]
2863 )
2864
2865 [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
2866
2867 if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
2868 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
2869 AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
2870 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
2871 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
2872 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
2873 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
2874 [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
2875 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
2876 fi
2877
2878 if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
2879 if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
2880 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
2881 fi
2882 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
2883 AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
2884 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
2885 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
2886 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
2887 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
2888 [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
2889 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
2890 fi
2891
2892 found="no"
2893 m4_foreach([flag], m4_cdr($@), [
2894 if test $found = "no" ; then
2895 if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
2896 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
2897 fi
2898
2899 if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
2900 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
2901 fi
2902
2903 PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
2904
2905 dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
2906 AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
2907 cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
2908 AC_CACHE_VAL($cacheid,
2909 [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
2910 [eval $cacheid=yes],
2911 [eval $cacheid=no])])
2912
2913 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
2914
2915 eval supported=\$$cacheid
2916 AC_MSG_RESULT([$supported])
2917 if test "$supported" = "yes" ; then
2918 $1="$$1 ]flag["
2919 found="yes"
2920 fi
2921 fi
2922 ])
2923 ]) # XORG_TESTSET_CFLAG
2924
2925 # XORG_COMPILER_FLAGS
2926 # ---------------
2927 # Minimum version: 1.16.0
2928 #
2929 # Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
2930 # arguments supported by the selected compiler which do NOT alter the generated
2931 # code. These arguments will cause the compiler to print various warnings
2932 # during compilation AND turn a conservative set of warnings into errors.
2933 #
2934 # The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
2935 # future versions of util-macros as options are added to new compilers.
2936 #
2937 AC_DEFUN([XORG_COMPILER_FLAGS], [
2938 AC_REQUIRE([XORG_COMPILER_BRAND])
2939
2940 AC_ARG_ENABLE(selective-werror,
2941 AS_HELP_STRING([--disable-selective-werror],
2942 [Turn off selective compiler errors. (default: enabled)]),
2943 [SELECTIVE_WERROR=$enableval],
2944 [SELECTIVE_WERROR=yes])
2945
2946 AC_LANG_CASE(
2947 [C], [
2948 define([PREFIX], [C])
2949 ],
2950 [C++], [
2951 define([PREFIX], [CXX])
2952 ]
2953 )
2954 # -v is too short to test reliably with XORG_TESTSET_CFLAG
2955 if test "x$SUNCC" = "xyes"; then
2956 [BASE_]PREFIX[FLAGS]="-v"
2957 else
2958 [BASE_]PREFIX[FLAGS]=""
2959 fi
2960
2961 # This chunk of warnings were those that existed in the legacy CWARNFLAGS
2962 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
2963 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
2964 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
2965 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
2966
2967 AC_LANG_CASE(
2968 [C], [
2969 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
2970 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
2971 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
2972 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
2973 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
2974 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
2975 ]
2976 )
2977
2978 # This chunk adds additional warnings that could catch undesired effects.
2979 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
2980 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
2981 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
2982 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
2983 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
2984 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
2985 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
2986
2987 # These are currently disabled because they are noisy. They will be enabled
2988 # in the future once the codebase is sufficiently modernized to silence
2989 # them. For now, I don't want them to drown out the other warnings.
2990 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
2991 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
2992 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
2993
2994 # Turn some warnings into errors, so we don't accidently get successful builds
2995 # when there are problems that should be fixed.
2996
2997 if test "x$SELECTIVE_WERROR" = "xyes" ; then
2998 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
2999 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
3000 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
3001 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
3002 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
3003 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
3004 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
3005 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
3006 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
3007 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
3008 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
3009 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
3010 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
3011 else
3012 AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
3013 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
3014 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
3015 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
3016 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
3017 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
3018 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
3019 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
3020 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
3021 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
3022 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
3023 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
3024 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
3025 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
3026 fi
3027
3028 AC_SUBST([BASE_]PREFIX[FLAGS])
3029 ]) # XORG_COMPILER_FLAGS
3030
3031 # XORG_CWARNFLAGS
3032 # ---------------
3033 # Minimum version: 1.2.0
3034 # Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
3035 #
3036 # Defines CWARNFLAGS to enable C compiler warnings.
3037 #
3038 # This function is deprecated because it defines -fno-strict-aliasing
3039 # which alters the code generated by the compiler. If -fno-strict-aliasing
3040 # is needed, then it should be added explicitly in the module when
3041 # it is updated to use BASE_CFLAGS.
3042 #
3043 AC_DEFUN([XORG_CWARNFLAGS], [
3044 AC_REQUIRE([XORG_COMPILER_FLAGS])
3045 AC_REQUIRE([XORG_COMPILER_BRAND])
3046 AC_LANG_CASE(
3047 [C], [
3048 CWARNFLAGS="$BASE_CFLAGS"
3049 if test "x$GCC" = xyes ; then
3050 CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
3051 fi
3052 AC_SUBST(CWARNFLAGS)
3053 ]
3054 )
3055 ]) # XORG_CWARNFLAGS
3056
3057 # XORG_STRICT_OPTION
3058 # -----------------------
3059 # Minimum version: 1.3.0
3060 #
3061 # Add configure option to enable strict compilation flags, such as treating
3062 # warnings as fatal errors.
3063 # If --enable-strict-compilation is passed to configure, adds strict flags to
3064 # $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
3065 #
3066 # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
3067 # when strict compilation is unconditionally desired.
3068 AC_DEFUN([XORG_STRICT_OPTION], [
3069 AC_REQUIRE([XORG_CWARNFLAGS])
3070 AC_REQUIRE([XORG_COMPILER_FLAGS])
3071
3072 AC_ARG_ENABLE(strict-compilation,
3073 AS_HELP_STRING([--enable-strict-compilation],
3074 [Enable all warnings from compiler and make them errors (default: disabled)]),
3075 [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
3076
3077 AC_LANG_CASE(
3078 [C], [
3079 define([PREFIX], [C])
3080 ],
3081 [C++], [
3082 define([PREFIX], [CXX])
3083 ]
3084 )
3085
3086 [STRICT_]PREFIX[FLAGS]=""
3087 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
3088 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
3089
3090 # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
3091 # activate it with -Werror, so we add it here explicitly.
3092 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
3093
3094 if test "x$STRICT_COMPILE" = "xyes"; then
3095 [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
3096 AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
3097 fi
3098 AC_SUBST([STRICT_]PREFIX[FLAGS])
3099 AC_SUBST([BASE_]PREFIX[FLAGS])
3100 AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
3101 ]) # XORG_STRICT_OPTION
3102
3103 # XORG_DEFAULT_OPTIONS
3104 # --------------------
3105 # Minimum version: 1.3.0
3106 #
3107 # Defines default options for X.Org modules.
3108 #
3109 AC_DEFUN([XORG_DEFAULT_OPTIONS], [
3110 AC_REQUIRE([AC_PROG_INSTALL])
3111 XORG_COMPILER_FLAGS
3112 XORG_CWARNFLAGS
3113 XORG_STRICT_OPTION
3114 XORG_RELEASE_VERSION
3115 XORG_CHANGELOG
3116 XORG_INSTALL
3117 XORG_MANPAGE_SECTIONS
3118 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
3119 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
3120 ]) # XORG_DEFAULT_OPTIONS
3121
3122 # XORG_INSTALL()
3123 # ----------------
3124 # Minimum version: 1.4.0
3125 #
3126 # Defines the variable INSTALL_CMD as the command to copy
3127 # INSTALL from $prefix/share/util-macros.
3128 #
3129 AC_DEFUN([XORG_INSTALL], [
3130 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
3131 macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
3132 INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
3133 mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
3134 || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
3135 echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
3136 AC_SUBST([INSTALL_CMD])
3137 ]) # XORG_INSTALL
3138 dnl Copyright 2005 Red Hat, Inc
3139 dnl
3140 dnl Permission to use, copy, modify, distribute, and sell this software and its
3141 dnl documentation for any purpose is hereby granted without fee, provided that
3142 dnl the above copyright notice appear in all copies and that both that
3143 dnl copyright notice and this permission notice appear in supporting
3144 dnl documentation.
3145 dnl
3146 dnl The above copyright notice and this permission notice shall be included
3147 dnl in all copies or substantial portions of the Software.
3148 dnl
3149 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
3150 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3151 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
3152 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
3153 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
3154 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3155 dnl OTHER DEALINGS IN THE SOFTWARE.
3156 dnl
3157 dnl Except as contained in this notice, the name of the copyright holders shall
3158 dnl not be used in advertising or otherwise to promote the sale, use or
3159 dnl other dealings in this Software without prior written authorization
3160 dnl from the copyright holders.
3161 dnl
3162
3163 # XORG_RELEASE_VERSION
3164 # --------------------
3165 # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
3166
3167 AC_DEFUN([XORG_RELEASE_VERSION],[
3168 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
3169 [`echo $PACKAGE_VERSION | cut -d . -f 1`],
3170 [Major version of this package])
3171 PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
3172 if test "x$PVM" = "x"; then
3173 PVM="0"
3174 fi
3175 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
3176 [$PVM],
3177 [Minor version of this package])
3178 PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
3179 if test "x$PVP" = "x"; then
3180 PVP="0"
3181 fi
3182 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
3183 [$PVP],
3184 [Patch version of this package])
3185 ])
3186
3187 # XORG_CHANGELOG()
3188 # ----------------
3189 # Minimum version: 1.2.0
3190 #
3191 # Defines the variable CHANGELOG_CMD as the command to generate
3192 # ChangeLog from git.
3193 #
3194 #
3195 AC_DEFUN([XORG_CHANGELOG], [
3196 CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
3197 mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
3198 || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
3199 echo 'git directory not found: installing possibly empty changelog.' >&2)"
3200 AC_SUBST([CHANGELOG_CMD])
3201 ]) # XORG_CHANGELOG
3202
211211
212212 void
213213 CreateManpageWidget(ManpageGlobals * man_globals,
214 char *name, Boolean full_instance)
214 String name, Boolean full_instance)
215215 {
216216 Arg arglist[MANPAGEARGS]; /* An argument list for widget creation */
217217 Cardinal num_args; /* The number of arguments in the list. */
00 #! /bin/sh
11 # Attempt to guess a canonical system name.
2 # Copyright 1992-2014 Free Software Foundation, Inc.
3
4 timestamp='2014-11-04'
2 # Copyright 1992-2018 Free Software Foundation, Inc.
3
4 timestamp='2018-03-01'
55
66 # This file is free software; you can redistribute it and/or modify it
77 # under the terms of the GNU General Public License as published by
1414 # General Public License for more details.
1515 #
1616 # 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/>.
17 # along with this program; if not, see <https://www.gnu.org/licenses/>.
1818 #
1919 # As a special exception to the GNU General Public License, if you
2020 # distribute this file as part of a program that contains a
2626 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
2727 #
2828 # You can get the latest version of this script from:
29 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
29 # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
3030 #
3131 # Please send patches to <config-patches@gnu.org>.
3232
3838
3939 Output the configuration name of the system \`$me' is run on.
4040
41 Operation modes:
41 Options:
4242 -h, --help print this help, then exit
4343 -t, --time-stamp print date of last modification, then exit
4444 -v, --version print version number, then exit
4949 GNU config.guess ($timestamp)
5050
5151 Originally written by Per Bothner.
52 Copyright 1992-2014 Free Software Foundation, Inc.
52 Copyright 1992-2018 Free Software Foundation, Inc.
5353
5454 This is free software; see the source for copying conditions. There is NO
5555 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
106106 dummy=$tmp/dummy ;
107107 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
108108 case $CC_FOR_BUILD,$HOST_CC,$CC in
109 ,,) echo "int x;" > $dummy.c ;
109 ,,) echo "int x;" > "$dummy.c" ;
110110 for c in cc gcc c89 c99 ; do
111 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
111 if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
112112 CC_FOR_BUILD="$c"; break ;
113113 fi ;
114114 done ;
131131 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
132132 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
133133
134 case "${UNAME_SYSTEM}" in
134 case "$UNAME_SYSTEM" in
135135 Linux|GNU|GNU/*)
136136 # If the system lacks a compiler, then just pick glibc.
137137 # We could probably try harder.
138138 LIBC=gnu
139139
140 eval $set_cc_for_build
141 cat <<-EOF > $dummy.c
140 eval "$set_cc_for_build"
141 cat <<-EOF > "$dummy.c"
142142 #include <features.h>
143143 #if defined(__UCLIBC__)
144144 LIBC=uclibc
148148 LIBC=gnu
149149 #endif
150150 EOF
151 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
151 eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
152
153 # If ldd exists, use it to detect musl libc.
154 if command -v ldd >/dev/null && \
155 ldd --version 2>&1 | grep -q ^musl
156 then
157 LIBC=musl
158 fi
152159 ;;
153160 esac
154161
155162 # Note: order is significant - the case branches are not exclusive.
156163
157 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
164 case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
158165 *:NetBSD:*:*)
159166 # NetBSD (nbsd) targets should (where applicable) match one or
160167 # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
167174 # Note: NetBSD doesn't particularly care about the vendor
168175 # portion of the name. We always set it to "unknown".
169176 sysctl="sysctl -n hw.machine_arch"
170 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
171 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
172 case "${UNAME_MACHINE_ARCH}" in
177 UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
178 "/sbin/$sysctl" 2>/dev/null || \
179 "/usr/sbin/$sysctl" 2>/dev/null || \
180 echo unknown)`
181 case "$UNAME_MACHINE_ARCH" in
173182 armeb) machine=armeb-unknown ;;
174183 arm*) machine=arm-unknown ;;
175184 sh3el) machine=shl-unknown ;;
176185 sh3eb) machine=sh-unknown ;;
177186 sh5el) machine=sh5le-unknown ;;
178 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
187 earmv*)
188 arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
189 endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
190 machine="${arch}${endian}"-unknown
191 ;;
192 *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
179193 esac
180194 # The Operating System including object format, if it has switched
181 # to ELF recently, or will in the future.
182 case "${UNAME_MACHINE_ARCH}" in
195 # to ELF recently (or will in the future) and ABI.
196 case "$UNAME_MACHINE_ARCH" in
197 earm*)
198 os=netbsdelf
199 ;;
183200 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
184 eval $set_cc_for_build
201 eval "$set_cc_for_build"
185202 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
186203 | grep -q __ELF__
187204 then
196213 os=netbsd
197214 ;;
198215 esac
216 # Determine ABI tags.
217 case "$UNAME_MACHINE_ARCH" in
218 earm*)
219 expr='s/^earmv[0-9]/-eabi/;s/eb$//'
220 abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
221 ;;
222 esac
199223 # The OS release
200224 # Debian GNU/NetBSD machines have a different userland, and
201225 # thus, need a distinct triplet. However, they do not need
202226 # kernel version information, so it can be replaced with a
203227 # suitable tag, in the style of linux-gnu.
204 case "${UNAME_VERSION}" in
228 case "$UNAME_VERSION" in
205229 Debian*)
206230 release='-gnu'
207231 ;;
208232 *)
209 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
233 release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
210234 ;;
211235 esac
212236 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
213237 # contains redundant information, the shorter form:
214238 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
215 echo "${machine}-${os}${release}"
239 echo "$machine-${os}${release}${abi}"
216240 exit ;;
217241 *:Bitrig:*:*)
218242 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
219 echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
243 echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
220244 exit ;;
221245 *:OpenBSD:*:*)
222246 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
223 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
247 echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
248 exit ;;
249 *:LibertyBSD:*:*)
250 UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
251 echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
252 exit ;;
253 *:MidnightBSD:*:*)
254 echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
224255 exit ;;
225256 *:ekkoBSD:*:*)
226 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
257 echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
227258 exit ;;
228259 *:SolidBSD:*:*)
229 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
260 echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
230261 exit ;;
231262 macppc:MirBSD:*:*)
232 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
263 echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
233264 exit ;;
234265 *:MirBSD:*:*)
235 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
236 exit ;;
266 echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
267 exit ;;
268 *:Sortix:*:*)
269 echo "$UNAME_MACHINE"-unknown-sortix
270 exit ;;
271 *:Redox:*:*)
272 echo "$UNAME_MACHINE"-unknown-redox
273 exit ;;
274 mips:OSF1:*.*)
275 echo mips-dec-osf1
276 exit ;;
237277 alpha:OSF1:*:*)
238278 case $UNAME_RELEASE in
239279 *4.0)
250290 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
251291 case "$ALPHA_CPU_TYPE" in
252292 "EV4 (21064)")
253 UNAME_MACHINE="alpha" ;;
293 UNAME_MACHINE=alpha ;;
254294 "EV4.5 (21064)")
255 UNAME_MACHINE="alpha" ;;
295 UNAME_MACHINE=alpha ;;
256296 "LCA4 (21066/21068)")
257 UNAME_MACHINE="alpha" ;;
297 UNAME_MACHINE=alpha ;;
258298 "EV5 (21164)")
259 UNAME_MACHINE="alphaev5" ;;
299 UNAME_MACHINE=alphaev5 ;;
260300 "EV5.6 (21164A)")
261 UNAME_MACHINE="alphaev56" ;;
301 UNAME_MACHINE=alphaev56 ;;
262302 "EV5.6 (21164PC)")
263 UNAME_MACHINE="alphapca56" ;;
303 UNAME_MACHINE=alphapca56 ;;
264304 "EV5.7 (21164PC)")
265 UNAME_MACHINE="alphapca57" ;;
305 UNAME_MACHINE=alphapca57 ;;
266306 "EV6 (21264)")
267 UNAME_MACHINE="alphaev6" ;;
307 UNAME_MACHINE=alphaev6 ;;
268308 "EV6.7 (21264A)")
269 UNAME_MACHINE="alphaev67" ;;
309 UNAME_MACHINE=alphaev67 ;;
270310 "EV6.8CB (21264C)")
271 UNAME_MACHINE="alphaev68" ;;
311 UNAME_MACHINE=alphaev68 ;;
272312 "EV6.8AL (21264B)")
273 UNAME_MACHINE="alphaev68" ;;
313 UNAME_MACHINE=alphaev68 ;;
274314 "EV6.8CX (21264D)")
275 UNAME_MACHINE="alphaev68" ;;
315 UNAME_MACHINE=alphaev68 ;;
276316 "EV6.9A (21264/EV69A)")
277 UNAME_MACHINE="alphaev69" ;;
317 UNAME_MACHINE=alphaev69 ;;
278318 "EV7 (21364)")
279 UNAME_MACHINE="alphaev7" ;;
319 UNAME_MACHINE=alphaev7 ;;
280320 "EV7.9 (21364A)")
281 UNAME_MACHINE="alphaev79" ;;
321 UNAME_MACHINE=alphaev79 ;;
282322 esac
283323 # A Pn.n version is a patched version.
284324 # A Vn.n version is a released version.
285325 # A Tn.n version is a released field test version.
286326 # A Xn.n version is an unreleased experimental baselevel.
287327 # 1.2 uses "1.2" for uname -r.
288 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
328 echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
289329 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
290330 exitcode=$?
291331 trap '' 0
292332 exit $exitcode ;;
293 Alpha\ *:Windows_NT*:*)
294 # How do we know it's Interix rather than the generic POSIX subsystem?
295 # Should we change UNAME_MACHINE based on the output of uname instead
296 # of the specific Alpha model?
297 echo alpha-pc-interix
298 exit ;;
299 21064:Windows_NT:50:3)
300 echo alpha-dec-winnt3.5
301 exit ;;
302333 Amiga*:UNIX_System_V:4.0:*)
303334 echo m68k-unknown-sysv4
304335 exit ;;
305336 *:[Aa]miga[Oo][Ss]:*:*)
306 echo ${UNAME_MACHINE}-unknown-amigaos
337 echo "$UNAME_MACHINE"-unknown-amigaos
307338 exit ;;
308339 *:[Mm]orph[Oo][Ss]:*:*)
309 echo ${UNAME_MACHINE}-unknown-morphos
340 echo "$UNAME_MACHINE"-unknown-morphos
310341 exit ;;
311342 *:OS/390:*:*)
312343 echo i370-ibm-openedition
318349 echo powerpc-ibm-os400
319350 exit ;;
320351 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
321 echo arm-acorn-riscix${UNAME_RELEASE}
352 echo arm-acorn-riscix"$UNAME_RELEASE"
322353 exit ;;
323354 arm*:riscos:*:*|arm*:RISCOS:*:*)
324355 echo arm-unknown-riscos
345376 sparc) echo sparc-icl-nx7; exit ;;
346377 esac ;;
347378 s390x:SunOS:*:*)
348 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
379 echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
349380 exit ;;
350381 sun4H:SunOS:5.*:*)
351 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
382 echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
352383 exit ;;
353384 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
354 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
385 echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
355386 exit ;;
356387 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
357 echo i386-pc-auroraux${UNAME_RELEASE}
388 echo i386-pc-auroraux"$UNAME_RELEASE"
358389 exit ;;
359390 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
360 eval $set_cc_for_build
361 SUN_ARCH="i386"
391 eval "$set_cc_for_build"
392 SUN_ARCH=i386
362393 # If there is a compiler, see if it is configured for 64-bit objects.
363394 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
364395 # This test works for both compilers.
365 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
396 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
366397 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
367 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
398 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
368399 grep IS_64BIT_ARCH >/dev/null
369400 then
370 SUN_ARCH="x86_64"
401 SUN_ARCH=x86_64
371402 fi
372403 fi
373 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
404 echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
374405 exit ;;
375406 sun4*:SunOS:6*:*)
376407 # According to config.sub, this is the proper way to canonicalize
377408 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
378409 # it's likely to be more like Solaris than SunOS4.
379 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
410 echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
380411 exit ;;
381412 sun4*:SunOS:*:*)
382413 case "`/usr/bin/arch -k`" in
385416 ;;
386417 esac
387418 # Japanese Language versions have a version number like `4.1.3-JL'.
388 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
419 echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
389420 exit ;;
390421 sun3*:SunOS:*:*)
391 echo m68k-sun-sunos${UNAME_RELEASE}
422 echo m68k-sun-sunos"$UNAME_RELEASE"
392423 exit ;;
393424 sun*:*:4.2BSD:*)
394425 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
395 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
426 test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
396427 case "`/bin/arch`" in
397428 sun3)
398 echo m68k-sun-sunos${UNAME_RELEASE}
429 echo m68k-sun-sunos"$UNAME_RELEASE"
399430 ;;
400431 sun4)
401 echo sparc-sun-sunos${UNAME_RELEASE}
432 echo sparc-sun-sunos"$UNAME_RELEASE"
402433 ;;
403434 esac
404435 exit ;;
405436 aushp:SunOS:*:*)
406 echo sparc-auspex-sunos${UNAME_RELEASE}
437 echo sparc-auspex-sunos"$UNAME_RELEASE"
407438 exit ;;
408439 # The situation for MiNT is a little confusing. The machine name
409440 # can be virtually everything (everything which is not
414445 # MiNT. But MiNT is downward compatible to TOS, so this should
415446 # be no problem.
416447 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
417 echo m68k-atari-mint${UNAME_RELEASE}
448 echo m68k-atari-mint"$UNAME_RELEASE"
418449 exit ;;
419450 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
420 echo m68k-atari-mint${UNAME_RELEASE}
451 echo m68k-atari-mint"$UNAME_RELEASE"
421452 exit ;;
422453 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
423 echo m68k-atari-mint${UNAME_RELEASE}
454 echo m68k-atari-mint"$UNAME_RELEASE"
424455 exit ;;
425456 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
426 echo m68k-milan-mint${UNAME_RELEASE}
457 echo m68k-milan-mint"$UNAME_RELEASE"
427458 exit ;;
428459 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
429 echo m68k-hades-mint${UNAME_RELEASE}
460 echo m68k-hades-mint"$UNAME_RELEASE"
430461 exit ;;
431462 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
432 echo m68k-unknown-mint${UNAME_RELEASE}
463 echo m68k-unknown-mint"$UNAME_RELEASE"
433464 exit ;;
434465 m68k:machten:*:*)
435 echo m68k-apple-machten${UNAME_RELEASE}
466 echo m68k-apple-machten"$UNAME_RELEASE"
436467 exit ;;
437468 powerpc:machten:*:*)
438 echo powerpc-apple-machten${UNAME_RELEASE}
469 echo powerpc-apple-machten"$UNAME_RELEASE"
439470 exit ;;
440471 RISC*:Mach:*:*)
441472 echo mips-dec-mach_bsd4.3
442473 exit ;;
443474 RISC*:ULTRIX:*:*)
444 echo mips-dec-ultrix${UNAME_RELEASE}
475 echo mips-dec-ultrix"$UNAME_RELEASE"
445476 exit ;;
446477 VAX*:ULTRIX*:*:*)
447 echo vax-dec-ultrix${UNAME_RELEASE}
478 echo vax-dec-ultrix"$UNAME_RELEASE"
448479 exit ;;
449480 2020:CLIX:*:* | 2430:CLIX:*:*)
450 echo clipper-intergraph-clix${UNAME_RELEASE}
481 echo clipper-intergraph-clix"$UNAME_RELEASE"
451482 exit ;;
452483 mips:*:*:UMIPS | mips:*:*:RISCos)
453 eval $set_cc_for_build
454 sed 's/^ //' << EOF >$dummy.c
484 eval "$set_cc_for_build"
485 sed 's/^ //' << EOF > "$dummy.c"
455486 #ifdef __cplusplus
456487 #include <stdio.h> /* for printf() prototype */
457488 int main (int argc, char *argv[]) {
460491 #endif
461492 #if defined (host_mips) && defined (MIPSEB)
462493 #if defined (SYSTYPE_SYSV)
463 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
494 printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
464495 #endif
465496 #if defined (SYSTYPE_SVR4)
466 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
497 printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
467498 #endif
468499 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
469 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
500 printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
470501 #endif
471502 #endif
472503 exit (-1);
473504 }
474505 EOF
475 $CC_FOR_BUILD -o $dummy $dummy.c &&
476 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
477 SYSTEM_NAME=`$dummy $dummyarg` &&
506 $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
507 dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
508 SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
478509 { echo "$SYSTEM_NAME"; exit; }
479 echo mips-mips-riscos${UNAME_RELEASE}
510 echo mips-mips-riscos"$UNAME_RELEASE"
480511 exit ;;
481512 Motorola:PowerMAX_OS:*:*)
482513 echo powerpc-motorola-powermax
502533 AViiON:dgux:*:*)
503534 # DG/UX returns AViiON for all architectures
504535 UNAME_PROCESSOR=`/usr/bin/uname -p`
505 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
536 if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
506537 then
507 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
508 [ ${TARGET_BINARY_INTERFACE}x = x ]
538 if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
539 [ "$TARGET_BINARY_INTERFACE"x = x ]
509540 then
510 echo m88k-dg-dgux${UNAME_RELEASE}
541 echo m88k-dg-dgux"$UNAME_RELEASE"
511542 else
512 echo m88k-dg-dguxbcs${UNAME_RELEASE}
543 echo m88k-dg-dguxbcs"$UNAME_RELEASE"
513544 fi
514545 else
515 echo i586-dg-dgux${UNAME_RELEASE}
546 echo i586-dg-dgux"$UNAME_RELEASE"
516547 fi
517548 exit ;;
518549 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
529560 echo m68k-tektronix-bsd
530561 exit ;;
531562 *:IRIX*:*:*)
532 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
563 echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
533564 exit ;;
534565 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
535566 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
541572 if [ -x /usr/bin/oslevel ] ; then
542573 IBM_REV=`/usr/bin/oslevel`
543574 else
544 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
545 fi
546 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
575 IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
576 fi
577 echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
547578 exit ;;
548579 *:AIX:2:3)
549580 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
550 eval $set_cc_for_build
551 sed 's/^ //' << EOF >$dummy.c
581 eval "$set_cc_for_build"
582 sed 's/^ //' << EOF > "$dummy.c"
552583 #include <sys/systemcfg.h>
553584
554585 main()
559590 exit(0);
560591 }
561592 EOF
562 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
593 if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
563594 then
564595 echo "$SYSTEM_NAME"
565596 else
573604 exit ;;
574605 *:AIX:*:[4567])
575606 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
576 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
607 if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
577608 IBM_ARCH=rs6000
578609 else
579610 IBM_ARCH=powerpc
582613 IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
583614 awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
584615 else
585 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
586 fi
587 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
616 IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
617 fi
618 echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
588619 exit ;;
589620 *:AIX:*:*)
590621 echo rs6000-ibm-aix
591622 exit ;;
592 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
623 ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
593624 echo romp-ibm-bsd4.4
594625 exit ;;
595626 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
596 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
627 echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
597628 exit ;; # report: romp-ibm BSD 4.3
598629 *:BOSX:*:*)
599630 echo rs6000-bull-bosx
608639 echo m68k-hp-bsd4.4
609640 exit ;;
610641 9000/[34678]??:HP-UX:*:*)
611 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
612 case "${UNAME_MACHINE}" in
613 9000/31? ) HP_ARCH=m68000 ;;
614 9000/[34]?? ) HP_ARCH=m68k ;;
642 HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
643 case "$UNAME_MACHINE" in
644 9000/31?) HP_ARCH=m68000 ;;
645 9000/[34]??) HP_ARCH=m68k ;;
615646 9000/[678][0-9][0-9])
616647 if [ -x /usr/bin/getconf ]; then
617648 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
618649 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
619 case "${sc_cpu_version}" in
620 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
621 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
650 case "$sc_cpu_version" in
651 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
652 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
622653 532) # CPU_PA_RISC2_0
623 case "${sc_kernel_bits}" in
624 32) HP_ARCH="hppa2.0n" ;;
625 64) HP_ARCH="hppa2.0w" ;;
626 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
654 case "$sc_kernel_bits" in
655 32) HP_ARCH=hppa2.0n ;;
656 64) HP_ARCH=hppa2.0w ;;
657 '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
627658 esac ;;
628659 esac
629660 fi
630 if [ "${HP_ARCH}" = "" ]; then
631 eval $set_cc_for_build
632 sed 's/^ //' << EOF >$dummy.c
661 if [ "$HP_ARCH" = "" ]; then
662 eval "$set_cc_for_build"
663 sed 's/^ //' << EOF > "$dummy.c"
633664
634665 #define _HPUX_SOURCE
635666 #include <stdlib.h>
662693 exit (0);
663694 }
664695 EOF
665 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
696 (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
666697 test -z "$HP_ARCH" && HP_ARCH=hppa
667698 fi ;;
668699 esac
669 if [ ${HP_ARCH} = "hppa2.0w" ]
700 if [ "$HP_ARCH" = hppa2.0w ]
670701 then
671 eval $set_cc_for_build
702 eval "$set_cc_for_build"
672703
673704 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
674705 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
679710 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
680711 # => hppa64-hp-hpux11.23
681712
682 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
713 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
683714 grep -q __LP64__
684715 then
685 HP_ARCH="hppa2.0w"
716 HP_ARCH=hppa2.0w
686717 else
687 HP_ARCH="hppa64"
718 HP_ARCH=hppa64
688719 fi
689720 fi
690 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
721 echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
691722 exit ;;
692723 ia64:HP-UX:*:*)
693 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
694 echo ia64-hp-hpux${HPUX_REV}
724 HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
725 echo ia64-hp-hpux"$HPUX_REV"
695726 exit ;;
696727 3050*:HI-UX:*:*)
697 eval $set_cc_for_build
698 sed 's/^ //' << EOF >$dummy.c
728 eval "$set_cc_for_build"
729 sed 's/^ //' << EOF > "$dummy.c"
699730 #include <unistd.h>
700731 int
701732 main ()
720751 exit (0);
721752 }
722753 EOF
723 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
754 $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
724755 { echo "$SYSTEM_NAME"; exit; }
725756 echo unknown-hitachi-hiuxwe2
726757 exit ;;
727 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
758 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
728759 echo hppa1.1-hp-bsd
729760 exit ;;
730761 9000/8??:4.3bsd:*:*)
733764 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
734765 echo hppa1.0-hp-mpeix
735766 exit ;;
736 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
767 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
737768 echo hppa1.1-hp-osf
738769 exit ;;
739770 hp8??:OSF1:*:*)
741772 exit ;;
742773 i*86:OSF1:*:*)
743774 if [ -x /usr/sbin/sysversion ] ; then
744 echo ${UNAME_MACHINE}-unknown-osf1mk
775 echo "$UNAME_MACHINE"-unknown-osf1mk
745776 else
746 echo ${UNAME_MACHINE}-unknown-osf1
777 echo "$UNAME_MACHINE"-unknown-osf1
747778 fi
748779 exit ;;
749780 parisc*:Lites*:*:*)
768799 echo c4-convex-bsd
769800 exit ;;
770801 CRAY*Y-MP:*:*:*)
771 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
802 echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
772803 exit ;;
773804 CRAY*[A-Z]90:*:*:*)
774 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
805 echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
775806 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
776807 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
777808 -e 's/\.[^.]*$/.X/'
778809 exit ;;
779810 CRAY*TS:*:*:*)
780 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
811 echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
781812 exit ;;
782813 CRAY*T3E:*:*:*)
783 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
814 echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
784815 exit ;;
785816 CRAY*SV1:*:*:*)
786 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
817 echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
787818 exit ;;
788819 *:UNICOS/mp:*:*)
789 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
820 echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
790821 exit ;;
791822 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
792 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
793 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
794 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
823 FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
824 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
825 FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
795826 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
796827 exit ;;
797828 5000:UNIX_System_V:4.*:*)
798 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
799 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
829 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
830 FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
800831 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
801832 exit ;;
802833 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
803 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
834 echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
804835 exit ;;
805836 sparc*:BSD/OS:*:*)
806 echo sparc-unknown-bsdi${UNAME_RELEASE}
837 echo sparc-unknown-bsdi"$UNAME_RELEASE"
807838 exit ;;
808839 *:BSD/OS:*:*)
809 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
840 echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
810841 exit ;;
811842 *:FreeBSD:*:*)
812843 UNAME_PROCESSOR=`/usr/bin/uname -p`
813 case ${UNAME_PROCESSOR} in
844 case "$UNAME_PROCESSOR" in
814845 amd64)
815 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
816 *)
817 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
846 UNAME_PROCESSOR=x86_64 ;;
847 i386)
848 UNAME_PROCESSOR=i586 ;;
818849 esac
850 echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
819851 exit ;;
820852 i*:CYGWIN*:*)
821 echo ${UNAME_MACHINE}-pc-cygwin
853 echo "$UNAME_MACHINE"-pc-cygwin
822854 exit ;;
823855 *:MINGW64*:*)
824 echo ${UNAME_MACHINE}-pc-mingw64
856 echo "$UNAME_MACHINE"-pc-mingw64
825857 exit ;;
826858 *:MINGW*:*)
827 echo ${UNAME_MACHINE}-pc-mingw32
859 echo "$UNAME_MACHINE"-pc-mingw32
828860 exit ;;
829861 *:MSYS*:*)
830 echo ${UNAME_MACHINE}-pc-msys
831 exit ;;
832 i*:windows32*:*)
833 # uname -m includes "-pc" on this system.
834 echo ${UNAME_MACHINE}-mingw32
862 echo "$UNAME_MACHINE"-pc-msys
835863 exit ;;
836864 i*:PW*:*)
837 echo ${UNAME_MACHINE}-pc-pw32
865 echo "$UNAME_MACHINE"-pc-pw32
838866 exit ;;
839867 *:Interix*:*)
840 case ${UNAME_MACHINE} in
868 case "$UNAME_MACHINE" in
841869 x86)
842 echo i586-pc-interix${UNAME_RELEASE}
870 echo i586-pc-interix"$UNAME_RELEASE"
843871 exit ;;
844872 authenticamd | genuineintel | EM64T)
845 echo x86_64-unknown-interix${UNAME_RELEASE}
873 echo x86_64-unknown-interix"$UNAME_RELEASE"
846874 exit ;;
847875 IA64)
848 echo ia64-unknown-interix${UNAME_RELEASE}
876 echo ia64-unknown-interix"$UNAME_RELEASE"
849877 exit ;;
850878 esac ;;
851 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
852 echo i${UNAME_MACHINE}-pc-mks
853 exit ;;
854 8664:Windows_NT:*)
855 echo x86_64-pc-mks
856 exit ;;
857 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
858 # How do we know it's Interix rather than the generic POSIX subsystem?
859 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
860 # UNAME_MACHINE based on the output of uname instead of i386?
861 echo i586-pc-interix
862 exit ;;
863879 i*:UWIN*:*)
864 echo ${UNAME_MACHINE}-pc-uwin
880 echo "$UNAME_MACHINE"-pc-uwin
865881 exit ;;
866882 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
867883 echo x86_64-unknown-cygwin
868884 exit ;;
869 p*:CYGWIN*:*)
870 echo powerpcle-unknown-cygwin
871 exit ;;
872885 prep*:SunOS:5.*:*)
873 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
886 echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
874887 exit ;;
875888 *:GNU:*:*)
876889 # the GNU system
877 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
890 echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
878891 exit ;;
879892 *:GNU/*:*:*)
880893 # other systems with GNU libc and userland
881 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
894 echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
882895 exit ;;
883896 i*86:Minix:*:*)
884 echo ${UNAME_MACHINE}-pc-minix
897 echo "$UNAME_MACHINE"-pc-minix
885898 exit ;;
886899 aarch64:Linux:*:*)
887 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
900 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
888901 exit ;;
889902 aarch64_be:Linux:*:*)
890903 UNAME_MACHINE=aarch64_be
891 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
904 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
892905 exit ;;
893906 alpha:Linux:*:*)
894907 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
901914 EV68*) UNAME_MACHINE=alphaev68 ;;
902915 esac
903916 objdump --private-headers /bin/sh | grep -q ld.so.1
904 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
905 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
917 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
918 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
906919 exit ;;
907920 arc:Linux:*:* | arceb:Linux:*:*)
908 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
921 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
909922 exit ;;
910923 arm*:Linux:*:*)
911 eval $set_cc_for_build
924 eval "$set_cc_for_build"
912925 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
913926 | grep -q __ARM_EABI__
914927 then
915 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
928 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
916929 else
917930 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
918931 | grep -q __ARM_PCS_VFP
919932 then
920 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
933 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
921934 else
922 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
935 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
923936 fi
924937 fi
925938 exit ;;
926939 avr32*:Linux:*:*)
927 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
940 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
928941 exit ;;
929942 cris:Linux:*:*)
930 echo ${UNAME_MACHINE}-axis-linux-${LIBC}
943 echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
931944 exit ;;
932945 crisv32:Linux:*:*)
933 echo ${UNAME_MACHINE}-axis-linux-${LIBC}
946 echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
947 exit ;;
948 e2k:Linux:*:*)
949 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
934950 exit ;;
935951 frv:Linux:*:*)
936 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
952 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
937953 exit ;;
938954 hexagon:Linux:*:*)
939 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
955 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
940956 exit ;;
941957 i*86:Linux:*:*)
942 echo ${UNAME_MACHINE}-pc-linux-${LIBC}
958 echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
943959 exit ;;
944960 ia64:Linux:*:*)
945 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
961 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
962 exit ;;
963 k1om:Linux:*:*)
964 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
946965 exit ;;
947966 m32r*:Linux:*:*)
948 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
967 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
949968 exit ;;
950969 m68*:Linux:*:*)
951 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
970 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
952971 exit ;;
953972 mips:Linux:*:* | mips64:Linux:*:*)
954 eval $set_cc_for_build
955 sed 's/^ //' << EOF >$dummy.c
973 eval "$set_cc_for_build"
974 sed 's/^ //' << EOF > "$dummy.c"
956975 #undef CPU
957976 #undef ${UNAME_MACHINE}
958977 #undef ${UNAME_MACHINE}el
966985 #endif
967986 #endif
968987 EOF
969 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
970 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
988 eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
989 test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
971990 ;;
991 mips64el:Linux:*:*)
992 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
993 exit ;;
972994 openrisc*:Linux:*:*)
973 echo or1k-unknown-linux-${LIBC}
995 echo or1k-unknown-linux-"$LIBC"
974996 exit ;;
975997 or32:Linux:*:* | or1k*:Linux:*:*)
976 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
998 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
977999 exit ;;
9781000 padre:Linux:*:*)
979 echo sparc-unknown-linux-${LIBC}
1001 echo sparc-unknown-linux-"$LIBC"
9801002 exit ;;
9811003 parisc64:Linux:*:* | hppa64:Linux:*:*)
982 echo hppa64-unknown-linux-${LIBC}
1004 echo hppa64-unknown-linux-"$LIBC"
9831005 exit ;;
9841006 parisc:Linux:*:* | hppa:Linux:*:*)
9851007 # Look for CPU level
9861008 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
987 PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
988 PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
989 *) echo hppa-unknown-linux-${LIBC} ;;
1009 PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
1010 PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
1011 *) echo hppa-unknown-linux-"$LIBC" ;;
9901012 esac
9911013 exit ;;
9921014 ppc64:Linux:*:*)
993 echo powerpc64-unknown-linux-${LIBC}
1015 echo powerpc64-unknown-linux-"$LIBC"
9941016 exit ;;
9951017 ppc:Linux:*:*)
996 echo powerpc-unknown-linux-${LIBC}
1018 echo powerpc-unknown-linux-"$LIBC"
9971019 exit ;;
9981020 ppc64le:Linux:*:*)
999 echo powerpc64le-unknown-linux-${LIBC}
1021 echo powerpc64le-unknown-linux-"$LIBC"
10001022 exit ;;
10011023 ppcle:Linux:*:*)
1002 echo powerpcle-unknown-linux-${LIBC}
1024 echo powerpcle-unknown-linux-"$LIBC"
1025 exit ;;
1026 riscv32:Linux:*:* | riscv64:Linux:*:*)
1027 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10031028 exit ;;
10041029 s390:Linux:*:* | s390x:Linux:*:*)
1005 echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
1030 echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
10061031 exit ;;
10071032 sh64*:Linux:*:*)
1008 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1033 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10091034 exit ;;
10101035 sh*:Linux:*:*)
1011 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1036 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10121037 exit ;;
10131038 sparc:Linux:*:* | sparc64:Linux:*:*)
1014 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1039 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10151040 exit ;;
10161041 tile*:Linux:*:*)
1017 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1042 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10181043 exit ;;
10191044 vax:Linux:*:*)
1020 echo ${UNAME_MACHINE}-dec-linux-${LIBC}
1045 echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
10211046 exit ;;
10221047 x86_64:Linux:*:*)
1023 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1048 echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
10241049 exit ;;
10251050 xtensa*:Linux:*:*)
1026 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1051 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10271052 exit ;;
10281053 i*86:DYNIX/ptx:4*:*)
10291054 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
10371062 # I am not positive that other SVR4 systems won't match this,
10381063 # I just have to hope. -- rms.
10391064 # Use sysv4.2uw... so that sysv4* matches it.
1040 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1065 echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
10411066 exit ;;
10421067 i*86:OS/2:*:*)
10431068 # If we were able to find `uname', then EMX Unix compatibility
10441069 # is probably installed.
1045 echo ${UNAME_MACHINE}-pc-os2-emx
1070 echo "$UNAME_MACHINE"-pc-os2-emx
10461071 exit ;;
10471072 i*86:XTS-300:*:STOP)
1048 echo ${UNAME_MACHINE}-unknown-stop
1073 echo "$UNAME_MACHINE"-unknown-stop
10491074 exit ;;
10501075 i*86:atheos:*:*)
1051 echo ${UNAME_MACHINE}-unknown-atheos
1076 echo "$UNAME_MACHINE"-unknown-atheos
10521077 exit ;;
10531078 i*86:syllable:*:*)
1054 echo ${UNAME_MACHINE}-pc-syllable
1079 echo "$UNAME_MACHINE"-pc-syllable
10551080 exit ;;
10561081 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1057 echo i386-unknown-lynxos${UNAME_RELEASE}
1082 echo i386-unknown-lynxos"$UNAME_RELEASE"
10581083 exit ;;
10591084 i*86:*DOS:*:*)
1060 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1061 exit ;;
1062 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1063 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1085 echo "$UNAME_MACHINE"-pc-msdosdjgpp
1086 exit ;;
1087 i*86:*:4.*:*)
1088 UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
10641089 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1065 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1090 echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
10661091 else
1067 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1092 echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
10681093 fi
10691094 exit ;;
10701095 i*86:*:5:[678]*)
10741099 *Pentium) UNAME_MACHINE=i586 ;;
10751100 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
10761101 esac
1077 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1102 echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
10781103 exit ;;
10791104 i*86:*:3.2:*)
10801105 if test -f /usr/options/cb.name; then
10811106 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1082 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1107 echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
10831108 elif /bin/uname -X 2>/dev/null >/dev/null ; then
10841109 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
10851110 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
10891114 && UNAME_MACHINE=i686
10901115 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
10911116 && UNAME_MACHINE=i686
1092 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1117 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
10931118 else
1094 echo ${UNAME_MACHINE}-pc-sysv32
1119 echo "$UNAME_MACHINE"-pc-sysv32
10951120 fi
10961121 exit ;;
10971122 pc:*:*:*)
10991124 # uname -m prints for DJGPP always 'pc', but it prints nothing about
11001125 # the processor, so we play safe by assuming i586.
11011126 # Note: whatever this is, it MUST be the same as what config.sub
1102 # prints for the "djgpp" host, or else GDB configury will decide that
1127 # prints for the "djgpp" host, or else GDB configure will decide that
11031128 # this is a cross-build.
11041129 echo i586-pc-msdosdjgpp
11051130 exit ;;
11111136 exit ;;
11121137 i860:*:4.*:*) # i860-SVR4
11131138 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1114 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1139 echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
11151140 else # Add other i860-SVR4 vendors below as they are discovered.
1116 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1141 echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
11171142 fi
11181143 exit ;;
11191144 mini*:CTIX:SYS*5:*)
11331158 test -r /etc/.relid \
11341159 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11351160 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1136 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1161 && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
11371162 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1138 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1163 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
11391164 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
11401165 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11411166 && { echo i486-ncr-sysv4; exit; } ;;
11441169 test -r /etc/.relid \
11451170 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11461171 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1147 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1172 && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
11481173 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1149 && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1174 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
11501175 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1151 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1176 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
11521177 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1153 echo m68k-unknown-lynxos${UNAME_RELEASE}
1178 echo m68k-unknown-lynxos"$UNAME_RELEASE"
11541179 exit ;;
11551180 mc68030:UNIX_System_V:4.*:*)
11561181 echo m68k-atari-sysv4
11571182 exit ;;
11581183 TSUNAMI:LynxOS:2.*:*)
1159 echo sparc-unknown-lynxos${UNAME_RELEASE}
1184 echo sparc-unknown-lynxos"$UNAME_RELEASE"
11601185 exit ;;
11611186 rs6000:LynxOS:2.*:*)
1162 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1187 echo rs6000-unknown-lynxos"$UNAME_RELEASE"
11631188 exit ;;
11641189 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1165 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1190 echo powerpc-unknown-lynxos"$UNAME_RELEASE"
11661191 exit ;;
11671192 SM[BE]S:UNIX_SV:*:*)
1168 echo mips-dde-sysv${UNAME_RELEASE}
1193 echo mips-dde-sysv"$UNAME_RELEASE"
11691194 exit ;;
11701195 RM*:ReliantUNIX-*:*:*)
11711196 echo mips-sni-sysv4
11761201 *:SINIX-*:*:*)
11771202 if uname -p 2>/dev/null >/dev/null ; then
11781203 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1179 echo ${UNAME_MACHINE}-sni-sysv4
1204 echo "$UNAME_MACHINE"-sni-sysv4
11801205 else
11811206 echo ns32k-sni-sysv
11821207 fi
11961221 exit ;;
11971222 i*86:VOS:*:*)
11981223 # From Paul.Green@stratus.com.
1199 echo ${UNAME_MACHINE}-stratus-vos
1224 echo "$UNAME_MACHINE"-stratus-vos
12001225 exit ;;
12011226 *:VOS:*:*)
12021227 # From Paul.Green@stratus.com.
12031228 echo hppa1.1-stratus-vos
12041229 exit ;;
12051230 mc68*:A/UX:*:*)
1206 echo m68k-apple-aux${UNAME_RELEASE}
1231 echo m68k-apple-aux"$UNAME_RELEASE"
12071232 exit ;;
12081233 news*:NEWS-OS:6*:*)
12091234 echo mips-sony-newsos6
12101235 exit ;;
12111236 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
12121237 if [ -d /usr/nec ]; then
1213 echo mips-nec-sysv${UNAME_RELEASE}
1238 echo mips-nec-sysv"$UNAME_RELEASE"
12141239 else
1215 echo mips-unknown-sysv${UNAME_RELEASE}
1240 echo mips-unknown-sysv"$UNAME_RELEASE"
12161241 fi
12171242 exit ;;
12181243 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
12311256 echo x86_64-unknown-haiku
12321257 exit ;;
12331258 SX-4:SUPER-UX:*:*)
1234 echo sx4-nec-superux${UNAME_RELEASE}
1259 echo sx4-nec-superux"$UNAME_RELEASE"
12351260 exit ;;
12361261 SX-5:SUPER-UX:*:*)
1237 echo sx5-nec-superux${UNAME_RELEASE}
1262 echo sx5-nec-superux"$UNAME_RELEASE"
12381263 exit ;;
12391264 SX-6:SUPER-UX:*:*)
1240 echo sx6-nec-superux${UNAME_RELEASE}
1265 echo sx6-nec-superux"$UNAME_RELEASE"
12411266 exit ;;
12421267 SX-7:SUPER-UX:*:*)
1243 echo sx7-nec-superux${UNAME_RELEASE}
1268 echo sx7-nec-superux"$UNAME_RELEASE"
12441269 exit ;;
12451270 SX-8:SUPER-UX:*:*)
1246 echo sx8-nec-superux${UNAME_RELEASE}
1271 echo sx8-nec-superux"$UNAME_RELEASE"
12471272 exit ;;
12481273 SX-8R:SUPER-UX:*:*)
1249 echo sx8r-nec-superux${UNAME_RELEASE}
1274 echo sx8r-nec-superux"$UNAME_RELEASE"
1275 exit ;;
1276 SX-ACE:SUPER-UX:*:*)
1277 echo sxace-nec-superux"$UNAME_RELEASE"
12501278 exit ;;
12511279 Power*:Rhapsody:*:*)
1252 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1280 echo powerpc-apple-rhapsody"$UNAME_RELEASE"
12531281 exit ;;
12541282 *:Rhapsody:*:*)
1255 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1283 echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
12561284 exit ;;
12571285 *:Darwin:*:*)
12581286 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1259 eval $set_cc_for_build
1287 eval "$set_cc_for_build"
12601288 if test "$UNAME_PROCESSOR" = unknown ; then
12611289 UNAME_PROCESSOR=powerpc
12621290 fi
1263 if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
1264 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1291 if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
1292 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
12651293 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1266 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1267 grep IS_64BIT_ARCH >/dev/null
1294 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1295 grep IS_64BIT_ARCH >/dev/null
12681296 then
12691297 case $UNAME_PROCESSOR in
12701298 i386) UNAME_PROCESSOR=x86_64 ;;
12711299 powerpc) UNAME_PROCESSOR=powerpc64 ;;
12721300 esac
1301 fi
1302 # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1303 if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1304 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1305 grep IS_PPC >/dev/null
1306 then
1307 UNAME_PROCESSOR=powerpc
12731308 fi
12741309 fi
12751310 elif test "$UNAME_PROCESSOR" = i386 ; then
12811316 # that Apple uses in portable devices.
12821317 UNAME_PROCESSOR=x86_64
12831318 fi
1284 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1319 echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
12851320 exit ;;
12861321 *:procnto*:*:* | *:QNX:[0123456789]*:*)
12871322 UNAME_PROCESSOR=`uname -p`
1288 if test "$UNAME_PROCESSOR" = "x86"; then
1323 if test "$UNAME_PROCESSOR" = x86; then
12891324 UNAME_PROCESSOR=i386
12901325 UNAME_MACHINE=pc
12911326 fi
1292 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1327 echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
12931328 exit ;;
12941329 *:QNX:*:4*)
12951330 echo i386-pc-qnx
12961331 exit ;;
1297 NEO-?:NONSTOP_KERNEL:*:*)
1298 echo neo-tandem-nsk${UNAME_RELEASE}
1332 NEO-*:NONSTOP_KERNEL:*:*)
1333 echo neo-tandem-nsk"$UNAME_RELEASE"
12991334 exit ;;
13001335 NSE-*:NONSTOP_KERNEL:*:*)
1301 echo nse-tandem-nsk${UNAME_RELEASE}
1302 exit ;;
1303 NSR-?:NONSTOP_KERNEL:*:*)
1304 echo nsr-tandem-nsk${UNAME_RELEASE}
1336 echo nse-tandem-nsk"$UNAME_RELEASE"
1337 exit ;;
1338 NSR-*:NONSTOP_KERNEL:*:*)
1339 echo nsr-tandem-nsk"$UNAME_RELEASE"
1340 exit ;;
1341 NSV-*:NONSTOP_KERNEL:*:*)
1342 echo nsv-tandem-nsk"$UNAME_RELEASE"
1343 exit ;;
1344 NSX-*:NONSTOP_KERNEL:*:*)
1345 echo nsx-tandem-nsk"$UNAME_RELEASE"
13051346 exit ;;
13061347 *:NonStop-UX:*:*)
13071348 echo mips-compaq-nonstopux
13101351 echo bs2000-siemens-sysv
13111352 exit ;;
13121353 DS/*:UNIX_System_V:*:*)
1313 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1354 echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
13141355 exit ;;
13151356 *:Plan9:*:*)
13161357 # "uname -m" is not consistent, so use $cputype instead. 386
13171358 # is converted to i386 for consistency with other x86
13181359 # operating systems.
1319 if test "$cputype" = "386"; then
1360 if test "$cputype" = 386; then
13201361 UNAME_MACHINE=i386
13211362 else
13221363 UNAME_MACHINE="$cputype"
13231364 fi
1324 echo ${UNAME_MACHINE}-unknown-plan9
1365 echo "$UNAME_MACHINE"-unknown-plan9
13251366 exit ;;
13261367 *:TOPS-10:*:*)
13271368 echo pdp10-unknown-tops10
13421383 echo pdp10-unknown-its
13431384 exit ;;
13441385 SEI:*:*:SEIUX)
1345 echo mips-sei-seiux${UNAME_RELEASE}
1386 echo mips-sei-seiux"$UNAME_RELEASE"
13461387 exit ;;
13471388 *:DragonFly:*:*)
1348 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1389 echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
13491390 exit ;;
13501391 *:*VMS:*:*)
13511392 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1352 case "${UNAME_MACHINE}" in
1393 case "$UNAME_MACHINE" in
13531394 A*) echo alpha-dec-vms ; exit ;;
13541395 I*) echo ia64-dec-vms ; exit ;;
13551396 V*) echo vax-dec-vms ; exit ;;
13581399 echo i386-pc-xenix
13591400 exit ;;
13601401 i*86:skyos:*:*)
1361 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1402 echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
13621403 exit ;;
13631404 i*86:rdos:*:*)
1364 echo ${UNAME_MACHINE}-pc-rdos
1405 echo "$UNAME_MACHINE"-pc-rdos
13651406 exit ;;
13661407 i*86:AROS:*:*)
1367 echo ${UNAME_MACHINE}-pc-aros
1408 echo "$UNAME_MACHINE"-pc-aros
13681409 exit ;;
13691410 x86_64:VMkernel:*:*)
1370 echo ${UNAME_MACHINE}-unknown-esx
1411 echo "$UNAME_MACHINE"-unknown-esx
1412 exit ;;
1413 amd64:Isilon\ OneFS:*:*)
1414 echo x86_64-unknown-onefs
13711415 exit ;;
13721416 esac
13731417
1418 echo "$0: unable to guess system type" >&2
1419
1420 case "$UNAME_MACHINE:$UNAME_SYSTEM" in
1421 mips:Linux | mips64:Linux)
1422 # If we got here on MIPS GNU/Linux, output extra information.
1423 cat >&2 <<EOF
1424
1425 NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
1426 the system type. Please install a C compiler and try again.
1427 EOF
1428 ;;
1429 esac
1430
13741431 cat >&2 <<EOF
1375 $0: unable to guess system type
1376
1377 This script, last modified $timestamp, has failed to recognize
1378 the operating system you are using. It is advised that you
1379 download the most up to date version of the config scripts from
1380
1381 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1432
1433 This script (version $timestamp), has failed to recognize the
1434 operating system you are using. If your script is old, overwrite *all*
1435 copies of config.guess and config.sub with the latest versions from:
1436
1437 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
13821438 and
1383 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1384
1385 If the version you run ($0) is already up to date, please
1386 send the following data and any information you think might be
1387 pertinent to <config-patches@gnu.org> in order to provide the needed
1388 information to handle your system.
1439 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1440
1441 If $0 has already been updated, send the following data and any
1442 information you think might be pertinent to config-patches@gnu.org to
1443 provide the necessary information to handle your system.
13891444
13901445 config.guess timestamp = $timestamp
13911446
14041459 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
14051460 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
14061461
1407 UNAME_MACHINE = ${UNAME_MACHINE}
1408 UNAME_RELEASE = ${UNAME_RELEASE}
1409 UNAME_SYSTEM = ${UNAME_SYSTEM}
1410 UNAME_VERSION = ${UNAME_VERSION}
1462 UNAME_MACHINE = "$UNAME_MACHINE"
1463 UNAME_RELEASE = "$UNAME_RELEASE"
1464 UNAME_SYSTEM = "$UNAME_SYSTEM"
1465 UNAME_VERSION = "$UNAME_VERSION"
14111466 EOF
14121467
14131468 exit 1
14141469
14151470 # Local variables:
1416 # eval: (add-hook 'write-file-hooks 'time-stamp)
1471 # eval: (add-hook 'write-file-functions 'time-stamp)
14171472 # time-stamp-start: "timestamp='"
14181473 # time-stamp-format: "%:y-%02m-%02d"
14191474 # time-stamp-end: "'"
44
55 /* Define to 1 if you have the <inttypes.h> header file. */
66 #undef HAVE_INTTYPES_H
7
8 /* Define if the man implementation is man-db */
9 #undef HAVE_MANDB
710
811 /* Define to 1 if you have the <memory.h> header file. */
912 #undef HAVE_MEMORY_H
00 #! /bin/sh
11 # Configuration validation subroutine script.
2 # Copyright 1992-2014 Free Software Foundation, Inc.
3
4 timestamp='2014-12-03'
2 # Copyright 1992-2018 Free Software Foundation, Inc.
3
4 timestamp='2018-02-28'
55
66 # This file is free software; you can redistribute it and/or modify it
77 # under the terms of the GNU General Public License as published by
1414 # General Public License for more details.
1515 #
1616 # 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/>.
17 # along with this program; if not, see <https://www.gnu.org/licenses/>.
1818 #
1919 # As a special exception to the GNU General Public License, if you
2020 # distribute this file as part of a program that contains a
3232 # Otherwise, we print the canonical config type on stdout and succeed.
3333
3434 # You can get the latest version of this script from:
35 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
35 # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
3636
3737 # This file is supposed to be the same for all GNU packages
3838 # and recognize all the CPU types, system types and aliases
5252 me=`echo "$0" | sed -e 's,.*/,,'`
5353
5454 usage="\
55 Usage: $0 [OPTION] CPU-MFR-OPSYS
56 $0 [OPTION] ALIAS
55 Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
5756
5857 Canonicalize a configuration name.
5958
60 Operation modes:
59 Options:
6160 -h, --help print this help, then exit
6261 -t, --time-stamp print date of last modification, then exit
6362 -v, --version print version number, then exit
6766 version="\
6867 GNU config.sub ($timestamp)
6968
70 Copyright 1992-2014 Free Software Foundation, Inc.
69 Copyright 1992-2018 Free Software Foundation, Inc.
7170
7271 This is free software; see the source for copying conditions. There is NO
7372 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
9493
9594 *local*)
9695 # First pass through any local machine types.
97 echo $1
96 echo "$1"
9897 exit ;;
9998
10099 * )
112111
113112 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
114113 # Here we must recognize all the valid KERNEL-OS combinations.
115 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
114 maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
116115 case $maybe_os in
117116 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
118117 linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
119 knetbsd*-gnu* | netbsd*-gnu* | \
120 kopensolaris*-gnu* | \
118 knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
119 kopensolaris*-gnu* | cloudabi*-eabi* | \
121120 storm-chaos* | os2-emx* | rtmk-nova*)
122121 os=-$maybe_os
123 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
122 basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
124123 ;;
125124 android-linux)
126125 os=-linux-android
127 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
126 basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
128127 ;;
129128 *)
130 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
131 if [ $basic_machine != $1 ]
132 then os=`echo $1 | sed 's/.*-/-/'`
129 basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
130 if [ "$basic_machine" != "$1" ]
131 then os=`echo "$1" | sed 's/.*-/-/'`
133132 else os=; fi
134133 ;;
135134 esac
178177 ;;
179178 -sco6)
180179 os=-sco5v6
181 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
180 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
182181 ;;
183182 -sco5)
184183 os=-sco3.2v5
185 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
184 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
186185 ;;
187186 -sco4)
188187 os=-sco3.2v4
189 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
188 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
190189 ;;
191190 -sco3.2.[4-9]*)
192191 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
193 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
192 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
194193 ;;
195194 -sco3.2v[4-9]*)
196195 # Don't forget version if it is 3.2v4 or newer.
197 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
196 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
198197 ;;
199198 -sco5v6*)
200199 # Don't forget version if it is 3.2v4 or newer.
201 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
200 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
202201 ;;
203202 -sco*)
204203 os=-sco3.2v2
205 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
204 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
206205 ;;
207206 -udk*)
208 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
207 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
209208 ;;
210209 -isc)
211210 os=-isc2.2
212 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
211 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
213212 ;;
214213 -clix*)
215214 basic_machine=clipper-intergraph
216215 ;;
217216 -isc*)
218 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
217 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
219218 ;;
220219 -lynx*178)
221220 os=-lynxos178
227226 os=-lynxos
228227 ;;
229228 -ptx*)
230 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
231 ;;
232 -windowsnt*)
233 os=`echo $os | sed -e 's/windowsnt/winnt/'`
229 basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
234230 ;;
235231 -psos*)
236232 os=-psos
254250 | arc | arceb \
255251 | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
256252 | avr | avr32 \
253 | ba \
257254 | be32 | be64 \
258255 | bfin \
259256 | c4x | c8051 | clipper \
260257 | d10v | d30v | dlx | dsp16xx \
261 | epiphany \
262 | fido | fr30 | frv \
258 | e2k | epiphany \
259 | fido | fr30 | frv | ft32 \
263260 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
264261 | hexagon \
265 | i370 | i860 | i960 | ia64 \
262 | i370 | i860 | i960 | ia16 | ia64 \
266263 | ip2k | iq2000 \
267264 | k1om \
268265 | le32 | le64 \
298295 | nios | nios2 | nios2eb | nios2el \
299296 | ns16k | ns32k \
300297 | open8 | or1k | or1knd | or32 \
301 | pdp10 | pdp11 | pj | pjl \
298 | pdp10 | pj | pjl \
302299 | powerpc | powerpc64 | powerpc64le | powerpcle \
300 | pru \
303301 | pyramid \
304302 | riscv32 | riscv64 \
305303 | rl78 | rx \
306304 | score \
307 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
305 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
308306 | sh64 | sh64le \
309307 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
310308 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
313311 | ubicom32 \
314312 | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
315313 | visium \
316 | we32k \
314 | wasm32 \
317315 | x86 | xc16x | xstormy16 | xtensa \
318316 | z8k | z80)
319317 basic_machine=$basic_machine-unknown
334332 basic_machine=$basic_machine-unknown
335333 os=-none
336334 ;;
337 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
335 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
338336 ;;
339337 ms1)
340338 basic_machine=mt-unknown
363361 ;;
364362 # Object if more than one company name word.
365363 *-*-*)
366 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
364 echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
367365 exit 1
368366 ;;
369367 # Recognize the basic CPU types with company name.
375373 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
376374 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
377375 | avr-* | avr32-* \
376 | ba-* \
378377 | be32-* | be64-* \
379378 | bfin-* | bs2000-* \
380379 | c[123]* | c30-* | [cjt]90-* | c4x-* \
381380 | c8051-* | clipper-* | craynv-* | cydra-* \
382381 | d10v-* | d30v-* | dlx-* \
383 | elxsi-* \
382 | e2k-* | elxsi-* \
384383 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
385384 | h8300-* | h8500-* \
386385 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
387386 | hexagon-* \
388 | i*86-* | i860-* | i960-* | ia64-* \
387 | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
389388 | ip2k-* | iq2000-* \
390389 | k1om-* \
391390 | le32-* | le64-* \
426425 | orion-* \
427426 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
428427 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
428 | pru-* \
429429 | pyramid-* \
430 | riscv32-* | riscv64-* \
430431 | rl78-* | romp-* | rs6000-* | rx-* \
431432 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
432433 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
433434 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
434435 | sparclite-* \
435 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
436 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
436437 | tahoe-* \
437438 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
438439 | tile*-* \
441442 | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
442443 | vax-* \
443444 | visium-* \
445 | wasm32-* \
444446 | we32k-* \
445447 | x86-* | x86_64-* | xc16x-* | xps100-* \
446448 | xstormy16-* | xtensa*-* \
454456 # Recognize the various machine names and aliases which stand
455457 # for a CPU type and a company and sometimes even an OS.
456458 386bsd)
457 basic_machine=i386-unknown
459 basic_machine=i386-pc
458460 os=-bsd
459461 ;;
460462 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
488490 basic_machine=x86_64-pc
489491 ;;
490492 amd64-*)
491 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
493 basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
492494 ;;
493495 amdahl)
494496 basic_machine=580-amdahl
517519 basic_machine=i386-pc
518520 os=-aros
519521 ;;
522 asmjs)
523 basic_machine=asmjs-unknown
524 ;;
520525 aux)
521526 basic_machine=m68k-apple
522527 os=-aux
530535 os=-linux
531536 ;;
532537 blackfin-*)
533 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
538 basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
534539 os=-linux
535540 ;;
536541 bluegene*)
538543 os=-cnk
539544 ;;
540545 c54x-*)
541 basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
546 basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
542547 ;;
543548 c55x-*)
544 basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
549 basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
545550 ;;
546551 c6x-*)
547 basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
552 basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
548553 ;;
549554 c90)
550555 basic_machine=c90-cray
633638 basic_machine=rs6000-bull
634639 os=-bosx
635640 ;;
636 dpx2* | dpx2*-bull)
641 dpx2*)
637642 basic_machine=m68k-bull
638643 os=-sysv3
644 ;;
645 e500v[12])
646 basic_machine=powerpc-unknown
647 os=$os"spe"
648 ;;
649 e500v[12]-*)
650 basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
651 os=$os"spe"
639652 ;;
640653 ebmon29k)
641654 basic_machine=a29k-amd
726739 hp9k8[0-9][0-9] | hp8[0-9][0-9])
727740 basic_machine=hppa1.0-hp
728741 ;;
729 hppa-next)
730 os=-nextstep3
731 ;;
732742 hppaosf)
733743 basic_machine=hppa1.1-hp
734744 os=-osf
741751 basic_machine=i370-ibm
742752 ;;
743753 i*86v32)
744 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
754 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
745755 os=-sysv32
746756 ;;
747757 i*86v4*)
748 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
758 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
749759 os=-sysv4
750760 ;;
751761 i*86v)
752 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
762 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
753763 os=-sysv
754764 ;;
755765 i*86sol2)
756 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
766 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
757767 os=-solaris2
758768 ;;
759769 i386mach)
760770 basic_machine=i386-mach
761771 os=-mach
762772 ;;
763 i386-vsta | vsta)
773 vsta)
764774 basic_machine=i386-unknown
765775 os=-vsta
766776 ;;
779789 os=-sysv
780790 ;;
781791 leon-*|leon[3-9]-*)
782 basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
792 basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
783793 ;;
784794 m68knommu)
785795 basic_machine=m68k-unknown
786796 os=-linux
787797 ;;
788798 m68knommu-*)
789 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
799 basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
790800 os=-linux
791 ;;
792 m88k-omron*)
793 basic_machine=m88k-omron
794801 ;;
795802 magnum | m3230)
796803 basic_machine=mips-mips
823830 os=-mint
824831 ;;
825832 mips3*-*)
826 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
833 basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
827834 ;;
828835 mips3*)
829 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
836 basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
830837 ;;
831838 monitor)
832839 basic_machine=m68k-rom68k
845852 os=-msdos
846853 ;;
847854 ms1-*)
848 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
855 basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
849856 ;;
850857 msys)
851858 basic_machine=i686-pc
887894 basic_machine=v70-nec
888895 os=-sysv
889896 ;;
890 next | m*-next )
897 next | m*-next)
891898 basic_machine=m68k-next
892899 case $os in
893900 -nextstep* )
932939 nsr-tandem)
933940 basic_machine=nsr-tandem
934941 ;;
942 nsv-tandem)
943 basic_machine=nsv-tandem
944 ;;
945 nsx-tandem)
946 basic_machine=nsx-tandem
947 ;;
935948 op50n-* | op60c-*)
936949 basic_machine=hppa1.1-oki
937950 os=-proelf
964977 os=-linux
965978 ;;
966979 parisc-*)
967 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
980 basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
968981 os=-linux
969982 ;;
970983 pbd)
980993 basic_machine=i386-pc
981994 ;;
982995 pc98-*)
983 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
996 basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
984997 ;;
985998 pentium | p5 | k5 | k6 | nexgen | viac3)
986999 basic_machine=i586-pc
9951008 basic_machine=i786-pc
9961009 ;;
9971010 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
998 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
1011 basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
9991012 ;;
10001013 pentiumpro-* | p6-* | 6x86-* | athlon-*)
1001 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
1014 basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
10021015 ;;
10031016 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1004 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
1017 basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
10051018 ;;
10061019 pentium4-*)
1007 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
1020 basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
10081021 ;;
10091022 pn)
10101023 basic_machine=pn-gould
10141027 ppc | ppcbe) basic_machine=powerpc-unknown
10151028 ;;
10161029 ppc-* | ppcbe-*)
1017 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
1018 ;;
1019 ppcle | powerpclittle | ppc-le | powerpc-little)
1030 basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1031 ;;
1032 ppcle | powerpclittle)
10201033 basic_machine=powerpcle-unknown
10211034 ;;
10221035 ppcle-* | powerpclittle-*)
1023 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
1036 basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
10241037 ;;
10251038 ppc64) basic_machine=powerpc64-unknown
10261039 ;;
1027 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
1028 ;;
1029 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
1040 ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1041 ;;
1042 ppc64le | powerpc64little)
10301043 basic_machine=powerpc64le-unknown
10311044 ;;
10321045 ppc64le-* | powerpc64little-*)
1033 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
1046 basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
10341047 ;;
10351048 ps2)
10361049 basic_machine=i386-ibm
10841097 sequent)
10851098 basic_machine=i386-sequent
10861099 ;;
1087 sh)
1088 basic_machine=sh-hitachi
1089 os=-hms
1090 ;;
10911100 sh5el)
10921101 basic_machine=sh5le-unknown
10931102 ;;
1094 sh64)
1095 basic_machine=sh64-unknown
1096 ;;
1097 sparclite-wrs | simso-wrs)
1103 simso-wrs)
10981104 basic_machine=sparclite-wrs
10991105 os=-vxworks
11001106 ;;
11131119 os=-sysv4
11141120 ;;
11151121 strongarm-* | thumb-*)
1116 basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
1122 basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
11171123 ;;
11181124 sun2)
11191125 basic_machine=m68000-sun
12351241 basic_machine=hppa1.1-winbond
12361242 os=-proelf
12371243 ;;
1244 x64)
1245 basic_machine=x86_64-pc
1246 ;;
12381247 xbox)
12391248 basic_machine=i686-pc
12401249 os=-mingw32
12431252 basic_machine=xps100-honeywell
12441253 ;;
12451254 xscale-* | xscalee[bl]-*)
1246 basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
1255 basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
12471256 ;;
12481257 ymp)
12491258 basic_machine=ymp-cray
12501259 os=-unicos
1251 ;;
1252 z8k-*-coff)
1253 basic_machine=z8k-unknown
1254 os=-sim
1255 ;;
1256 z80-*-coff)
1257 basic_machine=z80-unknown
1258 os=-sim
12591260 ;;
12601261 none)
12611262 basic_machine=none-none
12851286 vax)
12861287 basic_machine=vax-dec
12871288 ;;
1288 pdp10)
1289 # there are many clones, so DEC is not a safe bet
1290 basic_machine=pdp10-unknown
1291 ;;
12921289 pdp11)
12931290 basic_machine=pdp11-dec
12941291 ;;
12981295 sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
12991296 basic_machine=sh-unknown
13001297 ;;
1301 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1302 basic_machine=sparc-sun
1303 ;;
13041298 cydra)
13051299 basic_machine=cydra-cydrome
13061300 ;;
13201314 # Make sure to match an already-canonicalized machine name.
13211315 ;;
13221316 *)
1323 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1317 echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
13241318 exit 1
13251319 ;;
13261320 esac
13281322 # Here we canonicalize certain aliases for manufacturers.
13291323 case $basic_machine in
13301324 *-digital*)
1331 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1325 basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
13321326 ;;
13331327 *-commodore*)
1334 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1328 basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
13351329 ;;
13361330 *)
13371331 ;;
13421336 if [ x"$os" != x"" ]
13431337 then
13441338 case $os in
1345 # First match some system type aliases
1346 # that might get confused with valid system types.
1339 # First match some system type aliases that might get confused
1340 # with valid system types.
13471341 # -solaris* is a basic system type, with this one exception.
13481342 -auroraux)
13491343 os=-auroraux
13541348 -solaris)
13551349 os=-solaris2
13561350 ;;
1357 -svr4*)
1358 os=-sysv4
1359 ;;
13601351 -unixware*)
13611352 os=-sysv4.2uw
13621353 ;;
13631354 -gnu/linux*)
13641355 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
13651356 ;;
1366 # First accept the basic system types.
1357 # es1800 is here to avoid being matched by es* (a different OS)
1358 -es1800*)
1359 os=-ose
1360 ;;
1361 # Now accept the basic system types.
13671362 # The portable systems comes first.
1368 # Each alternative MUST END IN A *, to match a version number.
1363 # Each alternative MUST end in a * to match a version number.
13691364 # -sysv* is not here because it comes later, after sysvr4.
13701365 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
13711366 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
13721367 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
13731368 | -sym* | -kopensolaris* | -plan9* \
13741369 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1375 | -aos* | -aros* \
1370 | -aos* | -aros* | -cloudabi* | -sortix* \
13761371 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
13771372 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1378 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1379 | -bitrig* | -openbsd* | -solidbsd* \
1373 | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
1374 | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
13801375 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
13811376 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
13821377 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1383 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1384 | -chorusos* | -chorusrdb* | -cegcc* \
1378 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \
1379 | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
13851380 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1386 | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1381 | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
13871382 | -linux-newlib* | -linux-musl* | -linux-uclibc* \
13881383 | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
1389 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1384 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
13901385 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
13911386 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
13921387 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1393 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1388 | -morphos* | -superux* | -rtmk* | -windiss* \
13941389 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1395 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
1390 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
1391 | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
1392 | -midnightbsd*)
13961393 # Remember, each alternative MUST END IN *, to match a version number.
13971394 ;;
13981395 -qnx*)
14091406 -nto*)
14101407 os=`echo $os | sed -e 's|nto|nto-qnx|'`
14111408 ;;
1412 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1413 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1409 -sim | -xray | -os68k* | -v88r* \
1410 | -windows* | -osx | -abug | -netware* | -os9* \
14141411 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
14151412 ;;
14161413 -mac*)
1417 os=`echo $os | sed -e 's|mac|macos|'`
1414 os=`echo "$os" | sed -e 's|mac|macos|'`
14181415 ;;
14191416 -linux-dietlibc)
14201417 os=-linux-dietlibc
14231420 os=`echo $os | sed -e 's|linux|linux-gnu|'`
14241421 ;;
14251422 -sunos5*)
1426 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1423 os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
14271424 ;;
14281425 -sunos6*)
1429 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1426 os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
14301427 ;;
14311428 -opened*)
14321429 os=-openedition
14371434 -wince*)
14381435 os=-wince
14391436 ;;
1440 -osfrose*)
1441 os=-osfrose
1442 ;;
1443 -osf*)
1444 os=-osf
1445 ;;
14461437 -utek*)
14471438 os=-bsd
14481439 ;;
14671458 -nova*)
14681459 os=-rtmk-nova
14691460 ;;
1470 -ns2 )
1461 -ns2)
14711462 os=-nextstep2
14721463 ;;
14731464 -nsk*)
14891480 -oss*)
14901481 os=-sysv3
14911482 ;;
1492 -svr4)
1483 -svr4*)
14931484 os=-sysv4
14941485 ;;
14951486 -svr3)
15041495 -ose*)
15051496 os=-ose
15061497 ;;
1507 -es1800*)
1508 os=-ose
1509 ;;
1510 -xenix)
1511 os=-xenix
1512 ;;
15131498 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
15141499 os=-mint
15151500 ;;
1516 -aros*)
1517 os=-aros
1518 ;;
15191501 -zvmoe)
15201502 os=-zvmoe
15211503 ;;
15221504 -dicos*)
15231505 os=-dicos
15241506 ;;
1507 -pikeos*)
1508 # Until real need of OS specific support for
1509 # particular features comes up, bare metal
1510 # configurations are quite functional.
1511 case $basic_machine in
1512 arm*)
1513 os=-eabi
1514 ;;
1515 *)
1516 os=-elf
1517 ;;
1518 esac
1519 ;;
15251520 -nacl*)
1521 ;;
1522 -ios)
15261523 ;;
15271524 -none)
15281525 ;;
15291526 *)
15301527 # Get rid of the `-' at the beginning of $os.
15311528 os=`echo $os | sed 's/[^-]*-//'`
1532 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1529 echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
15331530 exit 1
15341531 ;;
15351532 esac
16191616 sparc-* | *-sun)
16201617 os=-sunos4.1.1
16211618 ;;
1619 pru-*)
1620 os=-elf
1621 ;;
16221622 *-be)
16231623 os=-beos
16241624 ;;
1625 *-haiku)
1626 os=-haiku
1627 ;;
16281625 *-ibm)
16291626 os=-aix
16301627 ;;
16641661 m88k-omron*)
16651662 os=-luna
16661663 ;;
1667 *-next )
1664 *-next)
16681665 os=-nextstep
16691666 ;;
16701667 *-sequent)
16781675 ;;
16791676 i370-*)
16801677 os=-mvs
1681 ;;
1682 *-next)
1683 os=-nextstep3
16841678 ;;
16851679 *-gould)
16861680 os=-sysv
17911785 vendor=stratus
17921786 ;;
17931787 esac
1794 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1788 basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
17951789 ;;
17961790 esac
17971791
1798 echo $basic_machine$os
1792 echo "$basic_machine$os"
17991793 exit
18001794
18011795 # Local variables:
1802 # eval: (add-hook 'write-file-hooks 'time-stamp)
1796 # eval: (add-hook 'write-file-functions 'time-stamp)
18031797 # time-stamp-start: "timestamp='"
18041798 # time-stamp-format: "%:y-%02m-%02d"
18051799 # time-stamp-end: "'"
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for xman 1.1.4.
2 # Generated by GNU Autoconf 2.69 for xman 1.1.5.
33 #
4 # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
4 # Report bugs to <https://gitlab.freedesktop.org/xorg/app/xman/issues>.
55 #
66 #
77 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
266266 $as_echo "$0: be upgraded to zsh 4.3.4 or later."
267267 else
268268 $as_echo "$0: Please tell bug-autoconf@gnu.org and
269 $0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
269 $0: https://gitlab.freedesktop.org/xorg/app/xman/issues
270270 $0: about your system, including any error possibly output
271271 $0: before this message. Then install a modern shell, or
272272 $0: manually run the script under such a shell if you do
580580 # Identity of this package.
581581 PACKAGE_NAME='xman'
582582 PACKAGE_TARNAME='xman'
583 PACKAGE_VERSION='1.1.4'
584 PACKAGE_STRING='xman 1.1.4'
585 PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
583 PACKAGE_VERSION='1.1.5'
584 PACKAGE_STRING='xman 1.1.5'
585 PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/app/xman/issues'
586586 PACKAGE_URL=''
587587
588588 ac_unique_file="Makefile.am"
632632 XMAN_LIBS
633633 XMAN_CFLAGS
634634 HELPDIR
635 MANDB
635636 GROFF
636637 MAN_SUBSTS
637638 XORG_MAN_PAGE
657658 build_cpu
658659 build
659660 INSTALL_CMD
661 PKG_CONFIG_LIBDIR
662 PKG_CONFIG_PATH
660663 PKG_CONFIG
661664 CHANGELOG_CMD
662665 STRICT_CFLAGS
770773 CPPFLAGS
771774 CPP
772775 PKG_CONFIG
776 PKG_CONFIG_PATH
777 PKG_CONFIG_LIBDIR
773778 XMAN_CFLAGS
774779 XMAN_LIBS
775780 APPDEFS_CFLAGS
13141319 # Omit some internal or obsolete options to make the list less imposing.
13151320 # This message is too long to be a string in the A/UX 3.1 sh.
13161321 cat <<_ACEOF
1317 \`configure' configures xman 1.1.4 to adapt to many kinds of systems.
1322 \`configure' configures xman 1.1.5 to adapt to many kinds of systems.
13181323
13191324 Usage: $0 [OPTION]... [VAR=VALUE]...
13201325
13841389
13851390 if test -n "$ac_init_help"; then
13861391 case $ac_init_help in
1387 short | recursive ) echo "Configuration of xman 1.1.4:";;
1392 short | recursive ) echo "Configuration of xman 1.1.5:";;
13881393 esac
13891394 cat <<\_ACEOF
13901395
14301435 you have headers in a nonstandard directory <include dir>
14311436 CPP C preprocessor
14321437 PKG_CONFIG path to pkg-config utility
1438 PKG_CONFIG_PATH
1439 directories to add to pkg-config's search path
1440 PKG_CONFIG_LIBDIR
1441 path overriding pkg-config's built-in search path
14331442 XMAN_CFLAGS C compiler flags for XMAN, overriding pkg-config
14341443 XMAN_LIBS linker flags for XMAN, overriding pkg-config
14351444 APPDEFS_CFLAGS
14401449 Use these variables to override the choices made by `configure' or to help
14411450 it to find libraries and programs with nonstandard names/locations.
14421451
1443 Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
1452 Report bugs to <https://gitlab.freedesktop.org/xorg/app/xman/issues>.
14441453 _ACEOF
14451454 ac_status=$?
14461455 fi
15031512 test -n "$ac_init_help" && exit $ac_status
15041513 if $ac_init_version; then
15051514 cat <<\_ACEOF
1506 xman configure 1.1.4
1515 xman configure 1.1.5
15071516 generated by GNU Autoconf 2.69
15081517
15091518 Copyright (C) 2012 Free Software Foundation, Inc.
18271836 This file contains any messages produced by compilers while
18281837 running configure, to aid debugging if configure makes a mistake.
18291838
1830 It was created by xman $as_me 1.1.4, which was
1839 It was created by xman $as_me 1.1.5, which was
18311840 generated by GNU Autoconf 2.69. Invocation command line was
18321841
18331842 $ $0 $@
26952704
26962705 # Define the identity of the package.
26972706 PACKAGE='xman'
2698 VERSION='1.1.4'
2707 VERSION='1.1.5'
26992708
27002709
27012710 cat >>confdefs.h <<_ACEOF
44434452
44444453
44454454
4455
4456
4457
4458
4459
44464460 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
44474461 if test -n "$ac_tool_prefix"; then
44484462 # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
45554569 $as_echo "no" >&6; }
45564570 PKG_CONFIG=""
45574571 fi
4558
45594572 fi
45604573 # Make sure we can run config.sub.
45614574 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
1057010583
1057110584 if test x$FILE_MAN_SUFFIX = x ; then
1057210585 case $host_os in
10573 solaris*) FILE_MAN_SUFFIX=4 ;;
10574 *) FILE_MAN_SUFFIX=5 ;;
10586 # Solaris 2.0 - 11 use SysV man page sections
10587 solaris2.?|solaris2.1[01]) FILE_MAN_SUFFIX=4 ;;
10588 *) FILE_MAN_SUFFIX=5 ;;
1057510589 esac
1057610590 fi
1057710591 if test x$FILE_MAN_DIR = x ; then
1058010594
1058110595 if test x$MISC_MAN_SUFFIX = x ; then
1058210596 case $host_os in
10583 solaris*) MISC_MAN_SUFFIX=5 ;;
10584 *) MISC_MAN_SUFFIX=7 ;;
10597 # Solaris 2.0 - 11 use SysV man page sections
10598 solaris2.?|solaris2.1[01]) MISC_MAN_SUFFIX=5 ;;
10599 *) MISC_MAN_SUFFIX=7 ;;
1058510600 esac
1058610601 fi
1058710602 if test x$MISC_MAN_DIR = x ; then
1059010605
1059110606 if test x$DRIVER_MAN_SUFFIX = x ; then
1059210607 case $host_os in
10593 solaris*) DRIVER_MAN_SUFFIX=7 ;;
10594 *) DRIVER_MAN_SUFFIX=4 ;;
10608 # Solaris 2.0 - 11 use SysV man page sections
10609 solaris2.?|solaris2.1[01]) DRIVER_MAN_SUFFIX=7 ;;
10610 *) DRIVER_MAN_SUFFIX=4 ;;
1059510611 esac
1059610612 fi
1059710613 if test x$DRIVER_MAN_DIR = x ; then
1060010616
1060110617 if test x$ADMIN_MAN_SUFFIX = x ; then
1060210618 case $host_os in
10603 solaris*) ADMIN_MAN_SUFFIX=1m ;;
10604 *) ADMIN_MAN_SUFFIX=8 ;;
10619 # Solaris 2.0 - 11 use SysV man page sections
10620 solaris2.?|solaris2.1[01]) ADMIN_MAN_SUFFIX=1m ;;
10621 *) ADMIN_MAN_SUFFIX=8 ;;
1060510622 esac
1060610623 fi
1060710624 if test x$ADMIN_MAN_DIR = x ; then
1072710744
1072810745 fi
1072910746
10747 # Extract the first word of "mandb", so it can be a program name with args.
10748 set dummy mandb; ac_word=$2
10749 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10750 $as_echo_n "checking for $ac_word... " >&6; }
10751 if ${ac_cv_prog_MANDB+:} false; then :
10752 $as_echo_n "(cached) " >&6
10753 else
10754 if test -n "$MANDB"; then
10755 ac_cv_prog_MANDB="$MANDB" # Let the user override the test.
10756 else
10757 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10758 for as_dir in $PATH
10759 do
10760 IFS=$as_save_IFS
10761 test -z "$as_dir" && as_dir=.
10762 for ac_exec_ext in '' $ac_executable_extensions; do
10763 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
10764 ac_cv_prog_MANDB="yes"
10765 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10766 break 2
10767 fi
10768 done
10769 done
10770 IFS=$as_save_IFS
10771
10772 test -z "$ac_cv_prog_MANDB" && ac_cv_prog_MANDB="no"
10773 fi
10774 fi
10775 MANDB=$ac_cv_prog_MANDB
10776 if test -n "$MANDB"; then
10777 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANDB" >&5
10778 $as_echo "$MANDB" >&6; }
10779 else
10780 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10781 $as_echo "no" >&6; }
10782 fi
10783
10784
10785 if test x"$MANDB" = xyes; then
10786
10787 $as_echo "#define HAVE_MANDB 1" >>confdefs.h
10788
10789 fi
10790
1073010791 for ac_func in mkstemp
1073110792 do :
1073210793 ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp"
1079310854 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1079410855 test $ac_status = 0; }; then
1079510856 pkg_cv_XMAN_CFLAGS=`$PKG_CONFIG --cflags "xproto >= 7.0.17 xaw7 xt" 2>/dev/null`
10857 test "x$?" != "x0" && pkg_failed=yes
1079610858 else
1079710859 pkg_failed=yes
1079810860 fi
1080910871 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1081010872 test $ac_status = 0; }; then
1081110873 pkg_cv_XMAN_LIBS=`$PKG_CONFIG --libs "xproto >= 7.0.17 xaw7 xt" 2>/dev/null`
10874 test "x$?" != "x0" && pkg_failed=yes
1081210875 else
1081310876 pkg_failed=yes
1081410877 fi
1081910882
1082010883
1082110884 if test $pkg_failed = yes; then
10885 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10886 $as_echo "no" >&6; }
1082210887
1082310888 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1082410889 _pkg_short_errors_supported=yes
1082610891 _pkg_short_errors_supported=no
1082710892 fi
1082810893 if test $_pkg_short_errors_supported = yes; then
10829 XMAN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xproto >= 7.0.17 xaw7 xt" 2>&1`
10894 XMAN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xproto >= 7.0.17 xaw7 xt" 2>&1`
1083010895 else
10831 XMAN_PKG_ERRORS=`$PKG_CONFIG --print-errors "xproto >= 7.0.17 xaw7 xt" 2>&1`
10896 XMAN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xproto >= 7.0.17 xaw7 xt" 2>&1`
1083210897 fi
1083310898 # Put the nasty error message in config.log where it belongs
1083410899 echo "$XMAN_PKG_ERRORS" >&5
1084210907
1084310908 Alternatively, you may set the environment variables XMAN_CFLAGS
1084410909 and XMAN_LIBS to avoid the need to call pkg-config.
10845 See the pkg-config man page for more details.
10846 " "$LINENO" 5
10910 See the pkg-config man page for more details." "$LINENO" 5
1084710911 elif test $pkg_failed = untried; then
10912 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10913 $as_echo "no" >&6; }
1084810914 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1084910915 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1085010916 as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
1086210928 XMAN_LIBS=$pkg_cv_XMAN_LIBS
1086310929 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1086410930 $as_echo "yes" >&6; }
10865 :
10931
1086610932 fi
1086710933
1086810934
1102711093 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1102811094 test $ac_status = 0; }; then
1102911095 pkg_cv_APPDEFS_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null`
11096 test "x$?" != "x0" && pkg_failed=yes
1103011097 else
1103111098 pkg_failed=yes
1103211099 fi
1104311110 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1104411111 test $ac_status = 0; }; then
1104511112 pkg_cv_APPDEFS_LIBS=`$PKG_CONFIG --libs "xt" 2>/dev/null`
11113 test "x$?" != "x0" && pkg_failed=yes
1104611114 else
1104711115 pkg_failed=yes
1104811116 fi
1105311121
1105411122
1105511123 if test $pkg_failed = yes; then
11124 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11125 $as_echo "no" >&6; }
1105611126
1105711127 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1105811128 _pkg_short_errors_supported=yes
1106011130 _pkg_short_errors_supported=no
1106111131 fi
1106211132 if test $_pkg_short_errors_supported = yes; then
11063 APPDEFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xt" 2>&1`
11133 APPDEFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xt" 2>&1`
1106411134 else
11065 APPDEFS_PKG_ERRORS=`$PKG_CONFIG --print-errors "xt" 2>&1`
11135 APPDEFS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xt" 2>&1`
1106611136 fi
1106711137 # Put the nasty error message in config.log where it belongs
1106811138 echo "$APPDEFS_PKG_ERRORS" >&5
1107611146
1107711147 Alternatively, you may set the environment variables APPDEFS_CFLAGS
1107811148 and APPDEFS_LIBS to avoid the need to call pkg-config.
11079 See the pkg-config man page for more details.
11080 " "$LINENO" 5
11149 See the pkg-config man page for more details." "$LINENO" 5
1108111150 elif test $pkg_failed = untried; then
11151 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11152 $as_echo "no" >&6; }
1108211153 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1108311154 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1108411155 as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
1109611167 APPDEFS_LIBS=$pkg_cv_APPDEFS_LIBS
1109711168 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1109811169 $as_echo "yes" >&6; }
11099 :
11170
1110011171 fi
1110111172 xt_appdefaultdir=`$PKG_CONFIG --variable=appdefaultdir xt`
1110211173
1164911720 # report actual input values of CONFIG_FILES etc. instead of their
1165011721 # values after options handling.
1165111722 ac_log="
11652 This file was extended by xman $as_me 1.1.4, which was
11723 This file was extended by xman $as_me 1.1.5, which was
1165311724 generated by GNU Autoconf 2.69. Invocation command line was
1165411725
1165511726 CONFIG_FILES = $CONFIG_FILES
1170911780 Configuration commands:
1171011781 $config_commands
1171111782
11712 Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>."
11783 Report bugs to <https://gitlab.freedesktop.org/xorg/app/xman/issues>."
1171311784
1171411785 _ACEOF
1171511786 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1171611787 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1171711788 ac_cs_version="\\
11718 xman config.status 1.1.4
11789 xman config.status 1.1.5
1171911790 configured by $0, generated by GNU Autoconf 2.69,
1172011791 with options \\"\$ac_cs_config\\"
1172111792
2222
2323 # Initialize Autoconf
2424 AC_PREREQ([2.60])
25 AC_INIT([xman], [1.1.4],
26 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xman])
25 AC_INIT([xman], [1.1.5],
26 [https://gitlab.freedesktop.org/xorg/app/xman/issues], [xman])
2727 AC_CONFIG_SRCDIR([Makefile.am])
2828 AC_CONFIG_HEADERS([config.h])
2929
4141 AC_CHECK_PROG([GROFF], [groff], [found], [missing])
4242 if test "x$GROFF" = "xfound" ; then
4343 AC_DEFINE([HAS_GROFF], 1, [Define to 1 if you have the groff package.])
44 fi
45
46 AC_CHECK_PROG([MANDB], [mandb], [yes], [no])
47 if test x"$MANDB" = xyes; then
48 AC_DEFINE([HAVE_MANDB], 1, [Define if the man implementation is man-db])
4449 fi
4550
4651 AC_CHECK_FUNCS([mkstemp])
8282 * The resource that we absolutely need.
8383 */
8484
85 static char *fallback_resources[] = {
85 static String fallback_resources[] = {
8686 "Xman*quitButton.translations: #override \\n <Btn1Up>: Quit() reset()",
8787 "Xman*helpButton.sensitive: FALSE",
8888 "Xman*manpageButton.sensitive: FALSE",
197197 LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
198198 LTLIBOBJS = @LTLIBOBJS@
199199 MAKEINFO = @MAKEINFO@
200 MANDB = @MANDB@
200201 MAN_SUBSTS = @MAN_SUBSTS@
201202 MISC_MAN_DIR = @MISC_MAN_DIR@
202203 MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
211212 PACKAGE_VERSION = @PACKAGE_VERSION@
212213 PATH_SEPARATOR = @PATH_SEPARATOR@
213214 PKG_CONFIG = @PKG_CONFIG@
215 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
216 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
214217 SED = @SED@
215218 SET_MAKE = @SET_MAKE@
216219 SHELL = @SHELL@
151151 o(o) Old
152152
153153 .fi
154 Xman will read any section that is of the from \fIman<character>\fP, where
154 Xman will read any section that is of the form \fIman<character>\fP, where
155155 <character> is an upper or lower case letter (they are treated distinctly) or
156156 a numeral (0-9). Be warned, however, that man(__appmansuffix__) and
157157 catman(__adminmansuffix__) will not search directories that are non-standard.
209209
210210 ManpageGlobals *InitPsuedoGlobals(void);
211211 Widget CreateManpage(FILE * file);
212 void CreateManpageWidget(ManpageGlobals * man_globals, char *name,
212 void CreateManpageWidget(ManpageGlobals * man_globals, String name,
213213 Boolean full_instance);
214214 void FormUpWidgets(Widget parent,
215215 const char **full_size, const char **half_size);
288288 int Width(Widget);
289289 int Height(Widget);
290290 int BorderWidth(Widget);
291 char *Name(Widget);
660660 ConstructCommand(char *cmdbuf, const char *path,
661661 const char *filename, const char *tempfile)
662662 {
663 #ifdef HAVE_MANDB
664 int used = snprintf(cmdbuf, BUFSIZ, "man -l %s > %s 2>/dev/null",
665 filename, tempfile);
666 if (used >= BUFSIZ - 1)
667 return FALSE;
668 return TRUE;
669 #else
663670 /* The original code did the following to produce a command line:
664671 * sprintf(cmdbuf,"cd %s ; %s %s %s > %s %s", path, TBL,
665672 * filename, FORMAT, man_globals->tempfile, "2> /dev/null");
782789 return (FALSE);
783790
784791 return (TRUE);
792 #endif /* man-db */
785793 }
786794 #endif /* HANDLE_ROFFSEQ */
787795
7777 {
7878 return ((int) w->core.border_width);
7979 }
80
81 /*
82 * These functions have got to be able to get at the widget tree, I don't see
83 * any way around this one.
84 */
85
86 /* Function Name: Name
87 * Description: This function returns the correct popup child
88 * Arguments: w - widget
89 * Returns: the popup child.
90 */
91
92 char *
93 Name(Widget w)
94 {
95 return (w->core.name);
96 }