Projects
openEuler:Mainline
libXft
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
_service:tar_scm:libXft.spec
Changed
@@ -1,10 +1,10 @@ Name: libXft -Version: 2.3.4 +Version: 2.3.7 Release: 1 Summary: X FreeType library License: MIT URL: https://xorg.freedesktop.org/ -Source0: https://xorg.freedesktop.org/releases/individual/lib/%{name}-%{version}.tar.bz2 +Source0: https://xorg.freedesktop.org/releases/individual/lib/%{name}-%{version}.tar.gz BuildRequires: xorg-x11-util-macros autoconf automake libtool BuildRequires: freetype-devel fontconfig-devel pkgconfig(xrender) @@ -54,9 +54,15 @@ %files help %defattr(-,root,root) %doc README.md ChangeLog -%{_mandir}/man3/Xft.3.gz +%{_mandir}/man3/Xft*.3* %changelog +* Fri Feb 03 2023 zhouwenpei <zhouwenpei1@h-partners.com> - 2.3.7-1 +- update to 2.3.7 + +* Wed Oct 26 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 2.3.4-2 +- Rebuild for next release + * Wed Dec 1 2021 dongyuzhen <dongyuzhen@huawei.com> - 2.3.4-1 - update to 2.3.4
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="scm">git</param> <param name="url">git@gitee.com:src-openeuler/libXft.git</param> - <param name="revision">45bdc9c975e9f01ae6475739f0de9259dff234fa</param> + <param name="revision">master</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/ChangeLog -> _service:tar_scm:libXft-2.3.7.tar.gz/ChangeLog
Changed
@@ -1,3 +1,589 @@ +commit 1463255cd4f537baabf8f2c65270e4924d4ed656 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Tue Nov 15 03:39:55 2022 -0500 + + libXft 2.3.7 + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 4f704b700beb6486213e1096b0e702f4a9067184 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon Nov 14 18:42:47 2022 -0500 + + libxft issue #16 + + https://gitlab.freedesktop.org/xorg/lib/libxft/-/issues/16 + + Stack gets smashed in fonts with colors when calling XftGlyphRender + + BGRA changes made incorrect comparison for local vs allocated + buffer in XftGlyphSpecRender + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit de4592a18bba0bfc88232f6f4ecad7c2fa5e616e +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sun Nov 13 05:56:12 2022 -0500 + + fix compiler warning + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 98e27ba4b2c3a4825a3497cd481992374a9c9e98 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sat Nov 12 12:48:08 2022 -0500 + + libxft issue #15 + + https://gitlab.freedesktop.org/xorg/lib/libxft/-/issues/15 + + XftFontLoadGlyphs for mono font returns wrong info in extents from + XftTextExtentsUtf8 for variable chars + + Patch by Scott Mcdermott, based on + + https://github.com/googlefonts/Inconsolata/issues/42 + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 6d246534bd156e5cb901b2cc9e2b9d473cf73506 +Author: ericLemanissier <eric.lemanissier@gmail.com> +Date: Fri Sep 23 07:59:55 2022 +0000 + + stdint.h header is needed for SIZE_MAX + +commit 7d3bcd3b9ae3ffbfcd4f31c8f1db2254df90bc33 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sat Sep 10 09:59:49 2022 -0400 + + libXft 2.3.6 + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 5e0ed11a43e37e50ba0937beaa40851c2d864981 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Wed Sep 7 19:25:06 2022 -0400 + + fix gcc12 warning about malloc size + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit ab2df0af3dc7c594d44ccccfa0e7ddeeefb1e70e +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Wed Sep 7 19:21:38 2022 -0400 + + revised fix for gcc 12 compiler warnings in xftextent.c + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 95284856783b824a714b7506762f4adce3bb17ce +Author: Adam Sampson <ats@offog.org> +Date: Wed Sep 7 00:31:10 2022 +0100 + + Fix length check in XftTextExtents*. + + Commit 06a3c0ab6520e368ac936cb1ef172f19957db0fa added length checks of + the form "if (len <= 0) return;" to various Xft functions. However, + while rendering an empty string is equivalent to doing nothing, asking + for the extents of an empty string isn't -- it still needs to fill in + the extents structure. This broke text rendering in some applications + (e.g. xpdf's Motif GUI). + + Check for len < 0 in XftTextExtents* instead. + +commit c6309d4c8fcb5f4879cc25cf81b649f5eb665413 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon Sep 5 15:23:18 2022 -0400 + + libXft 2.3.5 + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 4356b583f8c23575a9ac25d49e7d224930107ef5 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sat Jul 9 12:25:28 2022 -0400 + + update copyright notice + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 1f610967afc221b296036849d0c17aea495ab50c +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sat Jul 9 12:23:57 2022 -0400 + + add a null-pointer check + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 16b87600d545b7c0e8f4b6629f553eb235f19f0c +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sat Jul 9 09:58:58 2022 -0400 + + fix new gcc warnings + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit a87be5ae94148f163a7b009df3d41a26a478d800 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sat Jul 9 09:28:29 2022 -0400 + + build-fix + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 3ca7a7c375a8c022c068e2534c5a6861e547eaef +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sat Jul 9 09:04:18 2022 -0400 + + merge changes by Christian Werner + + see note in libXft merge-request #1 at #note_1222314 + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit c53a1bc27c11e0c3cdf54e2beffd6cc220703a0b +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon May 30 20:11:14 2022 -0400 + + cleanup new compiler warnings + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 68c6a862409028d9b62ca601df02f345d60f969e +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon May 30 18:30:55 2022 -0400 + + build-fix for c89 + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 6a08279ee80dbd1a226592d7f18c862c2e4a7d3a +Author: Maxime Coste <mawww@kakoune.org> +Date: Tue Oct 22 22:46:49 2019 +1100 + + Add support for BGRA glyphs display and scaling + + Display is done using an XRender Picture, as XRender + glyphs are incompatible with BGRA rendering due to + their use of the glyph bitmap as a mask. + + Scaling is done by averaging all relevant pixel, which gives + much better result than nearest pixel sampling while staying + simple enough and not too computationally expensive. + + This enables color emoji rendering support. + + Fixes: #6 + + Signed-off-by: Maxime Coste <mawww@kakoune.org> + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 2cbb9597e0b10d87fa9fc506910f69b9199320f0 +Author: Maxime Coste <mawww@kakoune.org> +Date: Thu Jan 28 20:05:13 2021 +1100 + + Introduce a _XftCompositeText helper function + + Dispatch to XRenderCompositeText{8,16,32} based off the given width. + + Signed-off-by: Maxime Coste <mawww@kakoune.org> + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit cac2fd528dd0ba9ed2308f6dda4598993c51cf64 +Author: Maxime Coste <mawww@kakoune.org> +Date: Thu Jan 28 19:59:10 2021 +1100 + + Introduce a _XftCompositeString helper function + + Dispatch to XRenderCompositeString{8,16,32} based off the given width. + + Signed-off-by: Maxime Coste <mawww@kakoune.org> + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 10b53d1fa37615e81d1e3b6e4d2d2e25e4342c15 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Tue Jul 5 20:13:42 2022 -0400 + + errata (cppcheck, clang --analyze, manpage credit) + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 6fc03611ed2b103b6b5a2f0c6b610087879325e4 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Tue Jul 5 04:14:07 2022 -0400 + + document new features for glyph memory-tracking + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 36a8474813aba2be263f9de88ad9adfe85c0daf1 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon Jul 4 20:08:58 2022 -0400 + + improve glyph management by relinking to unload least-recently used glyphs + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 01d44d70e9bd770ac365c88e09c5e432d2e517ad +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon Jul 4 18:31:24 2022 -0400 + + when tracking glyph memory usage, unload the oldest glyph rather than randomly + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 698e205b657f9192df07962e7823a2eae80e1c17 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon Jul 4 18:10:32 2022 -0400 + + cppcheck/gcc-stricter warnings about printf-formats and operator precedence + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 949295d665b030eb451fa590940293ada84c9bfe +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon Jul 4 15:30:24 2022 -0400 + + fix delinkage of last glyph in font, improve debug-trace + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 058d7237068b2a698098c68c171bbbfd04a51b48 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon Jul 4 07:56:46 2022 -0400 + + add asserts (to help with debugging), update copyright notices + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 318c6984baba0ea02147dc72a97e331234b6baf7 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon Jul 4 07:41:12 2022 -0400 + + refactor _XftFontUncacheGlyph, separate the two types of loop for readability + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 33c1e1e3a5c08b690e145cc193d52fc13869af7b +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sun Jul 3 20:53:23 2022 -0400 + + validate linked-list updates with _XftValidateGlyphUsage + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 114db90eac2c0f32f6b662d916a5af6a8990bf36 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Fri Jul 1 04:25:10 2022 -0400 + + add option for tracking glyph memory-usage on a linked list + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 442bbb084a1316aa6b25b29e17889bc71c1e4235 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon Jun 27 03:54:58 2022 -0400 + + add "trackmemusage" property to use in improved _XftFontUncacheGlyph + + The linear search used for randomly selecting a glyph to discard is + inefficient. This commit provides for a doubly-linked list which + could be maintained by the library to quickly discard the least + recently used glyph. + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit d4a554c9795b109085ec31eedacba6532c18d802 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Fri Jun 24 20:26:31 2022 -0400 + + reduce clutter with macros for allocating arrays + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 42c6616499e6ca193a0b764576a6ed8650dd3d7b +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Tue Jun 21 20:29:05 2022 -0400 + + add debugging trace for XftDefaultSet() + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 908a5e43bc37ea3b80985683369a27b4e607aecf +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon Jun 13 15:59:12 2022 -0400 + + add section of functions managing XftColor + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 5f809521ad2d1080710670602619582de8fd6b0c +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sat Jun 11 10:55:40 2022 -0400 + + add a section on the XFT_DEBUG environment variable + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 5a1768ac1071bd05a731d9e744dbf8bb20ccf2b0 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sat Jun 11 10:24:26 2022 -0400 + + add a table of the "families" of functions + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 936bbafb612c5fb2ac838e94fb4e9a92da1d600c +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sat Jun 11 09:50:28 2022 -0400 + + document XftGlyphFontSpecRender() and related functions. + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit c76339229144ab6342315a27ee67a7ade1f43464 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Fri Jun 10 10:08:10 2022 -0400 + + reduce clutter for external data-types by documenting them one time + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 58b1fed139c6dfd1a20a8b6090181f43aaffcc59 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Fri Jun 10 09:27:36 2022 -0400 + + document the clipping-functions + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 73e1c4dc886079e87b0aaa6e3b6fa468b9ba2af2 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Wed Jun 8 20:11:25 2022 -0400 + + add section on manipulating font data + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 5ac7ca85151515f5f03f5c0389f96f202e9cd6bb +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Wed Jun 8 04:27:48 2022 -0400 + + add section on manipulating font patterns + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 57892d1b735dcb5e019790b271df79d7a4b89e61 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Wed Jun 8 04:01:50 2022 -0400 + + remove remaining internal prototypes for obsolete xftcompat.c + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 81944f3796dc1cc1a9529233cec3f3b2c2d546b3 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Wed Jun 8 03:52:47 2022 -0400 + + move prototype for XftNameUnparse to Xft.h + + This entrypoint has "always" been exported, but not declared publicly. + It is used for debugging in xterm. + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 5b191b7db9e6a785ed566c82419b11540c240423 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Tue Jun 7 18:45:55 2022 -0400 + + document XftFontOpenXlfd and XftXlfdParse + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit b22b2b73ed1c9ed216b98ec33c3258030a34d0d2 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Tue Jun 7 04:18:48 2022 -0400 + + add overview for text-extents section + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit c3fc93be50d2f7e5c197afd47928d9338fca1618 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon Jun 6 20:18:07 2022 -0400 + + change data-types to subsections to help with readability + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 04d5b339f42d90f51b9294552558fae181bc48d8 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon Jun 6 04:14:55 2022 -0400 + + consistently bold "Xft" + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 18c74d39dd202e385d57415007ba6e803ac6f89a +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sun Jun 5 20:28:07 2022 -0400 + + initial draft of initialization-functions documentation + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 48eb5a7cb0a7aaacfcb77eba035c5c47d082ab88 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sun Jun 5 12:25:38 2022 -0400 + + amend rule for creating manpage aliases + + eliminate too-specific gzip step, rely upon packaging system to do this. + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 765e2d2154946a6a9422c0470d6e57fbaf64182b +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sat Jun 4 06:15:39 2022 -0400 + + cleanup manpage comments + + cleanup comments used as reminders to mention functions, + leaving comments used as reminders to add new paragraphs. + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 48d2353317db2b16b68633c88d5ecd4a583b234e +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Thu Jun 2 20:35:28 2022 -0400 + + install man-aliases for all of the exported symbols + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 724978961ff3b6e4f5043be07160487bc681fda1 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Thu Jun 2 18:37:09 2022 -0400 + + corrected prototypes in manpage, matching Xft.h + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 4591cdd1c0f0c8afb8eac9cc908aa7c7d141dc6d +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Thu Jun 2 18:28:07 2022 -0400 + + reuse macros from Xcursor.man to fix ragged layout of typedefs and prototypes + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 06a3c0ab6520e368ac936cb1ef172f19957db0fa +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon May 30 15:15:11 2022 -0400 + + fix warnings by gcc 11; check if length <= zero + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 4342ea4b4b87790004f6883a0d5b36fdff7c0443 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon May 30 10:39:39 2022 -0400 + + formatting fix, for clarity (no object change) + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit b4ed18f1dc398ea39d9f76da556306fe02f26c97 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon May 30 09:23:37 2022 -0400 + + quiet compiler warning with cast + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit f2583758d3e5c65f372387d1c67433856682c3fb +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Mon May 30 09:21:28 2022 -0400 + + quiet compiler warning with cast + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit c3ad9cf5b11772fbc9ff4dd793f0a7e897b5df5a +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sun May 29 20:37:26 2022 -0400 + + change the internal memory-allocator to use size_t + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit a9ce40d7f51dd20533d25e2a252afb1d09194d3f +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sun May 29 19:44:16 2022 -0400 + + quiet warnings with casts + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 4edfca0cb839e51bca29f5c382c311c08db49b33 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sun May 29 18:26:13 2022 -0400 + + promote font->num_glyphs to FT_UInt or Glyph to fix warnings + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit ef896b2106fa171707a4087be506259f578ff3a5 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sun May 29 18:05:10 2022 -0400 + + fix missing-initializer warning + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 768f43c04b5587d3b49ccd2d2f0133630c6a093b +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sun May 29 17:51:07 2022 -0400 + + cleanup warnings about discarding const + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit 4dadf0ed93624a09b4a2f7403b79103b50681391 +Author: Thomas E. Dickey <dickey@invisible-island.net> +Date: Sun May 29 17:40:25 2022 -0400 + + quiet unused-parameter warnings with _X_UNUSED + + Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net> + +commit bafdc86cf32af60448db28ed03aa8230e7a14019 +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Fri Jun 3 11:32:55 2022 -0700 + + gitlab CI: add a basic build test + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + +commit 6cf073c11705cf576c3b7618a32ae121eaf14579 +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Fri Jun 3 11:24:18 2022 -0700 + + Fix spelling/wording issues + + Found by using: + codespell --builtin clear,rare,usage,informal,code,names + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + +commit 0dd423a89305e040ed20a8f449203ef091507790 +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Fri Jun 3 11:22:22 2022 -0700 + + Build xz tarballs instead of bzip2 + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + commit 98b121f22c3477b508dd17aa5db99f2ebf36ade4 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sun Aug 1 17:49:42 2021 -0700 @@ -888,7 +1474,7 @@ - Update modular Xorg version commit 0dd89a9e7ba09ed0c3f90a415b506a4ed89b91bb -Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> +Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed Jul 27 21:48:38 2005 +0000 Build system for Xft @@ -927,14 +1513,14 @@ which however is not visible outside the DDX) (Bugzilla #3268). commit 0161d08ecd543c80e5625bf63d0091dbccd95f4e -Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> +Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Fri Aug 13 19:03:15 2004 +0000 Fri Aug 13 21:01:34 2004 Soeren Sandmann <sandmann@daimi.au.dk> Fix the build commit 0641e99b21eead5aaee0c1136dd2d640028f6783 -Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> +Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Fri Aug 13 18:24:06 2004 +0000 Fri Aug 13 19:53:10 2004 Soeren Sandmann <sandmann@redhat.com>
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/Makefile.in -> _service:tar_scm:libXft-2.3.7.tar.gz/Makefile.in
Changed
@@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.16.4 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. @@ -244,9 +244,9 @@ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" -DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz GZIP_ENV = --best -DIST_TARGETS = dist-bzip2 dist-gzip +DIST_TARGETS = dist-xz dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print @@ -289,6 +289,7 @@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ @@ -676,6 +677,7 @@ dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) + dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) @@ -683,7 +685,6 @@ dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) - dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir)
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/NEWS -> _service:tar_scm:libXft-2.3.7.tar.gz/NEWS
Changed
@@ -1,12 +1,22 @@ Xft X FreeType library - Version 2.3.4 - 2021-08-01 + Version 2.3.6 + 2022-09-10 Xft version 2.1 was the first stand alone release of Xft, a library that connects X applications with the FreeType font rasterization library. Xft uses fontconfig to locate fonts so it has no configuration files. +Version 2.3.6 + +Fixes a regression in 2.3.5 for XftTextExtents* length-checks. + +Version 2.3.5 + +Add support for BGRA glyphs display and scaling +Add "trackmemusage" property to use in improved _XftFontUncacheGlyph +Revised/completed manual page; all functions are documented. + Version 2.3.4 Handle deprecation of FcNameRegisterObjectTypes API by fontconfig.
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/README.md -> _service:tar_scm:libXft-2.3.7.tar.gz/README.md
Changed
@@ -18,7 +18,7 @@ https://lists.x.org/mailman/listinfo/xorg -The master development code repository can be found at: +The primary development code repository can be found at: https://gitlab.freedesktop.org/xorg/lib/libXft
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/aclocal.m4 -> _service:tar_scm:libXft-2.3.7.tar.gz/aclocal.m4
Changed
@@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.16.4 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. @@ -20,3328 +20,10 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.)) -# Copyright (C) 2002-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN(AM_AUTOMAKE_VERSION, -am__api_version='1.16' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if($1, 1.16.4, , - AC_FATAL(Do not call $0, use AM_INIT_AUTOMAKE($1).))dnl -) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define(_AM_AUTOCONF_VERSION, ) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -AC_DEFUN(AM_SET_CURRENT_AUTOMAKE_VERSION, -AM_AUTOMAKE_VERSION(1.16.4)dnl -m4_ifndef(AC_AUTOCONF_VERSION, - m4_copy(m4_PACKAGE_VERSION, AC_AUTOCONF_VERSION))dnl -_AM_AUTOCONF_VERSION(m4_defn(AC_AUTOCONF_VERSION))) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# For projects using AC_CONFIG_AUX_DIR(foo), Autoconf sets -# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to -# '$srcdir', '$srcdir/..', or '$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is '.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN(AM_AUX_DIR_EXPAND, -AC_REQUIRE(AC_CONFIG_AUX_DIR_DEFAULT)dnl -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` -) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN(AM_CONDITIONAL, -AC_PREREQ(2.52)dnl - m4_if($1, TRUE, AC_FATAL($0: invalid condition: $1), - $1, FALSE, AC_FATAL($0: invalid condition: $1))dnl -AC_SUBST($1_TRUE)dnl -AC_SUBST($1_FALSE)dnl -_AM_SUBST_NOTMAKE($1_TRUE)dnl -_AM_SUBST_NOTMAKE($1_FALSE)dnl -m4_define(_AM_COND_VALUE_$1, $2)dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR(conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.) -fi)) - -# Copyright (C) 1999-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - - -# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN(_AM_DEPENDENCIES, -AC_REQUIRE(AM_SET_DEPDIR)dnl -AC_REQUIRE(AM_OUTPUT_DEPENDENCY_COMMANDS)dnl -AC_REQUIRE(AM_MAKE_INCLUDE)dnl -AC_REQUIRE(AM_DEP_TRACK)dnl - -m4_if($1, CC, depcc="$CC" am_compiler_list=, - $1, CXX, depcc="$CXX" am_compiler_list=, - $1, OBJC, depcc="$OBJC" am_compiler_list='gcc3 gcc', - $1, OBJCXX, depcc="$OBJCXX" am_compiler_list='gcc3 gcc', - $1, UPC, depcc="$UPC" am_compiler_list=, - $1, GCJ, depcc="$GCJ" am_compiler_list='gcc3 gcc', - depcc="$$1" am_compiler_list=) - -AC_CACHE_CHECK(dependency style of $depcc, - am_cv_$1_dependencies_compiler_type, -if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\(a-zA-Z0-9*\))$/\1/p' < ./depcomp` - fi - am__universal=false - m4_case($1, CC, - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac, - CXX, - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -) -AC_SUBST($1DEPMODE, depmode=$am_cv_$1_dependencies_compiler_type) -AM_CONDITIONAL(am__fastdep$1, - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3) -) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES. -AC_DEFUN(AM_SET_DEPDIR, -AC_REQUIRE(AM_SET_LEADING_DOT)dnl -AC_SUBST(DEPDIR, "${am__leading_dot}deps")dnl -) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN(AM_DEP_TRACK, -AC_ARG_ENABLE(dependency-tracking, dnl -AS_HELP_STRING( - --enable-dependency-tracking, - do not reject slow dependency extractors) -AS_HELP_STRING( - --disable-dependency-tracking, - speeds up one-time build)) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL(AMDEP, test "x$enable_dependency_tracking" != xno) -AC_SUBST(AMDEPBACKSLASH)dnl -_AM_SUBST_NOTMAKE(AMDEPBACKSLASH)dnl -AC_SUBST(am__nodep)dnl -_AM_SUBST_NOTMAKE(am__nodep)dnl -) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN(_AM_OUTPUT_DEPENDENCY_COMMANDS, -{ - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - AS_CASE($CONFIG_FILES, - *\'*, eval set x "$CONFIG_FILES", - *, set x $CONFIG_FILES) - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`AS_ECHO("$am_mf") | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`AS_DIRNAME("$am_mf")` - am_filepart=`AS_BASENAME("$am_mf")` - AM_RUN_LOG(cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles) || am_rc=$? - done - if test $am_rc -ne 0; then - AC_MSG_FAILURE(Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. If GNU make was not used, consider - re-running the configure script with MAKE="gmake" (or whatever is - necessary). You can also try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking).) - fi - AS_UNSET(am_dirpart) - AS_UNSET(am_filepart) - AS_UNSET(am_mf) - AS_UNSET(am_rc) - rm -f conftest-deps.mk -} -)# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking is enabled. -# This creates each '.Po' and '.Plo' makefile fragment that we'll need in -# order to bootstrap the dependency handling code. -AC_DEFUN(AM_OUTPUT_DEPENDENCY_COMMANDS, -AC_CONFIG_COMMANDS(depfiles, - test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS, - AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}")) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. -m4_define(AC_PROG_CC, -m4_defn(AC_PROG_CC) -_AM_PROG_CC_C_O -) - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, NO-DEFINE) -# AM_INIT_AUTOMAKE(OPTIONS) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN(AM_INIT_AUTOMAKE, -AC_PREREQ(2.65)dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow(^AM_A-Z+FLAGS$)dnl -AC_REQUIRE(AM_SET_CURRENT_AUTOMAKE_VERSION)dnl -AC_REQUIRE(AC_PROG_INSTALL)dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST(am__isrc, ' -I$(srcdir)')_AM_SUBST_NOTMAKE(am__isrc)dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR(source directory already configured; run "make distclean" there first) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST(CYGPATH_W) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval($2, -AC_DIAGNOSE(obsolete, - $0: two- and three-arguments forms are deprecated.) -m4_ifval($3, _AM_SET_OPTION(no-define))dnl - AC_SUBST(PACKAGE, $1)dnl - AC_SUBST(VERSION, $2), -_AM_SET_OPTIONS($1)dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if( - m4_ifset(AC_PACKAGE_NAME, ok):m4_ifset(AC_PACKAGE_VERSION, ok), - ok:ok,, - m4_fatal(AC_INIT should be called with package and version arguments))dnl - AC_SUBST(PACKAGE, 'AC_PACKAGE_TARNAME')dnl - AC_SUBST(VERSION, 'AC_PACKAGE_VERSION'))dnl - -_AM_IF_OPTION(no-define,, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", Name of package) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", Version number of package))dnl - -# Some tools Automake needs. -AC_REQUIRE(AM_SANITY_CHECK)dnl -AC_REQUIRE(AC_ARG_PROGRAM)dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AC_REQUIRE(AM_PROG_INSTALL_SH)dnl -AC_REQUIRE(AM_PROG_INSTALL_STRIP)dnl -AC_REQUIRE(AC_PROG_MKDIR_P)dnl -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> -# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> -AC_SUBST(mkdir_p, '$(MKDIR_P)') -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -AC_REQUIRE(AC_PROG_AWK)dnl -AC_REQUIRE(AC_PROG_MAKE_SET)dnl -AC_REQUIRE(AM_SET_LEADING_DOT)dnl -_AM_IF_OPTION(tar-ustar, _AM_PROG_TAR(ustar), - _AM_IF_OPTION(tar-pax, _AM_PROG_TAR(pax), - _AM_PROG_TAR(v7))) -_AM_IF_OPTION(no-dependencies,, -AC_PROVIDE_IFELSE(AC_PROG_CC, - _AM_DEPENDENCIES(CC), - m4_define(AC_PROG_CC, - m4_defn(AC_PROG_CC)_AM_DEPENDENCIES(CC)))dnl -AC_PROVIDE_IFELSE(AC_PROG_CXX, - _AM_DEPENDENCIES(CXX), - m4_define(AC_PROG_CXX, - m4_defn(AC_PROG_CXX)_AM_DEPENDENCIES(CXX)))dnl -AC_PROVIDE_IFELSE(AC_PROG_OBJC, - _AM_DEPENDENCIES(OBJC), - m4_define(AC_PROG_OBJC, - m4_defn(AC_PROG_OBJC)_AM_DEPENDENCIES(OBJC)))dnl -AC_PROVIDE_IFELSE(AC_PROG_OBJCXX, - _AM_DEPENDENCIES(OBJCXX), - m4_define(AC_PROG_OBJCXX, - m4_defn(AC_PROG_OBJCXX)_AM_DEPENDENCIES(OBJCXX)))dnl -) -# Variables for tags utilities; see am/tags.am -if test -z "$CTAGS"; then - CTAGS=ctags -fi -AC_SUBST(CTAGS) -if test -z "$ETAGS"; then - ETAGS=etags -fi -AC_SUBST(ETAGS) -if test -z "$CSCOPE"; then - CSCOPE=cscope -fi -AC_SUBST(CSCOPE) - -AC_REQUIRE(AM_SILENT_RULES)dnl -dnl The testsuite driver may need to know about EXEEXT, so add the -dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This -dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -m4_provide_if(_AM_COMPILER_EXEEXT, - AM_CONDITIONAL(am__EXEEXT, test -n "$EXEEXT")))dnl - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: <https://www.gnu.org/software/coreutils/>. - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR(Your 'rm' program is bad, sorry.) - fi -fi -dnl The trailing newline in this macro's definition is deliberate, for -dnl backward compatibility and to allow trailing 'dnl'-style comments -dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. -) - -dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -dnl mangled by Autoconf and run in a shell conditional statement. -m4_define(_AC_COMPILER_EXEEXT, -m4_defn(_AC_COMPILER_EXEEXT)m4_provide(_AM_COMPILER_EXEEXT)) - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN(_AC_AM_CONFIG_HEADER_HOOK, -# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME("$_am_arg")`/stamp-h$_am_stamp_count) - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN(AM_PROG_INSTALL_SH, -AC_REQUIRE(AM_AUX_DIR_EXPAND)dnl -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST(install_sh)) - -# Copyright (C) 2003-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN(AM_SET_LEADING_DOT, -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST(am__leading_dot)) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MAKE_INCLUDE() -# ----------------- -# Check whether make has an 'include' directive that can support all -# the idioms we need for our automatic dependency tracking code. -AC_DEFUN(AM_MAKE_INCLUDE, -AC_MSG_CHECKING(whether ${MAKE-make} supports the include directive) -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - AM_RUN_LOG(${MAKE-make} -f confmf.$s && cat confinc.out) - AS_CASE($?:`cat confinc.out 2>/dev/null`, - '0:this is the am__doit target', - AS_CASE($s, - BSD, am__include='.include' am__quote='"', - am__include='include' am__quote='')) - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -AC_MSG_RESULT(${_am_result}) -AC_SUBST(am__include)) -AC_SUBST(am__quote)) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN(AM_MISSING_PROG, -AC_REQUIRE(AM_MISSING_HAS_RUN) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)) - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it is modern enough. -# If it is, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN(AM_MISSING_HAS_RUN, -AC_REQUIRE(AM_AUX_DIR_EXPAND)dnl -AC_REQUIRE_AUX_FILE(missing)dnl -if test x"${MISSING+set}" != xset; then - MISSING="\${SHELL} '$am_aux_dir/missing'" -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - AC_MSG_WARN('missing' script is too old or missing) -fi -) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN(_AM_MANGLE_OPTION, -_AM_OPTION_m4_bpatsubst($1, ^a-zA-Z0-9_, _)) - -# _AM_SET_OPTION(NAME) -# -------------------- -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN(_AM_SET_OPTION, -m4_define(_AM_MANGLE_OPTION($1), 1)) - -# _AM_SET_OPTIONS(OPTIONS) -# ------------------------ -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN(_AM_SET_OPTIONS, -m4_foreach_w(_AM_Option, $1, _AM_SET_OPTION(_AM_Option))) - -# _AM_IF_OPTION(OPTION, IF-SET, IF-NOT-SET) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN(_AM_IF_OPTION, -m4_ifset(_AM_MANGLE_OPTION($1), $2, $3)) - -# Copyright (C) 1999-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_CC_C_O -# --------------- -# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC -# to automatically call this. -AC_DEFUN(_AM_PROG_CC_C_O, -AC_REQUIRE(AM_AUX_DIR_EXPAND)dnl -AC_REQUIRE_AUX_FILE(compile)dnl -AC_LANG_PUSH(C)dnl -AC_CACHE_CHECK( - whether $CC understands -c and -o together, - am_cv_prog_cc_c_o, - AC_LANG_CONFTEST(AC_LANG_PROGRAM()) - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if AM_RUN_LOG($CC -c conftest.$ac_ext -o conftest2.$ac_objext) \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i) -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -AC_LANG_POP(C)) - -# For backward compatibility. -AC_DEFUN_ONCE(AM_PROG_CC_C_O, AC_REQUIRE(AC_PROG_CC)) - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN(AM_RUN_LOG, -{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN(AM_SANITY_CHECK, -AC_MSG_CHECKING(whether build environment is sane) -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *\\\"\#\$\&\'\`$am_lf*) - AC_MSG_ERROR(unsafe absolute working directory name);; -esac -case $srcdir in - *\\\"\#\$\&\'\`$am_lf\ \ *) - AC_MSG_ERROR(unsafe srcdir value: '$srcdir');; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR(ls -t appears to fail. Make sure there is not a broken - alias in your environment) - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR(newly created file is older than distributed files! -Check your system clock) -fi -AC_MSG_RESULT(yes) -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -AC_CONFIG_COMMANDS_PRE( - AC_MSG_CHECKING(that generated files are newer than configure) - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - AC_MSG_RESULT(done)) -rm -f conftest.file -) - -# Copyright (C) 2009-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SILENT_RULES(DEFAULT) -# -------------------------- -# Enable less verbose build rules; with the default set to DEFAULT -# ("yes" being less verbose, "no" or empty being verbose). -AC_DEFUN(AM_SILENT_RULES, -AC_ARG_ENABLE(silent-rules, dnl -AS_HELP_STRING( - --enable-silent-rules, - less verbose build output (undo: "make V=1")) -AS_HELP_STRING( - --disable-silent-rules, - verbose build output (undo: "make V=0"))dnl -) -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=m4_if($1, yes, 0, 1);; -esac -dnl -dnl A few 'make' implementations (e.g., NonStop OS and NextStep) -dnl do not support nested variable expansions. -dnl See automake bug#9928 and bug#10237. -am_make=${MAKE-make} -AC_CACHE_CHECK(whether $am_make supports nested variables, - am_cv_make_support_nested_variables, - if AS_ECHO('TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit') | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AC_SUBST(AM_V)dnl -AM_SUBST_NOTMAKE(AM_V)dnl -AC_SUBST(AM_DEFAULT_V)dnl -AM_SUBST_NOTMAKE(AM_DEFAULT_V)dnl -AC_SUBST(AM_DEFAULT_VERBOSITY)dnl -AM_BACKSLASH='\' -AC_SUBST(AM_BACKSLASH)dnl -_AM_SUBST_NOTMAKE(AM_BACKSLASH)dnl -) - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor 'install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in "make install-strip", and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN(AM_PROG_INSTALL_STRIP, -AC_REQUIRE(AM_PROG_INSTALL_SH)dnl -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL(STRIP, strip, :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST(INSTALL_STRIP_PROGRAM)) - -# Copyright (C) 2006-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN(_AM_SUBST_NOTMAKE) - -# AM_SUBST_NOTMAKE(VARIABLE) -# -------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN(AM_SUBST_NOTMAKE, _AM_SUBST_NOTMAKE($@)) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of 'v7', 'ustar', or 'pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -# -AC_DEFUN(_AM_PROG_TAR, -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST(AMTAR, '$${TAR-tar}') - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if($1, ustar, plaintar) pax cpio none' - -m4_if($1, v7, - am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -', - - m4_case($1, - ustar, - # The POSIX 1988 'ustar' format is defined with fixed-size fields. - # There is notably a 21 bits limit for the UID and the GID. In fact, - # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 - # and bug#13588). - am_max_uid=2097151 # 2^21 - 1 - am_max_gid=$am_max_uid - # The $UID and $GID variables are not portable, so we need to resort - # to the POSIX-mandated id(1) utility. Errors in the 'id' calls - # below are definitely unexpected, so allow the users to see them - # (that is, avoid stderr redirection). - am_uid=`id -u || echo unknown` - am_gid=`id -g || echo unknown` - AC_MSG_CHECKING(whether UID '$am_uid' is supported by ustar format) - if test $am_uid -le $am_max_uid; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - _am_tools=none - fi - AC_MSG_CHECKING(whether GID '$am_gid' is supported by ustar format) - if test $am_gid -le $am_max_gid; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - _am_tools=none - fi, - - pax, - , - - m4_fatal(Unknown tar format)) - - AC_MSG_CHECKING(how to create a $1 tar archive) - - # Go ahead even if we have the value already cached. We do so because we - # need to set the values for the 'am__tar' and 'am__untar' variables. - _am_tools=${am_cv_prog_tar_$1-$_am_tools} - - for _am_tool in $_am_tools; do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; do - AM_RUN_LOG($_am_tar --version) && break - done - am__tar="$_am_tar --format=m4_if($1, pax, posix, $1) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if($1, pax, posix, $1) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works. - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG(tardir=conftest.dir && eval $am__tar_ >conftest.tar) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG($am__untar <conftest.tar) - AM_RUN_LOG(cat conftest.dir/file) - grep GrepMe conftest.dir/file >/dev/null 2>&1 && break - fi - done - rm -rf conftest.dir - - AC_CACHE_VAL(am_cv_prog_tar_$1, am_cv_prog_tar_$1=$_am_tool) - AC_MSG_RESULT($am_cv_prog_tar_$1)) - -AC_SUBST(am__tar) -AC_SUBST(am__untar) -) # _AM_PROG_TAR - -dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29) -dnl -dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. -dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but -dnl WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -dnl 02111-1307, USA. -dnl -dnl As a special exception to the GNU General Public License, if you -dnl distribute this file as part of a program that contains a -dnl configuration script generated by Autoconf, you may include it under -dnl the same distribution terms that you use for the rest of that -dnl program. - -dnl PKG_PREREQ(MIN-VERSION) -dnl ----------------------- -dnl Since: 0.29 -dnl -dnl Verify that the version of the pkg-config macros are at least -dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's -dnl installed version of pkg-config, this checks the developer's version -dnl of pkg.m4 when generating configure. -dnl -dnl To ensure that this macro is defined, also add: -dnl m4_ifndef(PKG_PREREQ, -dnl m4_fatal(must install pkg-config 0.29 or later before running autoconf/autogen)) -dnl -dnl See the "Since" comment for each macro you use to see what version -dnl of the macros you require. -m4_defun(PKG_PREREQ, -m4_define(PKG_MACROS_VERSION, 0.29) -m4_if(m4_version_compare(PKG_MACROS_VERSION, $1), -1, - m4_fatal(pkg.m4 version $1 or higher is required but PKG_MACROS_VERSION found)) -)dnl PKG_PREREQ - -dnl PKG_PROG_PKG_CONFIG(MIN-VERSION) -dnl ---------------------------------- -dnl Since: 0.16 -dnl -dnl Search for the pkg-config tool and set the PKG_CONFIG variable to -dnl first found in the path. Checks that the version of pkg-config found -dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is -dnl used since that's the first version where most current features of -dnl pkg-config existed. -AC_DEFUN(PKG_PROG_PKG_CONFIG, -m4_pattern_forbid(^_?PKG_A-Z_+$) -m4_pattern_allow(^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$) -m4_pattern_allow(^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$) -AC_ARG_VAR(PKG_CONFIG, path to pkg-config utility) -AC_ARG_VAR(PKG_CONFIG_PATH, directories to add to pkg-config's search path) -AC_ARG_VAR(PKG_CONFIG_LIBDIR, path overriding pkg-config's built-in search path) - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL(PKG_CONFIG, pkg-config) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default($1, 0.9.0) - AC_MSG_CHECKING(pkg-config is at least version $_pkg_min_version) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - PKG_CONFIG="" - fi -fidnl -)dnl PKG_PROG_PKG_CONFIG - -dnl PKG_CHECK_EXISTS(MODULES, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -dnl ------------------------------------------------------------------- -dnl Since: 0.18 -dnl -dnl Check to see whether a particular set of modules exists. Similar to -dnl PKG_CHECK_MODULES(), but does not set variables or print errors. -dnl -dnl Please remember that m4 expands AC_REQUIRE(PKG_PROG_PKG_CONFIG) -dnl only at the first occurence in configure.ac, so if the first place -dnl it's called might be skipped (such as if it is within an "if", you -dnl have to call PKG_CHECK_EXISTS manually -AC_DEFUN(PKG_CHECK_EXISTS, -AC_REQUIRE(PKG_PROG_PKG_CONFIG)dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG($PKG_CONFIG --exists --print-errors "$1"); then - m4_default($2, :) -m4_ifvaln($3, else - $3)dnl -fi) - -dnl _PKG_CONFIG(VARIABLE, COMMAND, MODULES) -dnl --------------------------------------------- -dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting -dnl pkg_failed based on the result. -m4_define(_PKG_CONFIG, -if test -n "$$1"; then - pkg_cv_$1="$$1" - elif test -n "$PKG_CONFIG"; then - PKG_CHECK_EXISTS($3, - pkg_cv_$1=`$PKG_CONFIG --$2 "$3" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes , - pkg_failed=yes) - else - pkg_failed=untried -fidnl -)dnl _PKG_CONFIG - -dnl _PKG_SHORT_ERRORS_SUPPORTED -dnl --------------------------- -dnl Internal check to see if pkg-config supports short errors. -AC_DEFUN(_PKG_SHORT_ERRORS_SUPPORTED, -AC_REQUIRE(PKG_PROG_PKG_CONFIG) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fidnl -)dnl _PKG_SHORT_ERRORS_SUPPORTED - - -dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, ACTION-IF-FOUND, -dnl ACTION-IF-NOT-FOUND) -dnl -------------------------------------------------------------- -dnl Since: 0.4.0 -dnl -dnl Note that if there is a possibility the first call to -dnl PKG_CHECK_MODULES might not happen, you should be sure to include an -dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -AC_DEFUN(PKG_CHECK_MODULES, -AC_REQUIRE(PKG_PROG_PKG_CONFIG)dnl -AC_ARG_VAR($1_CFLAGS, C compiler flags for $1, overriding pkg-config)dnl -AC_ARG_VAR($1_LIBS, linker flags for $1, overriding pkg-config)dnl - -pkg_failed=no -AC_MSG_CHECKING(for $1) - -_PKG_CONFIG($1_CFLAGS, cflags, $2) -_PKG_CONFIG($1_LIBS, libs, $2) - -m4_define(_PKG_TEXT, Alternatively, you may set the environment variables $1_CFLAGS -and $1_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.) - -if test $pkg_failed = yes; then - AC_MSG_RESULT(no) - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else - $1_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - m4_default($4, AC_MSG_ERROR( -Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT)dnl - ) -elif test $pkg_failed = untried; then - AC_MSG_RESULT(no) - m4_default($4, AC_MSG_FAILURE( -The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see <http://pkg-config.freedesktop.org/>.)dnl - ) -else - $1_CFLAGS=$pkg_cv_$1_CFLAGS - $1_LIBS=$pkg_cv_$1_LIBS - AC_MSG_RESULT(yes) - $3 -fidnl -)dnl PKG_CHECK_MODULES - - -dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, ACTION-IF-FOUND, -dnl ACTION-IF-NOT-FOUND) -dnl --------------------------------------------------------------------- -dnl Since: 0.29 -dnl -dnl Checks for existence of MODULES and gathers its build flags with -dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags -dnl and VARIABLE-PREFIX_LIBS from --libs. -dnl -dnl Note that if there is a possibility the first call to -dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to -dnl include an explicit call to PKG_PROG_PKG_CONFIG in your -dnl configure.ac. -AC_DEFUN(PKG_CHECK_MODULES_STATIC, -AC_REQUIRE(PKG_PROG_PKG_CONFIG)dnl -_save_PKG_CONFIG=$PKG_CONFIG -PKG_CONFIG="$PKG_CONFIG --static" -PKG_CHECK_MODULES($@) -PKG_CONFIG=$_save_PKG_CONFIGdnl -)dnl PKG_CHECK_MODULES_STATIC - - -dnl PKG_INSTALLDIR(DIRECTORY) -dnl ------------------------- -dnl Since: 0.27 -dnl -dnl Substitutes the variable pkgconfigdir as the location where a module -dnl should install pkg-config .pc files. By default the directory is -dnl $libdir/pkgconfig, but the default can be changed by passing -dnl DIRECTORY. The user can override through the --with-pkgconfigdir -dnl parameter. -AC_DEFUN(PKG_INSTALLDIR, -m4_pushdef(pkg_default, m4_default($1, '${libdir}/pkgconfig')) -m4_pushdef(pkg_description, - pkg-config installation directory @<:@pkg_default@:>@) -AC_ARG_WITH(pkgconfigdir, - AS_HELP_STRING(--with-pkgconfigdir, pkg_description),, - with_pkgconfigdir=pkg_default) -AC_SUBST(pkgconfigdir, $with_pkgconfigdir) -m4_popdef(pkg_default) -m4_popdef(pkg_description) -)dnl PKG_INSTALLDIR - - -dnl PKG_NOARCH_INSTALLDIR(DIRECTORY) -dnl -------------------------------- -dnl Since: 0.27 -dnl -dnl Substitutes the variable noarch_pkgconfigdir as the location where a -dnl module should install arch-independent pkg-config .pc files. By -dnl default the directory is $datadir/pkgconfig, but the default can be -dnl changed by passing DIRECTORY. The user can override through the -dnl --with-noarch-pkgconfigdir parameter. -AC_DEFUN(PKG_NOARCH_INSTALLDIR, -m4_pushdef(pkg_default, m4_default($1, '${datadir}/pkgconfig')) -m4_pushdef(pkg_description, - pkg-config arch-independent installation directory @<:@pkg_default@:>@) -AC_ARG_WITH(noarch-pkgconfigdir, - AS_HELP_STRING(--with-noarch-pkgconfigdir, pkg_description),, - with_noarch_pkgconfigdir=pkg_default) -AC_SUBST(noarch_pkgconfigdir, $with_noarch_pkgconfigdir) -m4_popdef(pkg_default) -m4_popdef(pkg_description) -)dnl PKG_NOARCH_INSTALLDIR - - -dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -dnl ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -dnl ------------------------------------------- -dnl Since: 0.28 -dnl -dnl Retrieves the value of the pkg-config variable for the given module. -AC_DEFUN(PKG_CHECK_VAR, -AC_REQUIRE(PKG_PROG_PKG_CONFIG)dnl -AC_ARG_VAR($1, value of $3 for $2, overriding pkg-config)dnl - -_PKG_CONFIG($1, variable="$3", $2) -AS_VAR_COPY($1, pkg_cv_$1) - -AS_VAR_IF($1, "", $5, $4)dnl -)dnl PKG_CHECK_VAR - -dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. -dnl -dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. -dnl -dnl Permission is hereby granted, free of charge, to any person obtaining a -dnl copy of this software and associated documentation files (the "Software"), -dnl to deal in the Software without restriction, including without limitation -dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, -dnl and/or sell copies of the Software, and to permit persons to whom the -dnl Software is furnished to do so, subject to the following conditions: -dnl -dnl The above copyright notice and this permission notice (including the next -dnl paragraph) shall be included in all copies or substantial portions of the -dnl Software. -dnl -dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -dnl DEALINGS IN THE SOFTWARE. - -# XORG_MACROS_VERSION(required-version) -# ------------------------------------- -# Minimum version: 1.1.0 -# -# If you're using a macro added in Version 1.1 or newer, include this in -# your configure.ac with the minimum required version, such as: -# XORG_MACROS_VERSION(1.1) -# -# To ensure that this macro is defined, also add: -# m4_ifndef(XORG_MACROS_VERSION, -# m4_fatal(must install xorg-macros 1.1 or later before running autoconf/autogen)) -# -# -# See the "minimum version" comment for each macro you use to see what -# version you require. -m4_defun(XORG_MACROS_VERSION, -m4_define(vers_have, 1.19.3) -m4_define(maj_have, m4_substr(vers_have, 0, m4_index(vers_have, .))) -m4_define(maj_needed, m4_substr($1, 0, m4_index($1, .))) -m4_if(m4_cmp(maj_have, maj_needed), 0,, - m4_fatal(xorg-macros major version maj_needed is required but vers_have found)) -m4_if(m4_version_compare(vers_have, $1), -1, - m4_fatal(xorg-macros version $1 or higher is required but vers_have found)) -m4_undefine(vers_have) -m4_undefine(maj_have) -m4_undefine(maj_needed) -) # XORG_MACROS_VERSION - -# XORG_PROG_RAWCPP() -# ------------------ -# Minimum version: 1.0.0 -# -# Find cpp program and necessary flags for use in pre-processing text files -# such as man pages and config files -AC_DEFUN(XORG_PROG_RAWCPP, -AC_REQUIRE(AC_PROG_CPP) -AC_PATH_TOOL(RAWCPP, cpp, ${CPP}, - $PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib) - -# Check for flag to avoid builtin definitions - assumes unix is predefined, -# which is not the best choice for supporting other OS'es, but covers most -# of the ones we need for now. -AC_MSG_CHECKING(if $RAWCPP requires -undef) -AC_LANG_CONFTEST(AC_LANG_SOURCE(Does cpp redefine unix ?)) -if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then - AC_MSG_RESULT(no) -else - if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then - RAWCPPFLAGS=-undef - AC_MSG_RESULT(yes) - # under Cygwin unix is still defined even with -undef - elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then - RAWCPPFLAGS="-undef -ansi" - AC_MSG_RESULT(yes, with -ansi) - else - AC_MSG_ERROR(${RAWCPP} defines unix with or without -undef. I don't know what to do.) - fi -fi -rm -f conftest.$ac_ext - -AC_MSG_CHECKING(if $RAWCPP requires -traditional) -AC_LANG_CONFTEST(AC_LANG_SOURCE(Does cpp preserve "whitespace"?)) -if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then - AC_MSG_RESULT(no) -else - if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then - TRADITIONALCPPFLAGS="-traditional" - RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" - AC_MSG_RESULT(yes) - else - AC_MSG_ERROR(${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.) - fi -fi -rm -f conftest.$ac_ext -AC_SUBST(RAWCPPFLAGS) -AC_SUBST(TRADITIONALCPPFLAGS) -) # XORG_PROG_RAWCPP - -# XORG_MANPAGE_SECTIONS() -# ----------------------- -# Minimum version: 1.0.0 -# -# Determine which sections man pages go in for the different man page types -# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. -# Not sure if there's any better way than just hardcoding by OS name. -# Override default settings by setting environment variables -# Added MAN_SUBSTS in version 1.8 -# Added AC_PROG_SED in version 1.8 - -AC_DEFUN(XORG_MANPAGE_SECTIONS, -AC_REQUIRE(AC_CANONICAL_HOST) -AC_REQUIRE(AC_PROG_SED) - -case $host_os in - solaris*) - # Solaris 2.0 - 11.3 use SysV man page section numbers, so we - # check for a man page file found in later versions that use - # traditional section numbers instead - AC_CHECK_FILE(/usr/share/man/man7/attributes.7, - SYSV_MAN_SECTIONS=false, SYSV_MAN_SECTIONS=true) - ;; - *) SYSV_MAN_SECTIONS=false ;; -esac - -if test x$APP_MAN_SUFFIX = x ; then - APP_MAN_SUFFIX=1 -fi -if test x$APP_MAN_DIR = x ; then - APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' -fi - -if test x$LIB_MAN_SUFFIX = x ; then - LIB_MAN_SUFFIX=3 -fi -if test x$LIB_MAN_DIR = x ; then - LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' -fi - -if test x$FILE_MAN_SUFFIX = x ; then - case $SYSV_MAN_SECTIONS in - true) FILE_MAN_SUFFIX=4 ;; - *) FILE_MAN_SUFFIX=5 ;; - esac -fi -if test x$FILE_MAN_DIR = x ; then - FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' -fi - -if test x$MISC_MAN_SUFFIX = x ; then - case $SYSV_MAN_SECTIONS in - true) MISC_MAN_SUFFIX=5 ;; - *) MISC_MAN_SUFFIX=7 ;; - esac -fi -if test x$MISC_MAN_DIR = x ; then - MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' -fi - -if test x$DRIVER_MAN_SUFFIX = x ; then - case $SYSV_MAN_SECTIONS in - true) DRIVER_MAN_SUFFIX=7 ;; - *) DRIVER_MAN_SUFFIX=4 ;; - esac -fi -if test x$DRIVER_MAN_DIR = x ; then - DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' -fi - -if test x$ADMIN_MAN_SUFFIX = x ; then - case $SYSV_MAN_SECTIONS in - true) ADMIN_MAN_SUFFIX=1m ;; - *) ADMIN_MAN_SUFFIX=8 ;; - esac -fi -if test x$ADMIN_MAN_DIR = x ; then - ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' -fi - - -AC_SUBST(APP_MAN_SUFFIX) -AC_SUBST(LIB_MAN_SUFFIX) -AC_SUBST(FILE_MAN_SUFFIX) -AC_SUBST(MISC_MAN_SUFFIX) -AC_SUBST(DRIVER_MAN_SUFFIX) -AC_SUBST(ADMIN_MAN_SUFFIX) -AC_SUBST(APP_MAN_DIR) -AC_SUBST(LIB_MAN_DIR) -AC_SUBST(FILE_MAN_DIR) -AC_SUBST(MISC_MAN_DIR) -AC_SUBST(DRIVER_MAN_DIR) -AC_SUBST(ADMIN_MAN_DIR) - -XORG_MAN_PAGE="X Version 11" -AC_SUBST(XORG_MAN_PAGE) -MAN_SUBSTS="\ - -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ - -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ - -e 's|__xservername__|Xorg|g' \ - -e 's|__xconfigfile__|xorg.conf|g' \ - -e 's|__projectroot__|\$(prefix)|g' \ - -e 's|__apploaddir__|\$(appdefaultdir)|g' \ - -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ - -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ - -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ - -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ - -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ - -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" -AC_SUBST(MAN_SUBSTS) - -) # XORG_MANPAGE_SECTIONS - -# XORG_CHECK_SGML_DOCTOOLS(MIN-VERSION) -# ------------------------ -# Minimum version: 1.7.0 -# -# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent -# provided by xorg-sgml-doctools, if installed. -AC_DEFUN(XORG_CHECK_SGML_DOCTOOLS, -AC_MSG_CHECKING(for X.Org SGML entities m4_ifval($1,>= $1)) -XORG_SGML_PATH= -PKG_CHECK_EXISTS(xorg-sgml-doctools m4_ifval($1,>= $1), - XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`, - m4_ifval($1,:, - if test x"$cross_compiling" != x"yes" ; then - AC_CHECK_FILE($prefix/share/sgml/X11/defs.ent, - XORG_SGML_PATH=$prefix/share/sgml) - fi) - ) - -# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing -# the path and the name of the doc stylesheet -if test "x$XORG_SGML_PATH" != "x" ; then - AC_MSG_RESULT($XORG_SGML_PATH) - STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 - XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl -else - AC_MSG_RESULT(no) -fi - -AC_SUBST(XORG_SGML_PATH) -AC_SUBST(STYLESHEET_SRCDIR) -AC_SUBST(XSL_STYLESHEET) -AM_CONDITIONAL(HAVE_STYLESHEETS, test "x$XSL_STYLESHEET" != "x") -) # XORG_CHECK_SGML_DOCTOOLS - -# XORG_CHECK_LINUXDOC -# ------------------- -# Minimum version: 1.0.0 -# -# Defines the variable MAKE_TEXT if the necessary tools and -# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. -# Whether or not the necessary tools and files are found can be checked -# with the AM_CONDITIONAL "BUILD_LINUXDOC" -AC_DEFUN(XORG_CHECK_LINUXDOC, -AC_REQUIRE(XORG_CHECK_SGML_DOCTOOLS) -AC_REQUIRE(XORG_WITH_PS2PDF) - -AC_PATH_PROG(LINUXDOC, linuxdoc) - -AC_MSG_CHECKING(whether to build documentation) - -if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then - BUILDDOC=yes -else - BUILDDOC=no -fi - -AM_CONDITIONAL(BUILD_LINUXDOC, test x$BUILDDOC = xyes) - -AC_MSG_RESULT($BUILDDOC) - -AC_MSG_CHECKING(whether to build pdf documentation) - -if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then - BUILDPDFDOC=yes -else - BUILDPDFDOC=no -fi - -AM_CONDITIONAL(BUILD_PDFDOC, test x$BUILDPDFDOC = xyes) - -AC_MSG_RESULT($BUILDPDFDOC) - -MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" -MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" -MAKE_PDF="$PS2PDF" -MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" - -AC_SUBST(MAKE_TEXT) -AC_SUBST(MAKE_PS) -AC_SUBST(MAKE_PDF) -AC_SUBST(MAKE_HTML) -) # XORG_CHECK_LINUXDOC - -# XORG_CHECK_DOCBOOK -# ------------------- -# Minimum version: 1.0.0 -# -# Checks for the ability to build output formats from SGML DocBook source. -# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" -# indicates whether the necessary tools and files are found and, if set, -# $(MAKE_XXX) blah.sgml will produce blah.xxx. -AC_DEFUN(XORG_CHECK_DOCBOOK, -AC_REQUIRE(XORG_CHECK_SGML_DOCTOOLS) - -BUILDTXTDOC=no -BUILDPDFDOC=no -BUILDPSDOC=no -BUILDHTMLDOC=no - -AC_PATH_PROG(DOCBOOKPS, docbook2ps) -AC_PATH_PROG(DOCBOOKPDF, docbook2pdf) -AC_PATH_PROG(DOCBOOKHTML, docbook2html) -AC_PATH_PROG(DOCBOOKTXT, docbook2txt) - -AC_MSG_CHECKING(whether to build text documentation) -if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && - test x$BUILD_TXTDOC != xno; then - BUILDTXTDOC=yes -fi -AM_CONDITIONAL(BUILD_TXTDOC, test x$BUILDTXTDOC = xyes) -AC_MSG_RESULT($BUILDTXTDOC) - -AC_MSG_CHECKING(whether to build PDF documentation) -if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && - test x$BUILD_PDFDOC != xno; then - BUILDPDFDOC=yes -fi -AM_CONDITIONAL(BUILD_PDFDOC, test x$BUILDPDFDOC = xyes) -AC_MSG_RESULT($BUILDPDFDOC) - -AC_MSG_CHECKING(whether to build PostScript documentation) -if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && - test x$BUILD_PSDOC != xno; then - BUILDPSDOC=yes -fi -AM_CONDITIONAL(BUILD_PSDOC, test x$BUILDPSDOC = xyes) -AC_MSG_RESULT($BUILDPSDOC) - -AC_MSG_CHECKING(whether to build HTML documentation) -if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && - test x$BUILD_HTMLDOC != xno; then - BUILDHTMLDOC=yes -fi -AM_CONDITIONAL(BUILD_HTMLDOC, test x$BUILDHTMLDOC = xyes) -AC_MSG_RESULT($BUILDHTMLDOC) - -MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" -MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" -MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" -MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" - -AC_SUBST(MAKE_TEXT) -AC_SUBST(MAKE_PS) -AC_SUBST(MAKE_PDF) -AC_SUBST(MAKE_HTML) -) # XORG_CHECK_DOCBOOK - -# XORG_WITH_XMLTO(MIN-VERSION, DEFAULT) -# ---------------- -# Minimum version: 1.5.0 -# Minimum version for optional DEFAULT argument: 1.11.0 -# -# Documentation tools are not always available on all platforms and sometimes -# not at the appropriate level. This macro enables a module to test for the -# presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-xmlto option, it allows maximum flexibilty in making decisions -# as whether or not to use the xmlto package. When DEFAULT is not specified, -# --with-xmlto assumes 'auto'. -# -# Interface to module: -# HAVE_XMLTO: used in makefiles to conditionally generate documentation -# XMLTO: returns the path of the xmlto program found -# returns the path set by the user in the environment -# --with-xmlto: 'yes' user instructs the module to use xmlto -# 'no' user instructs the module not to use xmlto -# -# Added in version 1.10.0 -# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation -# xmlto for text output requires either lynx, links, or w3m browsers -# -# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. -# -AC_DEFUN(XORG_WITH_XMLTO, -AC_ARG_VAR(XMLTO, Path to xmlto command) -m4_define(_defopt, m4_default($2, auto)) -AC_ARG_WITH(xmlto, - AS_HELP_STRING(--with-xmlto, - Use xmlto to regenerate documentation (default: _defopt)), - use_xmlto=$withval, use_xmlto=_defopt) -m4_undefine(_defopt) - -if test "x$use_xmlto" = x"auto"; then - AC_PATH_PROG(XMLTO, xmlto) - if test "x$XMLTO" = "x"; then - AC_MSG_WARN(xmlto not found - documentation targets will be skipped) - have_xmlto=no - else - have_xmlto=yes - fi -elif test "x$use_xmlto" = x"yes" ; then - AC_PATH_PROG(XMLTO, xmlto) - if test "x$XMLTO" = "x"; then - AC_MSG_ERROR(--with-xmlto=yes specified but xmlto not found in PATH) - fi - have_xmlto=yes -elif test "x$use_xmlto" = x"no" ; then - if test "x$XMLTO" != "x"; then - AC_MSG_WARN(ignoring XMLTO environment variable since --with-xmlto=no was specified) - fi - have_xmlto=no -else - AC_MSG_ERROR(--with-xmlto expects 'yes' or 'no') -fi - -# Test for a minimum version of xmlto, if provided. -m4_ifval($1, -if test "$have_xmlto" = yes; then - # scrape the xmlto version - AC_MSG_CHECKING(the xmlto version) - xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` - AC_MSG_RESULT($xmlto_version) - AS_VERSION_COMPARE($xmlto_version, $1, - if test "x$use_xmlto" = xauto; then - AC_MSG_WARN(xmlto version $xmlto_version found, but $1 needed) - have_xmlto=no - else - AC_MSG_ERROR(xmlto version $xmlto_version found, but $1 needed) - fi) -fi) - -# Test for the ability of xmlto to generate a text target -# -# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the -# following test for empty XML docbook files. -# For compatibility reasons use the following empty XML docbook file and if -# it fails try it again with a non-empty XML file. -have_xmlto_text=no -cat > conftest.xml << "EOF" -EOF -AS_IF(test "$have_xmlto" = yes, - AS_IF($XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1, - have_xmlto_text=yes, - # Try it again with a non-empty XML file. - cat > conftest.xml << "EOF" -<x></x> -EOF - AS_IF($XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1, - have_xmlto_text=yes, - AC_MSG_WARN(xmlto cannot generate text format, this format skipped)))) -rm -f conftest.xml -AM_CONDITIONAL(HAVE_XMLTO_TEXT, test $have_xmlto_text = yes) -AM_CONDITIONAL(HAVE_XMLTO, test "$have_xmlto" = yes) -) # XORG_WITH_XMLTO - -# XORG_WITH_XSLTPROC(MIN-VERSION, DEFAULT) -# -------------------------------------------- -# Minimum version: 1.12.0 -# Minimum version for optional DEFAULT argument: 1.12.0 -# -# XSLT (Extensible Stylesheet Language Transformations) is a declarative, -# XML-based language used for the transformation of XML documents. -# The xsltproc command line tool is for applying XSLT stylesheets to XML documents. -# It is used under the cover by xmlto to generate html files from DocBook/XML. -# The XSLT processor is often used as a standalone tool for transformations. -# It should not be assumed that this tool is used only to work with documnetation. -# When DEFAULT is not specified, --with-xsltproc assumes 'auto'. -# -# Interface to module: -# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation -# XSLTPROC: returns the path of the xsltproc program found -# returns the path set by the user in the environment -# --with-xsltproc: 'yes' user instructs the module to use xsltproc -# 'no' user instructs the module not to use xsltproc -# have_xsltproc: returns yes if xsltproc found in PATH or no -# -# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path. -# -AC_DEFUN(XORG_WITH_XSLTPROC, -AC_ARG_VAR(XSLTPROC, Path to xsltproc command) -# Preserves the interface, should it be implemented later -m4_ifval($1, m4_warn(syntax, Checking for xsltproc MIN-VERSION is not implemented)) -m4_define(_defopt, m4_default($2, auto)) -AC_ARG_WITH(xsltproc, - AS_HELP_STRING(--with-xsltproc, - Use xsltproc for the transformation of XML documents (default: _defopt)), - use_xsltproc=$withval, use_xsltproc=_defopt) -m4_undefine(_defopt) - -if test "x$use_xsltproc" = x"auto"; then - AC_PATH_PROG(XSLTPROC, xsltproc) - if test "x$XSLTPROC" = "x"; then - AC_MSG_WARN(xsltproc not found - cannot transform XML documents) - have_xsltproc=no - else - have_xsltproc=yes - fi -elif test "x$use_xsltproc" = x"yes" ; then - AC_PATH_PROG(XSLTPROC, xsltproc) - if test "x$XSLTPROC" = "x"; then - AC_MSG_ERROR(--with-xsltproc=yes specified but xsltproc not found in PATH) - fi - have_xsltproc=yes -elif test "x$use_xsltproc" = x"no" ; then - if test "x$XSLTPROC" != "x"; then - AC_MSG_WARN(ignoring XSLTPROC environment variable since --with-xsltproc=no was specified) - fi - have_xsltproc=no -else - AC_MSG_ERROR(--with-xsltproc expects 'yes' or 'no') -fi - -AM_CONDITIONAL(HAVE_XSLTPROC, test "$have_xsltproc" = yes) -) # XORG_WITH_XSLTPROC - -# XORG_WITH_PERL(MIN-VERSION, DEFAULT) -# ---------------------------------------- -# Minimum version: 1.15.0 -# -# PERL (Practical Extraction and Report Language) is a language optimized for -# scanning arbitrary text files, extracting information from those text files, -# and printing reports based on that information. -# -# When DEFAULT is not specified, --with-perl assumes 'auto'. -# -# Interface to module: -# HAVE_PERL: used in makefiles to conditionally scan text files -# PERL: returns the path of the perl program found -# returns the path set by the user in the environment -# --with-perl: 'yes' user instructs the module to use perl -# 'no' user instructs the module not to use perl -# have_perl: returns yes if perl found in PATH or no -# -# If the user sets the value of PERL, AC_PATH_PROG skips testing the path. -# -AC_DEFUN(XORG_WITH_PERL, -AC_ARG_VAR(PERL, Path to perl command) -# Preserves the interface, should it be implemented later -m4_ifval($1, m4_warn(syntax, Checking for perl MIN-VERSION is not implemented)) -m4_define(_defopt, m4_default($2, auto)) -AC_ARG_WITH(perl, - AS_HELP_STRING(--with-perl, - Use perl for extracting information from files (default: _defopt)), - use_perl=$withval, use_perl=_defopt) -m4_undefine(_defopt) - -if test "x$use_perl" = x"auto"; then - AC_PATH_PROG(PERL, perl) - if test "x$PERL" = "x"; then - AC_MSG_WARN(perl not found - cannot extract information and report) - have_perl=no - else - have_perl=yes - fi -elif test "x$use_perl" = x"yes" ; then - AC_PATH_PROG(PERL, perl) - if test "x$PERL" = "x"; then - AC_MSG_ERROR(--with-perl=yes specified but perl not found in PATH) - fi - have_perl=yes -elif test "x$use_perl" = x"no" ; then - if test "x$PERL" != "x"; then - AC_MSG_WARN(ignoring PERL environment variable since --with-perl=no was specified) - fi - have_perl=no -else - AC_MSG_ERROR(--with-perl expects 'yes' or 'no') -fi - -AM_CONDITIONAL(HAVE_PERL, test "$have_perl" = yes) -) # XORG_WITH_PERL - -# XORG_WITH_ASCIIDOC(MIN-VERSION, DEFAULT) -# ---------------- -# Minimum version: 1.5.0 -# Minimum version for optional DEFAULT argument: 1.11.0 -# -# Documentation tools are not always available on all platforms and sometimes -# not at the appropriate level. This macro enables a module to test for the -# presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-asciidoc option, it allows maximum flexibilty in making decisions -# as whether or not to use the asciidoc package. When DEFAULT is not specified, -# --with-asciidoc assumes 'auto'. -# -# Interface to module: -# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation -# ASCIIDOC: returns the path of the asciidoc program found -# returns the path set by the user in the environment -# --with-asciidoc: 'yes' user instructs the module to use asciidoc -# 'no' user instructs the module not to use asciidoc -# -# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. -# -AC_DEFUN(XORG_WITH_ASCIIDOC, -AC_ARG_VAR(ASCIIDOC, Path to asciidoc command) -m4_define(_defopt, m4_default($2, auto)) -AC_ARG_WITH(asciidoc, - AS_HELP_STRING(--with-asciidoc, - Use asciidoc to regenerate documentation (default: _defopt)), - use_asciidoc=$withval, use_asciidoc=_defopt) -m4_undefine(_defopt) - -if test "x$use_asciidoc" = x"auto"; then - AC_PATH_PROG(ASCIIDOC, asciidoc) - if test "x$ASCIIDOC" = "x"; then - AC_MSG_WARN(asciidoc not found - documentation targets will be skipped) - have_asciidoc=no - else - have_asciidoc=yes - fi -elif test "x$use_asciidoc" = x"yes" ; then - AC_PATH_PROG(ASCIIDOC, asciidoc) - if test "x$ASCIIDOC" = "x"; then - AC_MSG_ERROR(--with-asciidoc=yes specified but asciidoc not found in PATH) - fi - have_asciidoc=yes -elif test "x$use_asciidoc" = x"no" ; then - if test "x$ASCIIDOC" != "x"; then - AC_MSG_WARN(ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified) - fi - have_asciidoc=no -else - AC_MSG_ERROR(--with-asciidoc expects 'yes' or 'no') -fi -m4_ifval($1, -if test "$have_asciidoc" = yes; then - # scrape the asciidoc version - AC_MSG_CHECKING(the asciidoc version) - asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` - AC_MSG_RESULT($asciidoc_version) - AS_VERSION_COMPARE($asciidoc_version, $1, - if test "x$use_asciidoc" = xauto; then - AC_MSG_WARN(asciidoc version $asciidoc_version found, but $1 needed) - have_asciidoc=no - else - AC_MSG_ERROR(asciidoc version $asciidoc_version found, but $1 needed) - fi) -fi) -AM_CONDITIONAL(HAVE_ASCIIDOC, test "$have_asciidoc" = yes) -) # XORG_WITH_ASCIIDOC - -# XORG_WITH_DOXYGEN(MIN-VERSION, DEFAULT) -# ------------------------------------------- -# Minimum version: 1.5.0 -# Minimum version for optional DEFAULT argument: 1.11.0 -# Minimum version for optional DOT checking: 1.18.0 -# -# Documentation tools are not always available on all platforms and sometimes -# not at the appropriate level. This macro enables a module to test for the -# presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-doxygen option, it allows maximum flexibilty in making decisions -# as whether or not to use the doxygen package. When DEFAULT is not specified, -# --with-doxygen assumes 'auto'. -# -# Interface to module: -# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation -# DOXYGEN: returns the path of the doxygen program found -# returns the path set by the user in the environment -# --with-doxygen: 'yes' user instructs the module to use doxygen -# 'no' user instructs the module not to use doxygen -# -# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. -# -AC_DEFUN(XORG_WITH_DOXYGEN, -AC_ARG_VAR(DOXYGEN, Path to doxygen command) -AC_ARG_VAR(DOT, Path to the dot graphics utility) -m4_define(_defopt, m4_default($2, auto)) -AC_ARG_WITH(doxygen, - AS_HELP_STRING(--with-doxygen, - Use doxygen to regenerate documentation (default: _defopt)), - use_doxygen=$withval, use_doxygen=_defopt) -m4_undefine(_defopt) - -if test "x$use_doxygen" = x"auto"; then - AC_PATH_PROG(DOXYGEN, doxygen) - if test "x$DOXYGEN" = "x"; then - AC_MSG_WARN(doxygen not found - documentation targets will be skipped) - have_doxygen=no - else - have_doxygen=yes - fi -elif test "x$use_doxygen" = x"yes" ; then - AC_PATH_PROG(DOXYGEN, doxygen) - if test "x$DOXYGEN" = "x"; then - AC_MSG_ERROR(--with-doxygen=yes specified but doxygen not found in PATH) - fi - have_doxygen=yes -elif test "x$use_doxygen" = x"no" ; then - if test "x$DOXYGEN" != "x"; then - AC_MSG_WARN(ignoring DOXYGEN environment variable since --with-doxygen=no was specified) - fi - have_doxygen=no -else - AC_MSG_ERROR(--with-doxygen expects 'yes' or 'no') -fi -m4_ifval($1, -if test "$have_doxygen" = yes; then - # scrape the doxygen version - AC_MSG_CHECKING(the doxygen version) - doxygen_version=`$DOXYGEN --version 2>/dev/null` - AC_MSG_RESULT($doxygen_version) - AS_VERSION_COMPARE($doxygen_version, $1, - if test "x$use_doxygen" = xauto; then - AC_MSG_WARN(doxygen version $doxygen_version found, but $1 needed) - have_doxygen=no - else - AC_MSG_ERROR(doxygen version $doxygen_version found, but $1 needed) - fi) -fi) - -dnl Check for DOT if we have doxygen. The caller decides if it is mandatory -dnl HAVE_DOT is a variable that can be used in your doxygen.in config file: -dnl HAVE_DOT = @HAVE_DOT@ -HAVE_DOT=no -if test "x$have_doxygen" = "xyes"; then - AC_PATH_PROG(DOT, dot) - if test "x$DOT" != "x"; then - HAVE_DOT=yes - fi -fi - -AC_SUBST(HAVE_DOT) -AM_CONDITIONAL(HAVE_DOT, test "$HAVE_DOT" = "yes") -AM_CONDITIONAL(HAVE_DOXYGEN, test "$have_doxygen" = yes) -) # XORG_WITH_DOXYGEN - -# XORG_WITH_GROFF(DEFAULT) -# ---------------- -# Minimum version: 1.6.0 -# Minimum version for optional DEFAULT argument: 1.11.0 -# -# Documentation tools are not always available on all platforms and sometimes -# not at the appropriate level. This macro enables a module to test for the -# presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-groff option, it allows maximum flexibilty in making decisions -# as whether or not to use the groff package. When DEFAULT is not specified, -# --with-groff assumes 'auto'. -# -# Interface to module: -# HAVE_GROFF: used in makefiles to conditionally generate documentation -# HAVE_GROFF_MM: the memorandum macros (-mm) package -# HAVE_GROFF_MS: the -ms macros package -# GROFF: returns the path of the groff program found -# returns the path set by the user in the environment -# --with-groff: 'yes' user instructs the module to use groff -# 'no' user instructs the module not to use groff -# -# Added in version 1.9.0: -# HAVE_GROFF_HTML: groff has dependencies to output HTML format: -# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. -# psselect from the psutils package. -# the ghostcript package. Refer to the grohtml man pages -# -# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. -# -# OS and distros often splits groff in a basic and full package, the former -# having the groff program and the later having devices, fonts and macros -# Checking for the groff executable is not enough. -# -# If macros are missing, we cannot assume that groff is useless, so we don't -# unset HAVE_GROFF or GROFF env variables. -# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. -# -AC_DEFUN(XORG_WITH_GROFF, -AC_ARG_VAR(GROFF, Path to groff command) -m4_define(_defopt, m4_default($1, auto)) -AC_ARG_WITH(groff, - AS_HELP_STRING(--with-groff, - Use groff to regenerate documentation (default: _defopt)), - use_groff=$withval, use_groff=_defopt) -m4_undefine(_defopt) - -if test "x$use_groff" = x"auto"; then - AC_PATH_PROG(GROFF, groff) - if test "x$GROFF" = "x"; then - AC_MSG_WARN(groff not found - documentation targets will be skipped) - have_groff=no - else - have_groff=yes - fi -elif test "x$use_groff" = x"yes" ; then - AC_PATH_PROG(GROFF, groff) - if test "x$GROFF" = "x"; then - AC_MSG_ERROR(--with-groff=yes specified but groff not found in PATH) - fi - have_groff=yes -elif test "x$use_groff" = x"no" ; then - if test "x$GROFF" != "x"; then - AC_MSG_WARN(ignoring GROFF environment variable since --with-groff=no was specified) - fi - have_groff=no -else - AC_MSG_ERROR(--with-groff expects 'yes' or 'no') -fi - -# We have groff, test for the presence of the macro packages -if test "x$have_groff" = x"yes"; then - AC_MSG_CHECKING(for ${GROFF} -ms macros) - if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then - groff_ms_works=yes - else - groff_ms_works=no - fi - AC_MSG_RESULT($groff_ms_works) - AC_MSG_CHECKING(for ${GROFF} -mm macros) - if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then - groff_mm_works=yes - else - groff_mm_works=no - fi - AC_MSG_RESULT($groff_mm_works) -fi - -# We have groff, test for HTML dependencies, one command per package -if test "x$have_groff" = x"yes"; then - AC_PATH_PROGS(GS_PATH, gs gswin32c) - AC_PATH_PROG(PNMTOPNG_PATH, pnmtopng) - AC_PATH_PROG(PSSELECT_PATH, psselect) - if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then - have_groff_html=yes - else - have_groff_html=no - AC_MSG_WARN(grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages) - fi -fi - -# Set Automake conditionals for Makefiles -AM_CONDITIONAL(HAVE_GROFF, test "$have_groff" = yes) -AM_CONDITIONAL(HAVE_GROFF_MS, test "$groff_ms_works" = yes) -AM_CONDITIONAL(HAVE_GROFF_MM, test "$groff_mm_works" = yes) -AM_CONDITIONAL(HAVE_GROFF_HTML, test "$have_groff_html" = yes) -) # XORG_WITH_GROFF - -# XORG_WITH_FOP(MIN-VERSION, DEFAULT) -# --------------------------------------- -# Minimum version: 1.6.0 -# Minimum version for optional DEFAULT argument: 1.11.0 -# Minimum version for optional MIN-VERSION argument: 1.15.0 -# -# Documentation tools are not always available on all platforms and sometimes -# not at the appropriate level. This macro enables a module to test for the -# presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-fop option, it allows maximum flexibilty in making decisions -# as whether or not to use the fop package. When DEFAULT is not specified, -# --with-fop assumes 'auto'. -# -# Interface to module: -# HAVE_FOP: used in makefiles to conditionally generate documentation -# FOP: returns the path of the fop program found -# returns the path set by the user in the environment -# --with-fop: 'yes' user instructs the module to use fop -# 'no' user instructs the module not to use fop -# -# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. -# -AC_DEFUN(XORG_WITH_FOP, -AC_ARG_VAR(FOP, Path to fop command) -m4_define(_defopt, m4_default($2, auto)) -AC_ARG_WITH(fop, - AS_HELP_STRING(--with-fop, - Use fop to regenerate documentation (default: _defopt)), - use_fop=$withval, use_fop=_defopt) -m4_undefine(_defopt) - -if test "x$use_fop" = x"auto"; then - AC_PATH_PROG(FOP, fop) - if test "x$FOP" = "x"; then - AC_MSG_WARN(fop not found - documentation targets will be skipped) - have_fop=no - else - have_fop=yes - fi -elif test "x$use_fop" = x"yes" ; then - AC_PATH_PROG(FOP, fop) - if test "x$FOP" = "x"; then - AC_MSG_ERROR(--with-fop=yes specified but fop not found in PATH) - fi - have_fop=yes -elif test "x$use_fop" = x"no" ; then - if test "x$FOP" != "x"; then - AC_MSG_WARN(ignoring FOP environment variable since --with-fop=no was specified) - fi - have_fop=no -else - AC_MSG_ERROR(--with-fop expects 'yes' or 'no') -fi - -# Test for a minimum version of fop, if provided. -m4_ifval($1, -if test "$have_fop" = yes; then - # scrape the fop version - AC_MSG_CHECKING(for fop minimum version) - fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3` - AC_MSG_RESULT($fop_version) - AS_VERSION_COMPARE($fop_version, $1, - if test "x$use_fop" = xauto; then - AC_MSG_WARN(fop version $fop_version found, but $1 needed) - have_fop=no - else - AC_MSG_ERROR(fop version $fop_version found, but $1 needed) - fi) -fi) -AM_CONDITIONAL(HAVE_FOP, test "$have_fop" = yes) -) # XORG_WITH_FOP - -# XORG_WITH_M4(MIN-VERSION) -# --------------------------- -# Minimum version: 1.19.0 -# -# This macro attempts to locate an m4 macro processor which supports -# -I option and is only useful for modules relying on M4 in order to -# expand macros in source code files. -# -# Interface to module: -# M4: returns the path of the m4 program found -# returns the path set by the user in the environment -# -AC_DEFUN(XORG_WITH_M4, -AC_CACHE_CHECK(for m4 that supports -I option, ac_cv_path_M4, - AC_PATH_PROGS_FEATURE_CHECK(M4, m4 gm4, - $ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \ - ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:, - AC_MSG_ERROR(could not find m4 that supports -I option), - $PATH:/usr/gnu/bin)) - -AC_SUBST(M4, $ac_cv_path_M4) -) # XORG_WITH_M4 - -# XORG_WITH_PS2PDF(DEFAULT) -# ---------------- -# Minimum version: 1.6.0 -# Minimum version for optional DEFAULT argument: 1.11.0 -# -# Documentation tools are not always available on all platforms and sometimes -# not at the appropriate level. This macro enables a module to test for the -# presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-ps2pdf option, it allows maximum flexibilty in making decisions -# as whether or not to use the ps2pdf package. When DEFAULT is not specified, -# --with-ps2pdf assumes 'auto'. -# -# Interface to module: -# HAVE_PS2PDF: used in makefiles to conditionally generate documentation -# PS2PDF: returns the path of the ps2pdf program found -# returns the path set by the user in the environment -# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf -# 'no' user instructs the module not to use ps2pdf -# -# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. -# -AC_DEFUN(XORG_WITH_PS2PDF, -AC_ARG_VAR(PS2PDF, Path to ps2pdf command) -m4_define(_defopt, m4_default($1, auto)) -AC_ARG_WITH(ps2pdf, - AS_HELP_STRING(--with-ps2pdf, - Use ps2pdf to regenerate documentation (default: _defopt)), - use_ps2pdf=$withval, use_ps2pdf=_defopt) -m4_undefine(_defopt) - -if test "x$use_ps2pdf" = x"auto"; then - AC_PATH_PROG(PS2PDF, ps2pdf) - if test "x$PS2PDF" = "x"; then - AC_MSG_WARN(ps2pdf not found - documentation targets will be skipped) - have_ps2pdf=no - else - have_ps2pdf=yes - fi -elif test "x$use_ps2pdf" = x"yes" ; then - AC_PATH_PROG(PS2PDF, ps2pdf) - if test "x$PS2PDF" = "x"; then - AC_MSG_ERROR(--with-ps2pdf=yes specified but ps2pdf not found in PATH) - fi - have_ps2pdf=yes -elif test "x$use_ps2pdf" = x"no" ; then - if test "x$PS2PDF" != "x"; then - AC_MSG_WARN(ignoring PS2PDF environment variable since --with-ps2pdf=no was specified) - fi - have_ps2pdf=no -else - AC_MSG_ERROR(--with-ps2pdf expects 'yes' or 'no') -fi -AM_CONDITIONAL(HAVE_PS2PDF, test "$have_ps2pdf" = yes) -) # XORG_WITH_PS2PDF - -# XORG_ENABLE_DOCS (enable_docs=yes) -# ---------------- -# Minimum version: 1.6.0 -# -# Documentation tools are not always available on all platforms and sometimes -# not at the appropriate level. This macro enables a builder to skip all -# documentation targets except traditional man pages. -# Combined with the specific tool checking macros XORG_WITH_*, it provides -# maximum flexibilty in controlling documentation building. -# Refer to: -# XORG_WITH_XMLTO --with-xmlto -# XORG_WITH_ASCIIDOC --with-asciidoc -# XORG_WITH_DOXYGEN --with-doxygen -# XORG_WITH_FOP --with-fop -# XORG_WITH_GROFF --with-groff -# XORG_WITH_PS2PDF --with-ps2pdf -# -# Interface to module: -# ENABLE_DOCS: used in makefiles to conditionally generate documentation -# --enable-docs: 'yes' user instructs the module to generate docs -# 'no' user instructs the module not to generate docs -# parm1: specify the default value, yes or no. -# -AC_DEFUN(XORG_ENABLE_DOCS, -m4_define(docs_default, m4_default($1, yes)) -AC_ARG_ENABLE(docs, - AS_HELP_STRING(--enable-docs, - Enable building the documentation (default: docs_default)), - build_docs=$enableval, build_docs=docs_default) -m4_undefine(docs_default) -AM_CONDITIONAL(ENABLE_DOCS, test x$build_docs = xyes) -AC_MSG_CHECKING(whether to build documentation) -AC_MSG_RESULT($build_docs) -) # XORG_ENABLE_DOCS - -# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) -# ---------------- -# Minimum version: 1.6.0 -# -# This macro enables a builder to skip all developer documentation. -# Combined with the specific tool checking macros XORG_WITH_*, it provides -# maximum flexibilty in controlling documentation building. -# Refer to: -# XORG_WITH_XMLTO --with-xmlto -# XORG_WITH_ASCIIDOC --with-asciidoc -# XORG_WITH_DOXYGEN --with-doxygen -# XORG_WITH_FOP --with-fop -# XORG_WITH_GROFF --with-groff -# XORG_WITH_PS2PDF --with-ps2pdf -# -# Interface to module: -# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs -# --enable-devel-docs: 'yes' user instructs the module to generate developer docs -# 'no' user instructs the module not to generate developer docs -# parm1: specify the default value, yes or no. -# -AC_DEFUN(XORG_ENABLE_DEVEL_DOCS, -m4_define(devel_default, m4_default($1, yes)) -AC_ARG_ENABLE(devel-docs, - AS_HELP_STRING(--enable-devel-docs, - Enable building the developer documentation (default: devel_default)), - build_devel_docs=$enableval, build_devel_docs=devel_default) -m4_undefine(devel_default) -AM_CONDITIONAL(ENABLE_DEVEL_DOCS, test x$build_devel_docs = xyes) -AC_MSG_CHECKING(whether to build developer documentation) -AC_MSG_RESULT($build_devel_docs) -) # XORG_ENABLE_DEVEL_DOCS - -# XORG_ENABLE_SPECS (enable_specs=yes) -# ---------------- -# Minimum version: 1.6.0 -# -# This macro enables a builder to skip all functional specification targets. -# Combined with the specific tool checking macros XORG_WITH_*, it provides -# maximum flexibilty in controlling documentation building. -# Refer to: -# XORG_WITH_XMLTO --with-xmlto -# XORG_WITH_ASCIIDOC --with-asciidoc -# XORG_WITH_DOXYGEN --with-doxygen -# XORG_WITH_FOP --with-fop -# XORG_WITH_GROFF --with-groff -# XORG_WITH_PS2PDF --with-ps2pdf -# -# Interface to module: -# ENABLE_SPECS: used in makefiles to conditionally generate specs -# --enable-specs: 'yes' user instructs the module to generate specs -# 'no' user instructs the module not to generate specs -# parm1: specify the default value, yes or no. -# -AC_DEFUN(XORG_ENABLE_SPECS, -m4_define(spec_default, m4_default($1, yes)) -AC_ARG_ENABLE(specs, - AS_HELP_STRING(--enable-specs, - Enable building the specs (default: spec_default)), - build_specs=$enableval, build_specs=spec_default) -m4_undefine(spec_default) -AM_CONDITIONAL(ENABLE_SPECS, test x$build_specs = xyes) -AC_MSG_CHECKING(whether to build functional specifications) -AC_MSG_RESULT($build_specs) -) # XORG_ENABLE_SPECS - -# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto) -# ---------------------------------------------- -# Minimum version: 1.13.0 -# -# This macro enables a builder to enable/disable unit testing -# It makes no assumption about the test cases implementation -# Test cases may or may not use Automake "Support for test suites" -# They may or may not use the software utility library GLib -# -# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL -# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib. -# The variable enable_unit_tests is used by other macros in this file. -# -# Interface to module: -# ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests -# enable_unit_tests: used in configure.ac for additional configuration -# --enable-unit-tests: 'yes' user instructs the module to build tests -# 'no' user instructs the module not to build tests -# parm1: specify the default value, yes or no. -# -AC_DEFUN(XORG_ENABLE_UNIT_TESTS, -AC_BEFORE($0, XORG_WITH_GLIB) -AC_BEFORE($0, XORG_LD_WRAP) -AC_REQUIRE(XORG_MEMORY_CHECK_FLAGS) -m4_define(_defopt, m4_default($1, auto)) -AC_ARG_ENABLE(unit-tests, AS_HELP_STRING(--enable-unit-tests, - Enable building unit test cases (default: _defopt)), - enable_unit_tests=$enableval, enable_unit_tests=_defopt) -m4_undefine(_defopt) -AM_CONDITIONAL(ENABLE_UNIT_TESTS, test "x$enable_unit_tests" != xno) -AC_MSG_CHECKING(whether to build unit test cases) -AC_MSG_RESULT($enable_unit_tests) -) # XORG_ENABLE_UNIT_TESTS - -# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto) -# ------------------------------------------------------ -# Minimum version: 1.17.0 -# -# This macro enables a builder to enable/disable integration testing -# It makes no assumption about the test cases' implementation -# Test cases may or may not use Automake "Support for test suites" -# -# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support -# usually requires less dependencies and may be built and run under less -# stringent environments than integration tests. -# -# Interface to module: -# ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests -# enable_integration_tests: used in configure.ac for additional configuration -# --enable-integration-tests: 'yes' user instructs the module to build tests -# 'no' user instructs the module not to build tests -# parm1: specify the default value, yes or no. -# -AC_DEFUN(XORG_ENABLE_INTEGRATION_TESTS, -AC_REQUIRE(XORG_MEMORY_CHECK_FLAGS) -m4_define(_defopt, m4_default($1, auto)) -AC_ARG_ENABLE(integration-tests, AS_HELP_STRING(--enable-integration-tests, - Enable building integration test cases (default: _defopt)), - enable_integration_tests=$enableval, - enable_integration_tests=_defopt) -m4_undefine(_defopt) -AM_CONDITIONAL(ENABLE_INTEGRATION_TESTS, - test "x$enable_integration_tests" != xno) -AC_MSG_CHECKING(whether to build unit test cases) -AC_MSG_RESULT($enable_integration_tests) -) # XORG_ENABLE_INTEGRATION_TESTS - -# XORG_WITH_GLIB(MIN-VERSION, DEFAULT) -# ---------------------------------------- -# Minimum version: 1.13.0 -# -# GLib is a library which provides advanced data structures and functions. -# This macro enables a module to test for the presence of Glib. -# -# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing. -# Otherwise the value of $enable_unit_tests is blank. -# -# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit -# test support usually requires less dependencies and may be built and run under -# less stringent environments than integration tests. -# -# Interface to module: -# HAVE_GLIB: used in makefiles to conditionally build targets -# with_glib: used in configure.ac to know if GLib has been found -# --with-glib: 'yes' user instructs the module to use glib -# 'no' user instructs the module not to use glib -# -AC_DEFUN(XORG_WITH_GLIB, -AC_REQUIRE(PKG_PROG_PKG_CONFIG) -m4_define(_defopt, m4_default($2, auto)) -AC_ARG_WITH(glib, AS_HELP_STRING(--with-glib, - Use GLib library for unit testing (default: _defopt)), - with_glib=$withval, with_glib=_defopt) -m4_undefine(_defopt) - -have_glib=no -# Do not probe GLib if user explicitly disabled unit testing -if test "x$enable_unit_tests" != x"no"; then - # Do not probe GLib if user explicitly disabled it - if test "x$with_glib" != x"no"; then - m4_ifval( - $1, - PKG_CHECK_MODULES(GLIB, glib-2.0 >= $1, have_glib=yes, have_glib=no), - PKG_CHECK_MODULES(GLIB, glib-2.0, have_glib=yes, have_glib=no) - ) - fi -fi - -# Not having GLib when unit testing has been explicitly requested is an error -if test "x$enable_unit_tests" = x"yes"; then - if test "x$have_glib" = x"no"; then - AC_MSG_ERROR(--enable-unit-tests=yes specified but glib-2.0 not found) - fi -fi - -# Having unit testing disabled when GLib has been explicitly requested is an error -if test "x$enable_unit_tests" = x"no"; then - if test "x$with_glib" = x"yes"; then - AC_MSG_ERROR(--enable-unit-tests=yes specified but glib-2.0 not found) - fi -fi - -# Not having GLib when it has been explicitly requested is an error -if test "x$with_glib" = x"yes"; then - if test "x$have_glib" = x"no"; then - AC_MSG_ERROR(--with-glib=yes specified but glib-2.0 not found) - fi -fi - -AM_CONDITIONAL(HAVE_GLIB, test "$have_glib" = yes) -) # XORG_WITH_GLIB - -# XORG_LD_WRAP(required|optional) -# --------------------------------- -# Minimum version: 1.13.0 -# -# Check if linker supports -wrap, passed via compiler flags -# -# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing. -# Otherwise the value of $enable_unit_tests is blank. -# -# Argument added in 1.16.0 - default is "required", to match existing behavior -# of returning an error if enable_unit_tests is yes, and ld -wrap is not -# available, an argument of "optional" allows use when some unit tests require -# ld -wrap and others do not. -# -AC_DEFUN(XORG_LD_WRAP, -XORG_CHECK_LINKER_FLAGS(-Wl,-wrap,exit,have_ld_wrap=yes,have_ld_wrap=no, - AC_LANG_PROGRAM(#include <stdlib.h> - void __wrap_exit(int status) { return; }, - exit(0);)) -# Not having ld wrap when unit testing has been explicitly requested is an error -if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then - if test "x$have_ld_wrap" = x"no"; then - AC_MSG_ERROR(--enable-unit-tests=yes specified but ld -wrap support is not available) - fi -fi -AM_CONDITIONAL(HAVE_LD_WRAP, test "$have_ld_wrap" = yes) -# -) # XORG_LD_WRAP - -# XORG_CHECK_LINKER_FLAGS -# ----------------------- -# SYNOPSIS -# -# XORG_CHECK_LINKER_FLAGS(FLAGS, ACTION-SUCCESS, ACTION-FAILURE, PROGRAM-SOURCE) -# -# DESCRIPTION -# -# Check whether the given linker FLAGS work with the current language's -# linker, or whether they give an error. -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# PROGRAM-SOURCE is the program source to link with, if needed -# -# NOTE: Based on AX_CHECK_COMPILER_FLAGS. -# -# LICENSE -# -# Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org> -# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu> -# Copyright (c) 2009 Matteo Frigo -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well.# -AC_DEFUN(XORG_CHECK_LINKER_FLAGS, -AC_MSG_CHECKING(whether the linker accepts $1) -dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: -AS_LITERAL_IF($1, - AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_$1), - ax_save_FLAGS=$LDFLAGS - LDFLAGS="$1" - AC_LINK_IFELSE(m4_default($4,AC_LANG_PROGRAM()), - AS_TR_SH(xorg_cv_linker_flags_$1)=yes, - AS_TR_SH(xorg_cv_linker_flags_$1)=no) - LDFLAGS=$ax_save_FLAGS), - ax_save_FLAGS=$LDFLAGS - LDFLAGS="$1" - AC_LINK_IFELSE(AC_LANG_PROGRAM(), - eval AS_TR_SH(xorg_cv_linker_flags_$1)=yes, - eval AS_TR_SH(xorg_cv_linker_flags_$1)=no) - LDFLAGS=$ax_save_FLAGS) -eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_$1) -AC_MSG_RESULT($xorg_check_linker_flags) -if test "x$xorg_check_linker_flags" = xyes; then - m4_default($2, :) -else - m4_default($3, :) -fi -) # XORG_CHECK_LINKER_FLAGS - -# XORG_MEMORY_CHECK_FLAGS -# ----------------------- -# Minimum version: 1.16.0 -# -# This macro attempts to find appropriate memory checking functionality -# for various platforms which unit testing code may use to catch various -# forms of memory allocation and access errors in testing. -# -# Interface to module: -# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging -# Usually added to TESTS_ENVIRONMENT in Makefile.am -# -# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim. -# -AC_DEFUN(XORG_MEMORY_CHECK_FLAGS, - -AC_REQUIRE(AC_CANONICAL_HOST) -AC_ARG_VAR(XORG_MALLOC_DEBUG_ENV, - Environment variables to enable memory checking in tests) - -# Check for different types of support on different platforms -case $host_os in - solaris*) - AC_CHECK_LIB(umem, umem_alloc, - malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default') - ;; - *-gnu*) # GNU libc - Value is used as a single byte bit pattern, - # both directly and inverted, so should not be 0 or 255. - malloc_debug_env='MALLOC_PERTURB_=15' - ;; - darwin*) - malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib' - ;; - *bsd*) - malloc_debug_env='MallocPreScribble=1 MallocScribble=1' - ;; -esac - -# User supplied flags override default flags -if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then - malloc_debug_env="$XORG_MALLOC_DEBUG_ENV" -fi - -AC_SUBST(XORG_MALLOC_DEBUG_ENV,$malloc_debug_env) -) # XORG_WITH_LINT - -# XORG_CHECK_MALLOC_ZERO -# ---------------------- -# Minimum version: 1.0.0 -# -# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if -# malloc(0) returns NULL. Packages should add one of these cflags to -# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. -AC_DEFUN(XORG_CHECK_MALLOC_ZERO, -AC_ARG_ENABLE(malloc0returnsnull, - AS_HELP_STRING(--enable-malloc0returnsnull, - malloc(0) returns NULL (default: auto)), - MALLOC_ZERO_RETURNS_NULL=$enableval, - MALLOC_ZERO_RETURNS_NULL=auto) - -AC_MSG_CHECKING(whether malloc(0) returns NULL) -if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then -AC_CACHE_VAL(xorg_cv_malloc0_returns_null, - AC_RUN_IFELSE(AC_LANG_PROGRAM( -#include <stdlib.h> -, - char *m0, *r0, *c0, *p; - m0 = malloc(0); - p = malloc(10); - r0 = realloc(p,0); - c0 = calloc(0,10); - exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); -), - xorg_cv_malloc0_returns_null=yes, - xorg_cv_malloc0_returns_null=no)) -MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null -fi -AC_MSG_RESULT($MALLOC_ZERO_RETURNS_NULL) - -if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then - MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" - XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS - XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" -else - MALLOC_ZERO_CFLAGS="" - XMALLOC_ZERO_CFLAGS="" - XTMALLOC_ZERO_CFLAGS="" -fi - -AC_SUBST(MALLOC_ZERO_CFLAGS) -AC_SUBST(XMALLOC_ZERO_CFLAGS) -AC_SUBST(XTMALLOC_ZERO_CFLAGS) -) # XORG_CHECK_MALLOC_ZERO - -# XORG_WITH_LINT() -# ---------------- -# Minimum version: 1.1.0 -# -# This macro enables the use of a tool that flags some suspicious and -# non-portable constructs (likely to be bugs) in C language source code. -# It will attempt to locate the tool and use appropriate options. -# There are various lint type tools on different platforms. -# -# Interface to module: -# LINT: returns the path to the tool found on the platform -# or the value set to LINT on the configure cmd line -# also an Automake conditional -# LINT_FLAGS: an Automake variable with appropriate flags -# -# --with-lint: 'yes' user instructs the module to use lint -# 'no' user instructs the module not to use lint (default) -# -# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. -# If the user sets the value of LINT_FLAGS, they are used verbatim. -# -AC_DEFUN(XORG_WITH_LINT, - -AC_ARG_VAR(LINT, Path to a lint-style command) -AC_ARG_VAR(LINT_FLAGS, Flags for the lint-style command) -AC_ARG_WITH(lint, AS_HELP_STRING(--with-lint, - Use a lint-style source code checker (default: disabled)), - use_lint=$withval, use_lint=no) - -# Obtain platform specific info like program name and options -# The lint program on FreeBSD and NetBSD is different from the one on Solaris -case $host_os in - *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) - lint_name=splint - lint_options="-badflag" - ;; - *freebsd* | *netbsd*) - lint_name=lint - lint_options="-u -b" - ;; - *solaris*) - lint_name=lint - lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" - ;; -esac - -# Test for the presence of the program (either guessed by the code or spelled out by the user) -if test "x$use_lint" = x"yes" ; then - AC_PATH_PROG(LINT, $lint_name) - if test "x$LINT" = "x"; then - AC_MSG_ERROR(--with-lint=yes specified but lint-style tool not found in PATH) - fi -elif test "x$use_lint" = x"no" ; then - if test "x$LINT" != "x"; then - AC_MSG_WARN(ignoring LINT environment variable since --with-lint=no was specified) - fi -else - AC_MSG_ERROR(--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.) -fi - -# User supplied flags override default flags -if test "x$LINT_FLAGS" != "x"; then - lint_options=$LINT_FLAGS -fi - -AC_SUBST(LINT_FLAGS,$lint_options) -AM_CONDITIONAL(LINT, test "x$LINT" != x) - -) # XORG_WITH_LINT - -# XORG_LINT_LIBRARY(LIBNAME) -# -------------------------- -# Minimum version: 1.1.0 -# -# Sets up flags for building lint libraries for checking programs that call -# functions in the library. -# -# Interface to module: -# LINTLIB - Automake variable with the name of lint library file to make -# MAKE_LINT_LIB - Automake conditional -# -# --enable-lint-library: - 'yes' user instructs the module to created a lint library -# - 'no' user instructs the module not to create a lint library (default) - -AC_DEFUN(XORG_LINT_LIBRARY, -AC_REQUIRE(XORG_WITH_LINT) -AC_ARG_ENABLE(lint-library, AS_HELP_STRING(--enable-lint-library, - Create lint library (default: disabled)), - make_lint_lib=$enableval, make_lint_lib=no) - -if test "x$make_lint_lib" = x"yes" ; then - LINTLIB=llib-l$1.ln - if test "x$LINT" = "x"; then - AC_MSG_ERROR(Cannot make lint library without --with-lint) - fi -elif test "x$make_lint_lib" != x"no" ; then - AC_MSG_ERROR(--enable-lint-library expects 'yes' or 'no'.) -fi - -AC_SUBST(LINTLIB) -AM_CONDITIONAL(MAKE_LINT_LIB, test x$make_lint_lib != xno) - -) # XORG_LINT_LIBRARY - -# XORG_COMPILER_BRAND -# ------------------- -# Minimum version: 1.14.0 -# -# Checks for various brands of compilers and sets flags as appropriate: -# GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes" -# GNU g++ - relies on AC_PROG_CXX to set GXX to "yes" -# clang compiler - sets CLANGCC to "yes" -# Intel compiler - sets INTELCC to "yes" -# Sun/Oracle Solaris Studio cc - sets SUNCC to "yes" -# -AC_DEFUN(XORG_COMPILER_BRAND, -AC_LANG_CASE( - C, - AC_REQUIRE(AC_PROG_CC_C99) - , - C++, - AC_REQUIRE(AC_PROG_CXX) - -) -AC_CHECK_DECL(__clang__, CLANGCC="yes", CLANGCC="no") -AC_CHECK_DECL(__INTEL_COMPILER, INTELCC="yes", INTELCC="no") -AC_CHECK_DECL(__SUNPRO_C, SUNCC="yes", SUNCC="no") -) # XORG_COMPILER_BRAND - -# XORG_TESTSET_CFLAG(<variable>, <flag>, <alternative flag>, ...) -# --------------- -# Minimum version: 1.16.0 -# -# Test if the compiler works when passed the given flag as a command line argument. -# If it succeeds, the flag is appeneded to the given variable. If not, it tries the -# next flag in the list until there are no more options. -# -# Note that this does not guarantee that the compiler supports the flag as some -# compilers will simply ignore arguments that they do not understand, but we do -# attempt to weed out false positives by using -Werror=unknown-warning-option and -# -Werror=unused-command-line-argument -# -AC_DEFUN(XORG_TESTSET_CFLAG, -m4_if($#, 0, m4_fatal(XORG_TESTSET_CFLAG was given with an unsupported number of arguments)) -m4_if($#, 1, m4_fatal(XORG_TESTSET_CFLAG was given with an unsupported number of arguments)) - -AC_LANG_COMPILER_REQUIRE - -AC_LANG_CASE( - C, - AC_REQUIRE(AC_PROG_CC_C99) - define(PREFIX, C) - define(CACHE_PREFIX, cc) - define(COMPILER, $CC) - , - C++, - define(PREFIX, CXX) - define(CACHE_PREFIX, cxx) - define(COMPILER, $CXX) - -) - -xorg_testset_save_PREFIXFLAGS="$PREFIXFLAGS" - -if test "x$xorg_testset_CACHE_PREFIX_unknown_warning_option" = "x" ; then - PREFIXFLAGS="$PREFIXFLAGS -Werror=unknown-warning-option" - AC_CACHE_CHECK(if COMPILER supports -Werror=unknown-warning-option, - xorg_cv_CACHE_PREFIX_flag_unknown_warning_option, - AC_COMPILE_IFELSE(AC_LANG_SOURCE(int i;), - xorg_cv_CACHE_PREFIX_flag_unknown_warning_option=yes, - xorg_cv_CACHE_PREFIX_flag_unknown_warning_option=no)) - xorg_testset_CACHE_PREFIX_unknown_warning_option=$xorg_cv_CACHE_PREFIX_flag_unknown_warning_option - PREFIXFLAGS="$xorg_testset_save_PREFIXFLAGS" -fi - -if test "x$xorg_testset_CACHE_PREFIX_unused_command_line_argument" = "x" ; then - if test "x$xorg_testset_CACHE_PREFIX_unknown_warning_option" = "xyes" ; then - PREFIXFLAGS="$PREFIXFLAGS -Werror=unknown-warning-option" - fi - PREFIXFLAGS="$PREFIXFLAGS -Werror=unused-command-line-argument" - AC_CACHE_CHECK(if COMPILER supports -Werror=unused-command-line-argument, - xorg_cv_CACHE_PREFIX_flag_unused_command_line_argument, - AC_COMPILE_IFELSE(AC_LANG_SOURCE(int i;), - xorg_cv_CACHE_PREFIX_flag_unused_command_line_argument=yes, - xorg_cv_CACHE_PREFIX_flag_unused_command_line_argument=no)) - xorg_testset_CACHE_PREFIX_unused_command_line_argument=$xorg_cv_CACHE_PREFIX_flag_unused_command_line_argument - PREFIXFLAGS="$xorg_testset_save_PREFIXFLAGS" -fi - -found="no" -m4_foreach(flag, m4_cdr($@), - if test $found = "no" ; then - if test "x$xorg_testset_CACHE_PREFIX_unknown_warning_option" = "xyes" ; then - PREFIXFLAGS="$PREFIXFLAGS -Werror=unknown-warning-option" - fi - - if test "x$xorg_testset_CACHE_PREFIX_unused_command_line_argument" = "xyes" ; then - PREFIXFLAGS="$PREFIXFLAGS -Werror=unused-command-line-argument" - fi - - PREFIXFLAGS="$PREFIXFLAGS flag" - -dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname - AC_MSG_CHECKING(if COMPILER supports flag) - cacheid=AS_TR_SH(xorg_cv_CACHE_PREFIX_flag_flag) - AC_CACHE_VAL($cacheid, - AC_LINK_IFELSE(AC_LANG_PROGRAM(int i;), - eval $cacheid=yes, - eval $cacheid=no)) - - PREFIXFLAGS="$xorg_testset_save_PREFIXFLAGS" - - eval supported=\$$cacheid - AC_MSG_RESULT($supported) - if test "$supported" = "yes" ; then - $1="$$1 flag" - found="yes" - fi - fi -) -) # XORG_TESTSET_CFLAG - -# XORG_COMPILER_FLAGS -# --------------- -# Minimum version: 1.16.0 -# -# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line -# arguments supported by the selected compiler which do NOT alter the generated -# code. These arguments will cause the compiler to print various warnings -# during compilation AND turn a conservative set of warnings into errors. -# -# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in -# future versions of util-macros as options are added to new compilers. -# -AC_DEFUN(XORG_COMPILER_FLAGS, -AC_REQUIRE(XORG_COMPILER_BRAND) - -AC_ARG_ENABLE(selective-werror, - AS_HELP_STRING(--disable-selective-werror, - Turn off selective compiler errors. (default: enabled)), - SELECTIVE_WERROR=$enableval, - SELECTIVE_WERROR=yes) - -AC_LANG_CASE( - C, - define(PREFIX, C) - , - C++, - define(PREFIX, CXX) - -) -# -v is too short to test reliably with XORG_TESTSET_CFLAG -if test "x$SUNCC" = "xyes"; then - BASE_PREFIXFLAGS="-v" -else - BASE_PREFIXFLAGS="" -fi - -# This chunk of warnings were those that existed in the legacy CWARNFLAGS -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wall) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wpointer-arith) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wmissing-declarations) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wformat=2, -Wformat) - -AC_LANG_CASE( - C, - XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wstrict-prototypes) - XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wmissing-prototypes) - XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wnested-externs) - XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wbad-function-cast) - XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wold-style-definition, -fd) - XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wdeclaration-after-statement) - -) - -# This chunk adds additional warnings that could catch undesired effects. -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wunused) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wuninitialized) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wshadow) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wmissing-noreturn) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wmissing-format-attribute) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wredundant-decls) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wlogical-op) - -# These are currently disabled because they are noisy. They will be enabled -# in the future once the codebase is sufficiently modernized to silence -# them. For now, I don't want them to drown out the other warnings. -# XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wparentheses) -# XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wcast-align) -# XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wcast-qual) - -# Turn some warnings into errors, so we don't accidently get successful builds -# when there are problems that should be fixed. - -if test "x$SELECTIVE_WERROR" = "xyes" ; then -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=implicit, -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=nonnull) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=init-self) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=main) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=missing-braces) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=sequence-point) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=return-type, -errwarn=E_FUNC_HAS_NO_RETURN_STMT) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=trigraphs) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=array-bounds) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=write-strings) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=address) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=int-to-pointer-cast, -errwarn=E_BAD_PTR_INT_COMBINATION) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=pointer-to-int-cast) # Also -errwarn=E_BAD_PTR_INT_COMBINATION -else -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) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wimplicit) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wnonnull) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Winit-self) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wmain) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wmissing-braces) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wsequence-point) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wreturn-type) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wtrigraphs) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Warray-bounds) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wwrite-strings) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Waddress) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wint-to-pointer-cast) -XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wpointer-to-int-cast) -fi - -AC_SUBST(BASE_PREFIXFLAGS) -) # XORG_COMPILER_FLAGS - -# XORG_CWARNFLAGS -# --------------- -# Minimum version: 1.2.0 -# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead) -# -# Defines CWARNFLAGS to enable C compiler warnings. -# -# This function is deprecated because it defines -fno-strict-aliasing -# which alters the code generated by the compiler. If -fno-strict-aliasing -# is needed, then it should be added explicitly in the module when -# it is updated to use BASE_CFLAGS. -# -AC_DEFUN(XORG_CWARNFLAGS, -AC_REQUIRE(XORG_COMPILER_FLAGS) -AC_REQUIRE(XORG_COMPILER_BRAND) -AC_LANG_CASE( - C, - CWARNFLAGS="$BASE_CFLAGS" - if test "x$GCC" = xyes ; then - CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing" - fi - AC_SUBST(CWARNFLAGS) - -) -) # XORG_CWARNFLAGS - -# XORG_STRICT_OPTION -# ----------------------- -# Minimum version: 1.3.0 -# -# Add configure option to enable strict compilation flags, such as treating -# warnings as fatal errors. -# If --enable-strict-compilation is passed to configure, adds strict flags to -# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS. -# -# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or -# when strict compilation is unconditionally desired. -AC_DEFUN(XORG_STRICT_OPTION, -AC_REQUIRE(XORG_CWARNFLAGS) -AC_REQUIRE(XORG_COMPILER_FLAGS) - -AC_ARG_ENABLE(strict-compilation, - AS_HELP_STRING(--enable-strict-compilation, - Enable all warnings from compiler and make them errors (default: disabled)), - STRICT_COMPILE=$enableval, STRICT_COMPILE=no) - -AC_LANG_CASE( - C, - define(PREFIX, C) - , - C++, - define(PREFIX, CXX) - -) - -STRICT_PREFIXFLAGS="" -XORG_TESTSET_CFLAG(STRICT_PREFIXFLAGS, -pedantic) -XORG_TESTSET_CFLAG(STRICT_PREFIXFLAGS, -Werror, -errwarn) - -# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not -# activate it with -Werror, so we add it here explicitly. -XORG_TESTSET_CFLAG(STRICT_PREFIXFLAGS, -Werror=attributes) - -if test "x$STRICT_COMPILE" = "xyes"; then - BASE_PREFIXFLAGS="$BASE_PREFIXFLAGS $STRICT_PREFIXFLAGS" - AC_LANG_CASE(C, CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS") -fi -AC_SUBST(STRICT_PREFIXFLAGS) -AC_SUBST(BASE_PREFIXFLAGS) -AC_LANG_CASE(C, AC_SUBST(CWARNFLAGS)) -) # XORG_STRICT_OPTION - -# XORG_DEFAULT_OPTIONS -# -------------------- -# Minimum version: 1.3.0 -# -# Defines default options for X.Org modules. -# -AC_DEFUN(XORG_DEFAULT_OPTIONS, -AC_REQUIRE(AC_PROG_INSTALL) -XORG_COMPILER_FLAGS -XORG_CWARNFLAGS -XORG_STRICT_OPTION -XORG_RELEASE_VERSION -XORG_CHANGELOG -XORG_INSTALL -XORG_MANPAGE_SECTIONS -m4_ifdef(AM_SILENT_RULES, AM_SILENT_RULES(yes), - AC_SUBST(AM_DEFAULT_VERBOSITY, 1)) -) # XORG_DEFAULT_OPTIONS - -# XORG_INSTALL() -# ---------------- -# Minimum version: 1.4.0 -# -# Defines the variable INSTALL_CMD as the command to copy -# INSTALL from $prefix/share/util-macros. -# -AC_DEFUN(XORG_INSTALL, -AC_REQUIRE(PKG_PROG_PKG_CONFIG) -macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` -INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ -mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ -|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \ -touch \$(top_srcdir)/INSTALL; \ -echo 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))" -AC_SUBST(INSTALL_CMD) -) # XORG_INSTALL -dnl Copyright 2005 Red Hat, Inc -dnl -dnl Permission to use, copy, modify, distribute, and sell this software and its -dnl documentation for any purpose is hereby granted without fee, provided that -dnl the above copyright notice appear in all copies and that both that -dnl copyright notice and this permission notice appear in supporting -dnl documentation. -dnl -dnl The above copyright notice and this permission notice shall be included -dnl in all copies or substantial portions of the Software. -dnl -dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -dnl OTHER DEALINGS IN THE SOFTWARE. -dnl -dnl Except as contained in this notice, the name of the copyright holders shall -dnl not be used in advertising or otherwise to promote the sale, use or -dnl other dealings in this Software without prior written authorization -dnl from the copyright holders. -dnl - -# XORG_RELEASE_VERSION -# -------------------- -# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. - -AC_DEFUN(XORG_RELEASE_VERSION, - AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR, - `echo $PACKAGE_VERSION | cut -d . -f 1`, - Major version of this package) - PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` - if test "x$PVM" = "x"; then - PVM="0" - fi - AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR, - $PVM, - Minor version of this package) - PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` - if test "x$PVP" = "x"; then - PVP="0" - fi - AC_DEFINE_UNQUOTED(PACKAGE_VERSION_PATCHLEVEL, - $PVP, - Patch version of this package) -) - -# XORG_CHANGELOG() -# ---------------- -# Minimum version: 1.2.0 -# -# Defines the variable CHANGELOG_CMD as the command to generate -# ChangeLog from git. -# -# -AC_DEFUN(XORG_CHANGELOG, -CHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \ -mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ -|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \ -touch \$(top_srcdir)/ChangeLog; \ -echo 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))" -AC_SUBST(CHANGELOG_CMD) -) # XORG_CHANGELOG - # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -3372,7 +54,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. ) -# serial 58 LT_INIT +# serial 59 LT_INIT # LT_PREREQ(VERSION) @@ -3522,6 +204,7 @@ m4_require(_LT_CHECK_SHELL_FEATURES)dnl m4_require(_LT_PATH_CONVERSION_FUNCTIONS)dnl m4_require(_LT_CMD_RELOAD)dnl +m4_require(_LT_DECL_FILECMD)dnl m4_require(_LT_CHECK_MAGIC_METHOD)dnl m4_require(_LT_CHECK_SHAREDLIB_FROM_LINKLIB)dnl m4_require(_LT_CMD_OLD_ARCHIVE)dnl @@ -3560,8 +243,8 @@ ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -4063,7 +746,6 @@ cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. @@ -4113,7 +795,7 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || @@ -4375,8 +1057,8 @@ _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF @@ -4400,17 +1082,12 @@ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin91*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.012,.*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.012,*|,*powerpc*-darwin5-8*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -4459,12 +1136,12 @@ output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if($1, CXX, if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ,) else @@ -4578,7 +1255,8 @@ # _LT_WITH_SYSROOT # ---------------- AC_DEFUN(_LT_WITH_SYSROOT, -AC_MSG_CHECKING(for sysroot) +m4_require(_LT_DECL_SED)dnl +AC_MSG_CHECKING(for sysroot) AC_ARG_WITH(sysroot, AS_HELP_STRING(--with-sysroot@<:@=DIR@:>@, Search for dependent libraries within DIR (or the compiler's sysroot @@ -4595,7 +1273,7 @@ fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -4625,7 +1303,7 @@ # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -4642,7 +1320,7 @@ echo '#line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -4654,7 +1332,7 @@ ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -4676,7 +1354,7 @@ echo '#line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -4684,7 +1362,7 @@ emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -4692,7 +1370,7 @@ emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -4712,14 +1390,14 @@ # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -4787,7 +1465,7 @@ # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -4826,9 +1504,22 @@ m4_defun(_LT_PROG_AR, AC_CHECK_TOOLS(AR, ar, false) : ${AR=ar} -: ${AR_FLAGS=cru} _LT_DECL(, AR, 1, The archiver) -_LT_DECL(, AR_FLAGS, 1, Flags to create an archive) + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS +_LT_DECL(, lt_ar_flags, 0, Flags to create an archive (by configure)) + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. +_LT_DECL(, AR_FLAGS, \@S|@{ARFLAGS-"\@S|@lt_ar_flags"}, + Flags to create an archive) AC_CACHE_CHECK(for archiver @FILE support, lt_cv_ar_at_file, lt_cv_ar_at_file=no @@ -5047,7 +1738,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -5090,7 +1781,7 @@ sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.* //'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.* //'` else lt_cv_sys_max_cmd_len=32768 fi @@ -5540,26 +2231,35 @@ striplib= old_striplib= AC_MSG_CHECKING(whether stripping libraries is possible) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT(yes) +if test -z "$STRIP"; then + AC_MSG_RESULT(no) else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT(yes) + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT(yes) - else + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + ;; + *) AC_MSG_RESULT(no) - fi - ;; - *) - AC_MSG_RESULT(no) - ;; - esac + ;; + esac + fi fi _LT_DECL(, old_striplib, 1, Commands to strip libraries) _LT_DECL(, striplib, 1) @@ -5882,7 +2582,7 @@ case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' m4_if($1, , sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api") ;; @@ -5892,14 +2592,14 @@ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -5918,7 +2618,7 @@ done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\(a-zA-Z\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\(a-zA-Z\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -5955,7 +2655,7 @@ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -5988,7 +2688,7 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -6220,6 +2920,18 @@ dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -6787,7 +3499,7 @@ bsdi45*) lt_cv_deplibs_check_method='file_magic ELF 0-90-9*-bit MLSB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -6821,14 +3533,14 @@ lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i3-986 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -6842,7 +3554,7 @@ ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s0-90-90-9|ELF-0-90-9) shared object file - IA64' @@ -6879,7 +3591,7 @@ lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib^/+(\.so\.0-9+\.0-9+|_pic\.a)$' else @@ -6889,7 +3601,7 @@ newos6*) lt_cv_deplibs_check_method='file_magic ELF 0-90-9*-bit MLSB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -7016,13 +3728,13 @@ mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -7048,7 +3760,7 @@ # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, dumpbin "link -dump", :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -7288,7 +4000,7 @@ if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -7306,20 +4018,20 @@ # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -7343,7 +4055,7 @@ if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ @@ -7361,9 +4073,9 @@ " s1~prfx {split(s1,t,\"@\"); print f,t1,substr(t1,length(prfx))}"\ " ' prfx=^$ac_symprfx" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.* \($symcode$symcode*\) *$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.* \($symcode$symcode*\) *$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -7385,7 +4097,8 @@ if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -7650,7 +4363,7 @@ ;; esac ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -7733,7 +4446,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -7757,7 +4470,7 @@ ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -8025,6 +4738,12 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) @@ -8069,7 +4788,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ 1-7.* | *Sun*Fortran*\ 8.0-3*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -8252,7 +4971,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\(^B*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\(^B*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -8260,7 +4979,7 @@ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -8269,6 +4988,9 @@ ;; esac ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -8317,20 +5039,23 @@ case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes @@ -8377,7 +5102,7 @@ _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ 01.* | *\ 2.0-9.* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -8489,6 +5214,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; interix3-9*) @@ -8503,7 +5229,7 @@ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -8546,7 +5272,7 @@ _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes @@ -8558,13 +5284,14 @@ if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) @@ -8574,7 +5301,7 @@ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -8585,7 +5312,7 @@ fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -8706,7 +5433,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\(^B*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\(^B*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -8889,12 +5616,12 @@ cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes @@ -8935,7 +5662,7 @@ fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. @@ -8983,7 +5710,7 @@ ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes @@ -9106,6 +5833,7 @@ if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi + _LT_TAGVAR(link_all_deplibs, $1)=no else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' @@ -9123,11 +5851,12 @@ # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -9194,6 +5923,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) @@ -9749,7 +6479,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else GXX=no @@ -9960,8 +6690,8 @@ cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' @@ -10059,6 +6789,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) @@ -10089,7 +6820,7 @@ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes @@ -10124,7 +6855,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -10189,7 +6920,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -10226,7 +6957,7 @@ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in @@ -10366,13 +7097,13 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -10528,7 +7259,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # FIXME: insert proper C++ library support @@ -10612,7 +7343,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. @@ -10623,7 +7354,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' @@ -11510,6 +8241,14 @@ AC_SUBST(DLLTOOL) ) +# _LT_DECL_FILECMD +# ---------------- +# Check for a file(cmd) program that can be used to detect file type and magic +m4_defun(_LT_DECL_FILECMD, +AC_CHECK_TOOL(FILECMD, file, :) +_LT_DECL(, FILECMD, 1, A file(cmd) program that detects file types) +)# _LD_DECL_FILECMD + # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates @@ -11689,8 +8428,8 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives @@ -12121,7 +8860,7 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # @@ -12246,7 +8985,8 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, +# Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -12255,23 +8995,23 @@ # @configure_input@ -# serial 4179 ltversion.m4 +# serial 4245 ltversion.m4 # This file is part of GNU Libtool -m4_define(LT_PACKAGE_VERSION, 2.4.6) -m4_define(LT_PACKAGE_REVISION, 2.4.6) +m4_define(LT_PACKAGE_VERSION, 2.4.7) +m4_define(LT_PACKAGE_REVISION, 2.4.7) AC_DEFUN(LTVERSION_VERSION, -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.4.7' +macro_revision='2.4.7' _LT_DECL(, macro_version, 0, Which release of libtool.m4 was used?) _LT_DECL(, macro_revision, 0) ) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives @@ -12368,3 +9108,3326 @@ m4_ifndef(_LT_PROG_FC, AC_DEFUN(_LT_PROG_FC)) m4_ifndef(_LT_PROG_CXX, AC_DEFUN(_LT_PROG_CXX)) +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 12 (pkg-config-0.29.2) + +dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. +dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef(PKG_PREREQ, +dnl m4_fatal(must install pkg-config 0.29 or later before running autoconf/autogen)) +dnl +dnl See the "Since" comment for each macro you use to see what version +dnl of the macros you require. +m4_defun(PKG_PREREQ, +m4_define(PKG_MACROS_VERSION, 0.29.2) +m4_if(m4_version_compare(PKG_MACROS_VERSION, $1), -1, + m4_fatal(pkg.m4 version $1 or higher is required but PKG_MACROS_VERSION found)) +)dnl PKG_PREREQ + +dnl PKG_PROG_PKG_CONFIG(MIN-VERSION) +dnl ---------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. +AC_DEFUN(PKG_PROG_PKG_CONFIG, +m4_pattern_forbid(^_?PKG_A-Z_+$) +m4_pattern_allow(^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$) +m4_pattern_allow(^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$) +AC_ARG_VAR(PKG_CONFIG, path to pkg-config utility) +AC_ARG_VAR(PKG_CONFIG_PATH, directories to add to pkg-config's search path) +AC_ARG_VAR(PKG_CONFIG_LIBDIR, path overriding pkg-config's built-in search path) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL(PKG_CONFIG, pkg-config) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default($1, 0.9.0) + AC_MSG_CHECKING(pkg-config is at least version $_pkg_min_version) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + PKG_CONFIG="" + fi +fidnl +)dnl PKG_PROG_PKG_CONFIG + +dnl PKG_CHECK_EXISTS(MODULES, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE(PKG_PROG_PKG_CONFIG) +dnl only at the first occurence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually +AC_DEFUN(PKG_CHECK_EXISTS, +AC_REQUIRE(PKG_PROG_PKG_CONFIG)dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG($PKG_CONFIG --exists --print-errors "$1"); then + m4_default($2, :) +m4_ifvaln($3, else + $3)dnl +fi) + +dnl _PKG_CONFIG(VARIABLE, COMMAND, MODULES) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. +m4_define(_PKG_CONFIG, +if test -n "$$1"; then + pkg_cv_$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS($3, + pkg_cv_$1=`$PKG_CONFIG --$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes , + pkg_failed=yes) + else + pkg_failed=untried +fidnl +)dnl _PKG_CONFIG + +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. +AC_DEFUN(_PKG_SHORT_ERRORS_SUPPORTED, +AC_REQUIRE(PKG_PROG_PKG_CONFIG) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fidnl +)dnl _PKG_SHORT_ERRORS_SUPPORTED + + +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, ACTION-IF-FOUND, +dnl ACTION-IF-NOT-FOUND) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +AC_DEFUN(PKG_CHECK_MODULES, +AC_REQUIRE(PKG_PROG_PKG_CONFIG)dnl +AC_ARG_VAR($1_CFLAGS, C compiler flags for $1, overriding pkg-config)dnl +AC_ARG_VAR($1_LIBS, linker flags for $1, overriding pkg-config)dnl + +pkg_failed=no +AC_MSG_CHECKING(for $2) + +_PKG_CONFIG($1_CFLAGS, cflags, $2) +_PKG_CONFIG($1_LIBS, libs, $2) + +m4_define(_PKG_TEXT, Alternatively, you may set the environment variables $1_CFLAGS +and $1_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.) + +if test $pkg_failed = yes; then + AC_MSG_RESULT(no) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default($4, AC_MSG_ERROR( +Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT)dnl + ) +elif test $pkg_failed = untried; then + AC_MSG_RESULT(no) + m4_default($4, AC_MSG_FAILURE( +The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see <http://pkg-config.freedesktop.org/>.)dnl + ) +else + $1_CFLAGS=$pkg_cv_$1_CFLAGS + $1_LIBS=$pkg_cv_$1_LIBS + AC_MSG_RESULT(yes) + $3 +fidnl +)dnl PKG_CHECK_MODULES + + +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, ACTION-IF-FOUND, +dnl ACTION-IF-NOT-FOUND) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl +dnl Checks for existence of MODULES and gathers its build flags with +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags +dnl and VARIABLE-PREFIX_LIBS from --libs. +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your +dnl configure.ac. +AC_DEFUN(PKG_CHECK_MODULES_STATIC, +AC_REQUIRE(PKG_PROG_PKG_CONFIG)dnl +_save_PKG_CONFIG=$PKG_CONFIG +PKG_CONFIG="$PKG_CONFIG --static" +PKG_CHECK_MODULES($@) +PKG_CONFIG=$_save_PKG_CONFIGdnl +)dnl PKG_CHECK_MODULES_STATIC + + +dnl PKG_INSTALLDIR(DIRECTORY) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. +AC_DEFUN(PKG_INSTALLDIR, +m4_pushdef(pkg_default, m4_default($1, '${libdir}/pkgconfig')) +m4_pushdef(pkg_description, + pkg-config installation directory @<:@pkg_default@:>@) +AC_ARG_WITH(pkgconfigdir, + AS_HELP_STRING(--with-pkgconfigdir, pkg_description),, + with_pkgconfigdir=pkg_default) +AC_SUBST(pkgconfigdir, $with_pkgconfigdir) +m4_popdef(pkg_default) +m4_popdef(pkg_description) +)dnl PKG_INSTALLDIR + + +dnl PKG_NOARCH_INSTALLDIR(DIRECTORY) +dnl -------------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable noarch_pkgconfigdir as the location where a +dnl module should install arch-independent pkg-config .pc files. By +dnl default the directory is $datadir/pkgconfig, but the default can be +dnl changed by passing DIRECTORY. The user can override through the +dnl --with-noarch-pkgconfigdir parameter. +AC_DEFUN(PKG_NOARCH_INSTALLDIR, +m4_pushdef(pkg_default, m4_default($1, '${datadir}/pkgconfig')) +m4_pushdef(pkg_description, + pkg-config arch-independent installation directory @<:@pkg_default@:>@) +AC_ARG_WITH(noarch-pkgconfigdir, + AS_HELP_STRING(--with-noarch-pkgconfigdir, pkg_description),, + with_noarch_pkgconfigdir=pkg_default) +AC_SUBST(noarch_pkgconfigdir, $with_noarch_pkgconfigdir) +m4_popdef(pkg_default) +m4_popdef(pkg_description) +)dnl PKG_NOARCH_INSTALLDIR + + +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +dnl ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) +dnl ------------------------------------------- +dnl Since: 0.28 +dnl +dnl Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN(PKG_CHECK_VAR, +AC_REQUIRE(PKG_PROG_PKG_CONFIG)dnl +AC_ARG_VAR($1, value of $3 for $2, overriding pkg-config)dnl + +_PKG_CONFIG($1, variable="$3", $2) +AS_VAR_COPY($1, pkg_cv_$1) + +AS_VAR_IF($1, "", $5, $4)dnl +)dnl PKG_CHECK_VAR + +dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. +dnl +dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. +dnl +dnl Permission is hereby granted, free of charge, to any person obtaining a +dnl copy of this software and associated documentation files (the "Software"), +dnl to deal in the Software without restriction, including without limitation +dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, +dnl and/or sell copies of the Software, and to permit persons to whom the +dnl Software is furnished to do so, subject to the following conditions: +dnl +dnl The above copyright notice and this permission notice (including the next +dnl paragraph) shall be included in all copies or substantial portions of the +dnl Software. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +dnl DEALINGS IN THE SOFTWARE. + +# XORG_MACROS_VERSION(required-version) +# ------------------------------------- +# Minimum version: 1.1.0 +# +# If you're using a macro added in Version 1.1 or newer, include this in +# your configure.ac with the minimum required version, such as: +# XORG_MACROS_VERSION(1.1) +# +# To ensure that this macro is defined, also add: +# m4_ifndef(XORG_MACROS_VERSION, +# m4_fatal(must install xorg-macros 1.1 or later before running autoconf/autogen)) +# +# +# See the "minimum version" comment for each macro you use to see what +# version you require. +m4_defun(XORG_MACROS_VERSION, +m4_define(vers_have, 1.19.3) +m4_define(maj_have, m4_substr(vers_have, 0, m4_index(vers_have, .))) +m4_define(maj_needed, m4_substr($1, 0, m4_index($1, .))) +m4_if(m4_cmp(maj_have, maj_needed), 0,, + m4_fatal(xorg-macros major version maj_needed is required but vers_have found)) +m4_if(m4_version_compare(vers_have, $1), -1, + m4_fatal(xorg-macros version $1 or higher is required but vers_have found)) +m4_undefine(vers_have) +m4_undefine(maj_have) +m4_undefine(maj_needed) +) # XORG_MACROS_VERSION + +# XORG_PROG_RAWCPP() +# ------------------ +# Minimum version: 1.0.0 +# +# Find cpp program and necessary flags for use in pre-processing text files +# such as man pages and config files +AC_DEFUN(XORG_PROG_RAWCPP, +AC_REQUIRE(AC_PROG_CPP) +AC_PATH_TOOL(RAWCPP, cpp, ${CPP}, + $PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib) + +# Check for flag to avoid builtin definitions - assumes unix is predefined, +# which is not the best choice for supporting other OS'es, but covers most +# of the ones we need for now. +AC_MSG_CHECKING(if $RAWCPP requires -undef) +AC_LANG_CONFTEST(AC_LANG_SOURCE(Does cpp redefine unix ?)) +if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then + AC_MSG_RESULT(no) +else + if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then + RAWCPPFLAGS=-undef + AC_MSG_RESULT(yes) + # under Cygwin unix is still defined even with -undef + elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then + RAWCPPFLAGS="-undef -ansi" + AC_MSG_RESULT(yes, with -ansi) + else + AC_MSG_ERROR(${RAWCPP} defines unix with or without -undef. I don't know what to do.) + fi +fi +rm -f conftest.$ac_ext + +AC_MSG_CHECKING(if $RAWCPP requires -traditional) +AC_LANG_CONFTEST(AC_LANG_SOURCE(Does cpp preserve "whitespace"?)) +if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then + AC_MSG_RESULT(no) +else + if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then + TRADITIONALCPPFLAGS="-traditional" + RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" + AC_MSG_RESULT(yes) + else + AC_MSG_ERROR(${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.) + fi +fi +rm -f conftest.$ac_ext +AC_SUBST(RAWCPPFLAGS) +AC_SUBST(TRADITIONALCPPFLAGS) +) # XORG_PROG_RAWCPP + +# XORG_MANPAGE_SECTIONS() +# ----------------------- +# Minimum version: 1.0.0 +# +# Determine which sections man pages go in for the different man page types +# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. +# Not sure if there's any better way than just hardcoding by OS name. +# Override default settings by setting environment variables +# Added MAN_SUBSTS in version 1.8 +# Added AC_PROG_SED in version 1.8 + +AC_DEFUN(XORG_MANPAGE_SECTIONS, +AC_REQUIRE(AC_CANONICAL_HOST) +AC_REQUIRE(AC_PROG_SED) + +case $host_os in + solaris*) + # Solaris 2.0 - 11.3 use SysV man page section numbers, so we + # check for a man page file found in later versions that use + # traditional section numbers instead + AC_CHECK_FILE(/usr/share/man/man7/attributes.7, + SYSV_MAN_SECTIONS=false, SYSV_MAN_SECTIONS=true) + ;; + *) SYSV_MAN_SECTIONS=false ;; +esac + +if test x$APP_MAN_SUFFIX = x ; then + APP_MAN_SUFFIX=1 +fi +if test x$APP_MAN_DIR = x ; then + APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' +fi + +if test x$LIB_MAN_SUFFIX = x ; then + LIB_MAN_SUFFIX=3 +fi +if test x$LIB_MAN_DIR = x ; then + LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' +fi + +if test x$FILE_MAN_SUFFIX = x ; then + case $SYSV_MAN_SECTIONS in + true) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; + esac +fi +if test x$FILE_MAN_DIR = x ; then + FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' +fi + +if test x$MISC_MAN_SUFFIX = x ; then + case $SYSV_MAN_SECTIONS in + true) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; + esac +fi +if test x$MISC_MAN_DIR = x ; then + MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' +fi + +if test x$DRIVER_MAN_SUFFIX = x ; then + case $SYSV_MAN_SECTIONS in + true) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; + esac +fi +if test x$DRIVER_MAN_DIR = x ; then + DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' +fi + +if test x$ADMIN_MAN_SUFFIX = x ; then + case $SYSV_MAN_SECTIONS in + true) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; + esac +fi +if test x$ADMIN_MAN_DIR = x ; then + ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' +fi + + +AC_SUBST(APP_MAN_SUFFIX) +AC_SUBST(LIB_MAN_SUFFIX) +AC_SUBST(FILE_MAN_SUFFIX) +AC_SUBST(MISC_MAN_SUFFIX) +AC_SUBST(DRIVER_MAN_SUFFIX) +AC_SUBST(ADMIN_MAN_SUFFIX) +AC_SUBST(APP_MAN_DIR) +AC_SUBST(LIB_MAN_DIR) +AC_SUBST(FILE_MAN_DIR) +AC_SUBST(MISC_MAN_DIR) +AC_SUBST(DRIVER_MAN_DIR) +AC_SUBST(ADMIN_MAN_DIR) + +XORG_MAN_PAGE="X Version 11" +AC_SUBST(XORG_MAN_PAGE) +MAN_SUBSTS="\ + -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ + -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ + -e 's|__xservername__|Xorg|g' \ + -e 's|__xconfigfile__|xorg.conf|g' \ + -e 's|__projectroot__|\$(prefix)|g' \ + -e 's|__apploaddir__|\$(appdefaultdir)|g' \ + -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ + -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ + -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ + -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" +AC_SUBST(MAN_SUBSTS) + +) # XORG_MANPAGE_SECTIONS + +# XORG_CHECK_SGML_DOCTOOLS(MIN-VERSION) +# ------------------------ +# Minimum version: 1.7.0 +# +# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent +# provided by xorg-sgml-doctools, if installed. +AC_DEFUN(XORG_CHECK_SGML_DOCTOOLS, +AC_MSG_CHECKING(for X.Org SGML entities m4_ifval($1,>= $1)) +XORG_SGML_PATH= +PKG_CHECK_EXISTS(xorg-sgml-doctools m4_ifval($1,>= $1), + XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`, + m4_ifval($1,:, + if test x"$cross_compiling" != x"yes" ; then + AC_CHECK_FILE($prefix/share/sgml/X11/defs.ent, + XORG_SGML_PATH=$prefix/share/sgml) + fi) + ) + +# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing +# the path and the name of the doc stylesheet +if test "x$XORG_SGML_PATH" != "x" ; then + AC_MSG_RESULT($XORG_SGML_PATH) + STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 + XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl +else + AC_MSG_RESULT(no) +fi + +AC_SUBST(XORG_SGML_PATH) +AC_SUBST(STYLESHEET_SRCDIR) +AC_SUBST(XSL_STYLESHEET) +AM_CONDITIONAL(HAVE_STYLESHEETS, test "x$XSL_STYLESHEET" != "x") +) # XORG_CHECK_SGML_DOCTOOLS + +# XORG_CHECK_LINUXDOC +# ------------------- +# Minimum version: 1.0.0 +# +# Defines the variable MAKE_TEXT if the necessary tools and +# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. +# Whether or not the necessary tools and files are found can be checked +# with the AM_CONDITIONAL "BUILD_LINUXDOC" +AC_DEFUN(XORG_CHECK_LINUXDOC, +AC_REQUIRE(XORG_CHECK_SGML_DOCTOOLS) +AC_REQUIRE(XORG_WITH_PS2PDF) + +AC_PATH_PROG(LINUXDOC, linuxdoc) + +AC_MSG_CHECKING(whether to build documentation) + +if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then + BUILDDOC=yes +else + BUILDDOC=no +fi + +AM_CONDITIONAL(BUILD_LINUXDOC, test x$BUILDDOC = xyes) + +AC_MSG_RESULT($BUILDDOC) + +AC_MSG_CHECKING(whether to build pdf documentation) + +if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then + BUILDPDFDOC=yes +else + BUILDPDFDOC=no +fi + +AM_CONDITIONAL(BUILD_PDFDOC, test x$BUILDPDFDOC = xyes) + +AC_MSG_RESULT($BUILDPDFDOC) + +MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" +MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" +MAKE_PDF="$PS2PDF" +MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" + +AC_SUBST(MAKE_TEXT) +AC_SUBST(MAKE_PS) +AC_SUBST(MAKE_PDF) +AC_SUBST(MAKE_HTML) +) # XORG_CHECK_LINUXDOC + +# XORG_CHECK_DOCBOOK +# ------------------- +# Minimum version: 1.0.0 +# +# Checks for the ability to build output formats from SGML DocBook source. +# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" +# indicates whether the necessary tools and files are found and, if set, +# $(MAKE_XXX) blah.sgml will produce blah.xxx. +AC_DEFUN(XORG_CHECK_DOCBOOK, +AC_REQUIRE(XORG_CHECK_SGML_DOCTOOLS) + +BUILDTXTDOC=no +BUILDPDFDOC=no +BUILDPSDOC=no +BUILDHTMLDOC=no + +AC_PATH_PROG(DOCBOOKPS, docbook2ps) +AC_PATH_PROG(DOCBOOKPDF, docbook2pdf) +AC_PATH_PROG(DOCBOOKHTML, docbook2html) +AC_PATH_PROG(DOCBOOKTXT, docbook2txt) + +AC_MSG_CHECKING(whether to build text documentation) +if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && + test x$BUILD_TXTDOC != xno; then + BUILDTXTDOC=yes +fi +AM_CONDITIONAL(BUILD_TXTDOC, test x$BUILDTXTDOC = xyes) +AC_MSG_RESULT($BUILDTXTDOC) + +AC_MSG_CHECKING(whether to build PDF documentation) +if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && + test x$BUILD_PDFDOC != xno; then + BUILDPDFDOC=yes +fi +AM_CONDITIONAL(BUILD_PDFDOC, test x$BUILDPDFDOC = xyes) +AC_MSG_RESULT($BUILDPDFDOC) + +AC_MSG_CHECKING(whether to build PostScript documentation) +if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && + test x$BUILD_PSDOC != xno; then + BUILDPSDOC=yes +fi +AM_CONDITIONAL(BUILD_PSDOC, test x$BUILDPSDOC = xyes) +AC_MSG_RESULT($BUILDPSDOC) + +AC_MSG_CHECKING(whether to build HTML documentation) +if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && + test x$BUILD_HTMLDOC != xno; then + BUILDHTMLDOC=yes +fi +AM_CONDITIONAL(BUILD_HTMLDOC, test x$BUILDHTMLDOC = xyes) +AC_MSG_RESULT($BUILDHTMLDOC) + +MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" +MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" +MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" +MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" + +AC_SUBST(MAKE_TEXT) +AC_SUBST(MAKE_PS) +AC_SUBST(MAKE_PDF) +AC_SUBST(MAKE_HTML) +) # XORG_CHECK_DOCBOOK + +# XORG_WITH_XMLTO(MIN-VERSION, DEFAULT) +# ---------------- +# Minimum version: 1.5.0 +# Minimum version for optional DEFAULT argument: 1.11.0 +# +# Documentation tools are not always available on all platforms and sometimes +# not at the appropriate level. This macro enables a module to test for the +# presence of the tool and obtain it's path in separate variables. Coupled with +# the --with-xmlto option, it allows maximum flexibilty in making decisions +# as whether or not to use the xmlto package. When DEFAULT is not specified, +# --with-xmlto assumes 'auto'. +# +# Interface to module: +# HAVE_XMLTO: used in makefiles to conditionally generate documentation +# XMLTO: returns the path of the xmlto program found +# returns the path set by the user in the environment +# --with-xmlto: 'yes' user instructs the module to use xmlto +# 'no' user instructs the module not to use xmlto +# +# Added in version 1.10.0 +# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation +# xmlto for text output requires either lynx, links, or w3m browsers +# +# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. +# +AC_DEFUN(XORG_WITH_XMLTO, +AC_ARG_VAR(XMLTO, Path to xmlto command) +m4_define(_defopt, m4_default($2, auto)) +AC_ARG_WITH(xmlto, + AS_HELP_STRING(--with-xmlto, + Use xmlto to regenerate documentation (default: _defopt)), + use_xmlto=$withval, use_xmlto=_defopt) +m4_undefine(_defopt) + +if test "x$use_xmlto" = x"auto"; then + AC_PATH_PROG(XMLTO, xmlto) + if test "x$XMLTO" = "x"; then + AC_MSG_WARN(xmlto not found - documentation targets will be skipped) + have_xmlto=no + else + have_xmlto=yes + fi +elif test "x$use_xmlto" = x"yes" ; then + AC_PATH_PROG(XMLTO, xmlto) + if test "x$XMLTO" = "x"; then + AC_MSG_ERROR(--with-xmlto=yes specified but xmlto not found in PATH) + fi + have_xmlto=yes +elif test "x$use_xmlto" = x"no" ; then + if test "x$XMLTO" != "x"; then + AC_MSG_WARN(ignoring XMLTO environment variable since --with-xmlto=no was specified) + fi + have_xmlto=no +else + AC_MSG_ERROR(--with-xmlto expects 'yes' or 'no') +fi + +# Test for a minimum version of xmlto, if provided. +m4_ifval($1, +if test "$have_xmlto" = yes; then + # scrape the xmlto version + AC_MSG_CHECKING(the xmlto version) + xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` + AC_MSG_RESULT($xmlto_version) + AS_VERSION_COMPARE($xmlto_version, $1, + if test "x$use_xmlto" = xauto; then + AC_MSG_WARN(xmlto version $xmlto_version found, but $1 needed) + have_xmlto=no + else + AC_MSG_ERROR(xmlto version $xmlto_version found, but $1 needed) + fi) +fi) + +# Test for the ability of xmlto to generate a text target +# +# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the +# following test for empty XML docbook files. +# For compatibility reasons use the following empty XML docbook file and if +# it fails try it again with a non-empty XML file. +have_xmlto_text=no +cat > conftest.xml << "EOF" +EOF +AS_IF(test "$have_xmlto" = yes, + AS_IF($XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1, + have_xmlto_text=yes, + # Try it again with a non-empty XML file. + cat > conftest.xml << "EOF" +<x></x> +EOF + AS_IF($XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1, + have_xmlto_text=yes, + AC_MSG_WARN(xmlto cannot generate text format, this format skipped)))) +rm -f conftest.xml +AM_CONDITIONAL(HAVE_XMLTO_TEXT, test $have_xmlto_text = yes) +AM_CONDITIONAL(HAVE_XMLTO, test "$have_xmlto" = yes) +) # XORG_WITH_XMLTO + +# XORG_WITH_XSLTPROC(MIN-VERSION, DEFAULT) +# -------------------------------------------- +# Minimum version: 1.12.0 +# Minimum version for optional DEFAULT argument: 1.12.0 +# +# XSLT (Extensible Stylesheet Language Transformations) is a declarative, +# XML-based language used for the transformation of XML documents. +# The xsltproc command line tool is for applying XSLT stylesheets to XML documents. +# It is used under the cover by xmlto to generate html files from DocBook/XML. +# The XSLT processor is often used as a standalone tool for transformations. +# It should not be assumed that this tool is used only to work with documnetation. +# When DEFAULT is not specified, --with-xsltproc assumes 'auto'. +# +# Interface to module: +# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation +# XSLTPROC: returns the path of the xsltproc program found +# returns the path set by the user in the environment +# --with-xsltproc: 'yes' user instructs the module to use xsltproc +# 'no' user instructs the module not to use xsltproc +# have_xsltproc: returns yes if xsltproc found in PATH or no +# +# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path. +# +AC_DEFUN(XORG_WITH_XSLTPROC, +AC_ARG_VAR(XSLTPROC, Path to xsltproc command) +# Preserves the interface, should it be implemented later +m4_ifval($1, m4_warn(syntax, Checking for xsltproc MIN-VERSION is not implemented)) +m4_define(_defopt, m4_default($2, auto)) +AC_ARG_WITH(xsltproc, + AS_HELP_STRING(--with-xsltproc, + Use xsltproc for the transformation of XML documents (default: _defopt)), + use_xsltproc=$withval, use_xsltproc=_defopt) +m4_undefine(_defopt) + +if test "x$use_xsltproc" = x"auto"; then + AC_PATH_PROG(XSLTPROC, xsltproc) + if test "x$XSLTPROC" = "x"; then + AC_MSG_WARN(xsltproc not found - cannot transform XML documents) + have_xsltproc=no + else + have_xsltproc=yes + fi +elif test "x$use_xsltproc" = x"yes" ; then + AC_PATH_PROG(XSLTPROC, xsltproc) + if test "x$XSLTPROC" = "x"; then + AC_MSG_ERROR(--with-xsltproc=yes specified but xsltproc not found in PATH) + fi + have_xsltproc=yes +elif test "x$use_xsltproc" = x"no" ; then + if test "x$XSLTPROC" != "x"; then + AC_MSG_WARN(ignoring XSLTPROC environment variable since --with-xsltproc=no was specified) + fi + have_xsltproc=no +else + AC_MSG_ERROR(--with-xsltproc expects 'yes' or 'no') +fi + +AM_CONDITIONAL(HAVE_XSLTPROC, test "$have_xsltproc" = yes) +) # XORG_WITH_XSLTPROC + +# XORG_WITH_PERL(MIN-VERSION, DEFAULT) +# ---------------------------------------- +# Minimum version: 1.15.0 +# +# PERL (Practical Extraction and Report Language) is a language optimized for +# scanning arbitrary text files, extracting information from those text files, +# and printing reports based on that information. +# +# When DEFAULT is not specified, --with-perl assumes 'auto'. +# +# Interface to module: +# HAVE_PERL: used in makefiles to conditionally scan text files +# PERL: returns the path of the perl program found +# returns the path set by the user in the environment +# --with-perl: 'yes' user instructs the module to use perl +# 'no' user instructs the module not to use perl +# have_perl: returns yes if perl found in PATH or no +# +# If the user sets the value of PERL, AC_PATH_PROG skips testing the path. +# +AC_DEFUN(XORG_WITH_PERL, +AC_ARG_VAR(PERL, Path to perl command) +# Preserves the interface, should it be implemented later +m4_ifval($1, m4_warn(syntax, Checking for perl MIN-VERSION is not implemented)) +m4_define(_defopt, m4_default($2, auto)) +AC_ARG_WITH(perl, + AS_HELP_STRING(--with-perl, + Use perl for extracting information from files (default: _defopt)), + use_perl=$withval, use_perl=_defopt) +m4_undefine(_defopt) + +if test "x$use_perl" = x"auto"; then + AC_PATH_PROG(PERL, perl) + if test "x$PERL" = "x"; then + AC_MSG_WARN(perl not found - cannot extract information and report) + have_perl=no + else + have_perl=yes + fi +elif test "x$use_perl" = x"yes" ; then + AC_PATH_PROG(PERL, perl) + if test "x$PERL" = "x"; then + AC_MSG_ERROR(--with-perl=yes specified but perl not found in PATH) + fi + have_perl=yes +elif test "x$use_perl" = x"no" ; then + if test "x$PERL" != "x"; then + AC_MSG_WARN(ignoring PERL environment variable since --with-perl=no was specified) + fi + have_perl=no +else + AC_MSG_ERROR(--with-perl expects 'yes' or 'no') +fi + +AM_CONDITIONAL(HAVE_PERL, test "$have_perl" = yes) +) # XORG_WITH_PERL + +# XORG_WITH_ASCIIDOC(MIN-VERSION, DEFAULT) +# ---------------- +# Minimum version: 1.5.0 +# Minimum version for optional DEFAULT argument: 1.11.0 +# +# Documentation tools are not always available on all platforms and sometimes +# not at the appropriate level. This macro enables a module to test for the +# presence of the tool and obtain it's path in separate variables. Coupled with +# the --with-asciidoc option, it allows maximum flexibilty in making decisions +# as whether or not to use the asciidoc package. When DEFAULT is not specified, +# --with-asciidoc assumes 'auto'. +# +# Interface to module: +# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation +# ASCIIDOC: returns the path of the asciidoc program found +# returns the path set by the user in the environment +# --with-asciidoc: 'yes' user instructs the module to use asciidoc +# 'no' user instructs the module not to use asciidoc +# +# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. +# +AC_DEFUN(XORG_WITH_ASCIIDOC, +AC_ARG_VAR(ASCIIDOC, Path to asciidoc command) +m4_define(_defopt, m4_default($2, auto)) +AC_ARG_WITH(asciidoc, + AS_HELP_STRING(--with-asciidoc, + Use asciidoc to regenerate documentation (default: _defopt)), + use_asciidoc=$withval, use_asciidoc=_defopt) +m4_undefine(_defopt) + +if test "x$use_asciidoc" = x"auto"; then + AC_PATH_PROG(ASCIIDOC, asciidoc) + if test "x$ASCIIDOC" = "x"; then + AC_MSG_WARN(asciidoc not found - documentation targets will be skipped) + have_asciidoc=no + else + have_asciidoc=yes + fi +elif test "x$use_asciidoc" = x"yes" ; then + AC_PATH_PROG(ASCIIDOC, asciidoc) + if test "x$ASCIIDOC" = "x"; then + AC_MSG_ERROR(--with-asciidoc=yes specified but asciidoc not found in PATH) + fi + have_asciidoc=yes +elif test "x$use_asciidoc" = x"no" ; then + if test "x$ASCIIDOC" != "x"; then + AC_MSG_WARN(ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified) + fi + have_asciidoc=no +else + AC_MSG_ERROR(--with-asciidoc expects 'yes' or 'no') +fi +m4_ifval($1, +if test "$have_asciidoc" = yes; then + # scrape the asciidoc version + AC_MSG_CHECKING(the asciidoc version) + asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` + AC_MSG_RESULT($asciidoc_version) + AS_VERSION_COMPARE($asciidoc_version, $1, + if test "x$use_asciidoc" = xauto; then + AC_MSG_WARN(asciidoc version $asciidoc_version found, but $1 needed) + have_asciidoc=no + else + AC_MSG_ERROR(asciidoc version $asciidoc_version found, but $1 needed) + fi) +fi) +AM_CONDITIONAL(HAVE_ASCIIDOC, test "$have_asciidoc" = yes) +) # XORG_WITH_ASCIIDOC + +# XORG_WITH_DOXYGEN(MIN-VERSION, DEFAULT) +# ------------------------------------------- +# Minimum version: 1.5.0 +# Minimum version for optional DEFAULT argument: 1.11.0 +# Minimum version for optional DOT checking: 1.18.0 +# +# Documentation tools are not always available on all platforms and sometimes +# not at the appropriate level. This macro enables a module to test for the +# presence of the tool and obtain it's path in separate variables. Coupled with +# the --with-doxygen option, it allows maximum flexibilty in making decisions +# as whether or not to use the doxygen package. When DEFAULT is not specified, +# --with-doxygen assumes 'auto'. +# +# Interface to module: +# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation +# DOXYGEN: returns the path of the doxygen program found +# returns the path set by the user in the environment +# --with-doxygen: 'yes' user instructs the module to use doxygen +# 'no' user instructs the module not to use doxygen +# +# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. +# +AC_DEFUN(XORG_WITH_DOXYGEN, +AC_ARG_VAR(DOXYGEN, Path to doxygen command) +AC_ARG_VAR(DOT, Path to the dot graphics utility) +m4_define(_defopt, m4_default($2, auto)) +AC_ARG_WITH(doxygen, + AS_HELP_STRING(--with-doxygen, + Use doxygen to regenerate documentation (default: _defopt)), + use_doxygen=$withval, use_doxygen=_defopt) +m4_undefine(_defopt) + +if test "x$use_doxygen" = x"auto"; then + AC_PATH_PROG(DOXYGEN, doxygen) + if test "x$DOXYGEN" = "x"; then + AC_MSG_WARN(doxygen not found - documentation targets will be skipped) + have_doxygen=no + else + have_doxygen=yes + fi +elif test "x$use_doxygen" = x"yes" ; then + AC_PATH_PROG(DOXYGEN, doxygen) + if test "x$DOXYGEN" = "x"; then + AC_MSG_ERROR(--with-doxygen=yes specified but doxygen not found in PATH) + fi + have_doxygen=yes +elif test "x$use_doxygen" = x"no" ; then + if test "x$DOXYGEN" != "x"; then + AC_MSG_WARN(ignoring DOXYGEN environment variable since --with-doxygen=no was specified) + fi + have_doxygen=no +else + AC_MSG_ERROR(--with-doxygen expects 'yes' or 'no') +fi +m4_ifval($1, +if test "$have_doxygen" = yes; then + # scrape the doxygen version + AC_MSG_CHECKING(the doxygen version) + doxygen_version=`$DOXYGEN --version 2>/dev/null` + AC_MSG_RESULT($doxygen_version) + AS_VERSION_COMPARE($doxygen_version, $1, + if test "x$use_doxygen" = xauto; then + AC_MSG_WARN(doxygen version $doxygen_version found, but $1 needed) + have_doxygen=no + else + AC_MSG_ERROR(doxygen version $doxygen_version found, but $1 needed) + fi) +fi) + +dnl Check for DOT if we have doxygen. The caller decides if it is mandatory +dnl HAVE_DOT is a variable that can be used in your doxygen.in config file: +dnl HAVE_DOT = @HAVE_DOT@ +HAVE_DOT=no +if test "x$have_doxygen" = "xyes"; then + AC_PATH_PROG(DOT, dot) + if test "x$DOT" != "x"; then + HAVE_DOT=yes + fi +fi + +AC_SUBST(HAVE_DOT) +AM_CONDITIONAL(HAVE_DOT, test "$HAVE_DOT" = "yes") +AM_CONDITIONAL(HAVE_DOXYGEN, test "$have_doxygen" = yes) +) # XORG_WITH_DOXYGEN + +# XORG_WITH_GROFF(DEFAULT) +# ---------------- +# Minimum version: 1.6.0 +# Minimum version for optional DEFAULT argument: 1.11.0 +# +# Documentation tools are not always available on all platforms and sometimes +# not at the appropriate level. This macro enables a module to test for the +# presence of the tool and obtain it's path in separate variables. Coupled with +# the --with-groff option, it allows maximum flexibilty in making decisions +# as whether or not to use the groff package. When DEFAULT is not specified, +# --with-groff assumes 'auto'. +# +# Interface to module: +# HAVE_GROFF: used in makefiles to conditionally generate documentation +# HAVE_GROFF_MM: the memorandum macros (-mm) package +# HAVE_GROFF_MS: the -ms macros package +# GROFF: returns the path of the groff program found +# returns the path set by the user in the environment +# --with-groff: 'yes' user instructs the module to use groff +# 'no' user instructs the module not to use groff +# +# Added in version 1.9.0: +# HAVE_GROFF_HTML: groff has dependencies to output HTML format: +# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. +# psselect from the psutils package. +# the ghostcript package. Refer to the grohtml man pages +# +# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. +# +# OS and distros often splits groff in a basic and full package, the former +# having the groff program and the later having devices, fonts and macros +# Checking for the groff executable is not enough. +# +# If macros are missing, we cannot assume that groff is useless, so we don't +# unset HAVE_GROFF or GROFF env variables. +# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. +# +AC_DEFUN(XORG_WITH_GROFF, +AC_ARG_VAR(GROFF, Path to groff command) +m4_define(_defopt, m4_default($1, auto)) +AC_ARG_WITH(groff, + AS_HELP_STRING(--with-groff, + Use groff to regenerate documentation (default: _defopt)), + use_groff=$withval, use_groff=_defopt) +m4_undefine(_defopt) + +if test "x$use_groff" = x"auto"; then + AC_PATH_PROG(GROFF, groff) + if test "x$GROFF" = "x"; then + AC_MSG_WARN(groff not found - documentation targets will be skipped) + have_groff=no + else + have_groff=yes + fi +elif test "x$use_groff" = x"yes" ; then + AC_PATH_PROG(GROFF, groff) + if test "x$GROFF" = "x"; then + AC_MSG_ERROR(--with-groff=yes specified but groff not found in PATH) + fi + have_groff=yes +elif test "x$use_groff" = x"no" ; then + if test "x$GROFF" != "x"; then + AC_MSG_WARN(ignoring GROFF environment variable since --with-groff=no was specified) + fi + have_groff=no +else + AC_MSG_ERROR(--with-groff expects 'yes' or 'no') +fi + +# We have groff, test for the presence of the macro packages +if test "x$have_groff" = x"yes"; then + AC_MSG_CHECKING(for ${GROFF} -ms macros) + if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then + groff_ms_works=yes + else + groff_ms_works=no + fi + AC_MSG_RESULT($groff_ms_works) + AC_MSG_CHECKING(for ${GROFF} -mm macros) + if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then + groff_mm_works=yes + else + groff_mm_works=no + fi + AC_MSG_RESULT($groff_mm_works) +fi + +# We have groff, test for HTML dependencies, one command per package +if test "x$have_groff" = x"yes"; then + AC_PATH_PROGS(GS_PATH, gs gswin32c) + AC_PATH_PROG(PNMTOPNG_PATH, pnmtopng) + AC_PATH_PROG(PSSELECT_PATH, psselect) + if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then + have_groff_html=yes + else + have_groff_html=no + AC_MSG_WARN(grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages) + fi +fi + +# Set Automake conditionals for Makefiles +AM_CONDITIONAL(HAVE_GROFF, test "$have_groff" = yes) +AM_CONDITIONAL(HAVE_GROFF_MS, test "$groff_ms_works" = yes) +AM_CONDITIONAL(HAVE_GROFF_MM, test "$groff_mm_works" = yes) +AM_CONDITIONAL(HAVE_GROFF_HTML, test "$have_groff_html" = yes) +) # XORG_WITH_GROFF + +# XORG_WITH_FOP(MIN-VERSION, DEFAULT) +# --------------------------------------- +# Minimum version: 1.6.0 +# Minimum version for optional DEFAULT argument: 1.11.0 +# Minimum version for optional MIN-VERSION argument: 1.15.0 +# +# Documentation tools are not always available on all platforms and sometimes +# not at the appropriate level. This macro enables a module to test for the +# presence of the tool and obtain it's path in separate variables. Coupled with +# the --with-fop option, it allows maximum flexibilty in making decisions +# as whether or not to use the fop package. When DEFAULT is not specified, +# --with-fop assumes 'auto'. +# +# Interface to module: +# HAVE_FOP: used in makefiles to conditionally generate documentation +# FOP: returns the path of the fop program found +# returns the path set by the user in the environment +# --with-fop: 'yes' user instructs the module to use fop +# 'no' user instructs the module not to use fop +# +# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. +# +AC_DEFUN(XORG_WITH_FOP, +AC_ARG_VAR(FOP, Path to fop command) +m4_define(_defopt, m4_default($2, auto)) +AC_ARG_WITH(fop, + AS_HELP_STRING(--with-fop, + Use fop to regenerate documentation (default: _defopt)), + use_fop=$withval, use_fop=_defopt) +m4_undefine(_defopt) + +if test "x$use_fop" = x"auto"; then + AC_PATH_PROG(FOP, fop) + if test "x$FOP" = "x"; then + AC_MSG_WARN(fop not found - documentation targets will be skipped) + have_fop=no + else + have_fop=yes + fi +elif test "x$use_fop" = x"yes" ; then + AC_PATH_PROG(FOP, fop) + if test "x$FOP" = "x"; then + AC_MSG_ERROR(--with-fop=yes specified but fop not found in PATH) + fi + have_fop=yes +elif test "x$use_fop" = x"no" ; then + if test "x$FOP" != "x"; then + AC_MSG_WARN(ignoring FOP environment variable since --with-fop=no was specified) + fi + have_fop=no +else + AC_MSG_ERROR(--with-fop expects 'yes' or 'no') +fi + +# Test for a minimum version of fop, if provided. +m4_ifval($1, +if test "$have_fop" = yes; then + # scrape the fop version + AC_MSG_CHECKING(for fop minimum version) + fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3` + AC_MSG_RESULT($fop_version) + AS_VERSION_COMPARE($fop_version, $1, + if test "x$use_fop" = xauto; then + AC_MSG_WARN(fop version $fop_version found, but $1 needed) + have_fop=no + else + AC_MSG_ERROR(fop version $fop_version found, but $1 needed) + fi) +fi) +AM_CONDITIONAL(HAVE_FOP, test "$have_fop" = yes) +) # XORG_WITH_FOP + +# XORG_WITH_M4(MIN-VERSION) +# --------------------------- +# Minimum version: 1.19.0 +# +# This macro attempts to locate an m4 macro processor which supports +# -I option and is only useful for modules relying on M4 in order to +# expand macros in source code files. +# +# Interface to module: +# M4: returns the path of the m4 program found +# returns the path set by the user in the environment +# +AC_DEFUN(XORG_WITH_M4, +AC_CACHE_CHECK(for m4 that supports -I option, ac_cv_path_M4, + AC_PATH_PROGS_FEATURE_CHECK(M4, m4 gm4, + $ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \ + ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:, + AC_MSG_ERROR(could not find m4 that supports -I option), + $PATH:/usr/gnu/bin)) + +AC_SUBST(M4, $ac_cv_path_M4) +) # XORG_WITH_M4 + +# XORG_WITH_PS2PDF(DEFAULT) +# ---------------- +# Minimum version: 1.6.0 +# Minimum version for optional DEFAULT argument: 1.11.0 +# +# Documentation tools are not always available on all platforms and sometimes +# not at the appropriate level. This macro enables a module to test for the +# presence of the tool and obtain it's path in separate variables. Coupled with +# the --with-ps2pdf option, it allows maximum flexibilty in making decisions +# as whether or not to use the ps2pdf package. When DEFAULT is not specified, +# --with-ps2pdf assumes 'auto'. +# +# Interface to module: +# HAVE_PS2PDF: used in makefiles to conditionally generate documentation +# PS2PDF: returns the path of the ps2pdf program found +# returns the path set by the user in the environment +# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf +# 'no' user instructs the module not to use ps2pdf +# +# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. +# +AC_DEFUN(XORG_WITH_PS2PDF, +AC_ARG_VAR(PS2PDF, Path to ps2pdf command) +m4_define(_defopt, m4_default($1, auto)) +AC_ARG_WITH(ps2pdf, + AS_HELP_STRING(--with-ps2pdf, + Use ps2pdf to regenerate documentation (default: _defopt)), + use_ps2pdf=$withval, use_ps2pdf=_defopt) +m4_undefine(_defopt) + +if test "x$use_ps2pdf" = x"auto"; then + AC_PATH_PROG(PS2PDF, ps2pdf) + if test "x$PS2PDF" = "x"; then + AC_MSG_WARN(ps2pdf not found - documentation targets will be skipped) + have_ps2pdf=no + else + have_ps2pdf=yes + fi +elif test "x$use_ps2pdf" = x"yes" ; then + AC_PATH_PROG(PS2PDF, ps2pdf) + if test "x$PS2PDF" = "x"; then + AC_MSG_ERROR(--with-ps2pdf=yes specified but ps2pdf not found in PATH) + fi + have_ps2pdf=yes +elif test "x$use_ps2pdf" = x"no" ; then + if test "x$PS2PDF" != "x"; then + AC_MSG_WARN(ignoring PS2PDF environment variable since --with-ps2pdf=no was specified) + fi + have_ps2pdf=no +else + AC_MSG_ERROR(--with-ps2pdf expects 'yes' or 'no') +fi +AM_CONDITIONAL(HAVE_PS2PDF, test "$have_ps2pdf" = yes) +) # XORG_WITH_PS2PDF + +# XORG_ENABLE_DOCS (enable_docs=yes) +# ---------------- +# Minimum version: 1.6.0 +# +# Documentation tools are not always available on all platforms and sometimes +# not at the appropriate level. This macro enables a builder to skip all +# documentation targets except traditional man pages. +# Combined with the specific tool checking macros XORG_WITH_*, it provides +# maximum flexibilty in controlling documentation building. +# Refer to: +# XORG_WITH_XMLTO --with-xmlto +# XORG_WITH_ASCIIDOC --with-asciidoc +# XORG_WITH_DOXYGEN --with-doxygen +# XORG_WITH_FOP --with-fop +# XORG_WITH_GROFF --with-groff +# XORG_WITH_PS2PDF --with-ps2pdf +# +# Interface to module: +# ENABLE_DOCS: used in makefiles to conditionally generate documentation +# --enable-docs: 'yes' user instructs the module to generate docs +# 'no' user instructs the module not to generate docs +# parm1: specify the default value, yes or no. +# +AC_DEFUN(XORG_ENABLE_DOCS, +m4_define(docs_default, m4_default($1, yes)) +AC_ARG_ENABLE(docs, + AS_HELP_STRING(--enable-docs, + Enable building the documentation (default: docs_default)), + build_docs=$enableval, build_docs=docs_default) +m4_undefine(docs_default) +AM_CONDITIONAL(ENABLE_DOCS, test x$build_docs = xyes) +AC_MSG_CHECKING(whether to build documentation) +AC_MSG_RESULT($build_docs) +) # XORG_ENABLE_DOCS + +# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) +# ---------------- +# Minimum version: 1.6.0 +# +# This macro enables a builder to skip all developer documentation. +# Combined with the specific tool checking macros XORG_WITH_*, it provides +# maximum flexibilty in controlling documentation building. +# Refer to: +# XORG_WITH_XMLTO --with-xmlto +# XORG_WITH_ASCIIDOC --with-asciidoc +# XORG_WITH_DOXYGEN --with-doxygen +# XORG_WITH_FOP --with-fop +# XORG_WITH_GROFF --with-groff +# XORG_WITH_PS2PDF --with-ps2pdf +# +# Interface to module: +# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs +# --enable-devel-docs: 'yes' user instructs the module to generate developer docs +# 'no' user instructs the module not to generate developer docs +# parm1: specify the default value, yes or no. +# +AC_DEFUN(XORG_ENABLE_DEVEL_DOCS, +m4_define(devel_default, m4_default($1, yes)) +AC_ARG_ENABLE(devel-docs, + AS_HELP_STRING(--enable-devel-docs, + Enable building the developer documentation (default: devel_default)), + build_devel_docs=$enableval, build_devel_docs=devel_default) +m4_undefine(devel_default) +AM_CONDITIONAL(ENABLE_DEVEL_DOCS, test x$build_devel_docs = xyes) +AC_MSG_CHECKING(whether to build developer documentation) +AC_MSG_RESULT($build_devel_docs) +) # XORG_ENABLE_DEVEL_DOCS + +# XORG_ENABLE_SPECS (enable_specs=yes) +# ---------------- +# Minimum version: 1.6.0 +# +# This macro enables a builder to skip all functional specification targets. +# Combined with the specific tool checking macros XORG_WITH_*, it provides +# maximum flexibilty in controlling documentation building. +# Refer to: +# XORG_WITH_XMLTO --with-xmlto +# XORG_WITH_ASCIIDOC --with-asciidoc +# XORG_WITH_DOXYGEN --with-doxygen +# XORG_WITH_FOP --with-fop +# XORG_WITH_GROFF --with-groff +# XORG_WITH_PS2PDF --with-ps2pdf +# +# Interface to module: +# ENABLE_SPECS: used in makefiles to conditionally generate specs +# --enable-specs: 'yes' user instructs the module to generate specs +# 'no' user instructs the module not to generate specs +# parm1: specify the default value, yes or no. +# +AC_DEFUN(XORG_ENABLE_SPECS, +m4_define(spec_default, m4_default($1, yes)) +AC_ARG_ENABLE(specs, + AS_HELP_STRING(--enable-specs, + Enable building the specs (default: spec_default)), + build_specs=$enableval, build_specs=spec_default) +m4_undefine(spec_default) +AM_CONDITIONAL(ENABLE_SPECS, test x$build_specs = xyes) +AC_MSG_CHECKING(whether to build functional specifications) +AC_MSG_RESULT($build_specs) +) # XORG_ENABLE_SPECS + +# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto) +# ---------------------------------------------- +# Minimum version: 1.13.0 +# +# This macro enables a builder to enable/disable unit testing +# It makes no assumption about the test cases implementation +# Test cases may or may not use Automake "Support for test suites" +# They may or may not use the software utility library GLib +# +# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL +# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib. +# The variable enable_unit_tests is used by other macros in this file. +# +# Interface to module: +# ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests +# enable_unit_tests: used in configure.ac for additional configuration +# --enable-unit-tests: 'yes' user instructs the module to build tests +# 'no' user instructs the module not to build tests +# parm1: specify the default value, yes or no. +# +AC_DEFUN(XORG_ENABLE_UNIT_TESTS, +AC_BEFORE($0, XORG_WITH_GLIB) +AC_BEFORE($0, XORG_LD_WRAP) +AC_REQUIRE(XORG_MEMORY_CHECK_FLAGS) +m4_define(_defopt, m4_default($1, auto)) +AC_ARG_ENABLE(unit-tests, AS_HELP_STRING(--enable-unit-tests, + Enable building unit test cases (default: _defopt)), + enable_unit_tests=$enableval, enable_unit_tests=_defopt) +m4_undefine(_defopt) +AM_CONDITIONAL(ENABLE_UNIT_TESTS, test "x$enable_unit_tests" != xno) +AC_MSG_CHECKING(whether to build unit test cases) +AC_MSG_RESULT($enable_unit_tests) +) # XORG_ENABLE_UNIT_TESTS + +# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto) +# ------------------------------------------------------ +# Minimum version: 1.17.0 +# +# This macro enables a builder to enable/disable integration testing +# It makes no assumption about the test cases' implementation +# Test cases may or may not use Automake "Support for test suites" +# +# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support +# usually requires less dependencies and may be built and run under less +# stringent environments than integration tests. +# +# Interface to module: +# ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests +# enable_integration_tests: used in configure.ac for additional configuration +# --enable-integration-tests: 'yes' user instructs the module to build tests +# 'no' user instructs the module not to build tests +# parm1: specify the default value, yes or no. +# +AC_DEFUN(XORG_ENABLE_INTEGRATION_TESTS, +AC_REQUIRE(XORG_MEMORY_CHECK_FLAGS) +m4_define(_defopt, m4_default($1, auto)) +AC_ARG_ENABLE(integration-tests, AS_HELP_STRING(--enable-integration-tests, + Enable building integration test cases (default: _defopt)), + enable_integration_tests=$enableval, + enable_integration_tests=_defopt) +m4_undefine(_defopt) +AM_CONDITIONAL(ENABLE_INTEGRATION_TESTS, + test "x$enable_integration_tests" != xno) +AC_MSG_CHECKING(whether to build unit test cases) +AC_MSG_RESULT($enable_integration_tests) +) # XORG_ENABLE_INTEGRATION_TESTS + +# XORG_WITH_GLIB(MIN-VERSION, DEFAULT) +# ---------------------------------------- +# Minimum version: 1.13.0 +# +# GLib is a library which provides advanced data structures and functions. +# This macro enables a module to test for the presence of Glib. +# +# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing. +# Otherwise the value of $enable_unit_tests is blank. +# +# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit +# test support usually requires less dependencies and may be built and run under +# less stringent environments than integration tests. +# +# Interface to module: +# HAVE_GLIB: used in makefiles to conditionally build targets +# with_glib: used in configure.ac to know if GLib has been found +# --with-glib: 'yes' user instructs the module to use glib +# 'no' user instructs the module not to use glib +# +AC_DEFUN(XORG_WITH_GLIB, +AC_REQUIRE(PKG_PROG_PKG_CONFIG) +m4_define(_defopt, m4_default($2, auto)) +AC_ARG_WITH(glib, AS_HELP_STRING(--with-glib, + Use GLib library for unit testing (default: _defopt)), + with_glib=$withval, with_glib=_defopt) +m4_undefine(_defopt) + +have_glib=no +# Do not probe GLib if user explicitly disabled unit testing +if test "x$enable_unit_tests" != x"no"; then + # Do not probe GLib if user explicitly disabled it + if test "x$with_glib" != x"no"; then + m4_ifval( + $1, + PKG_CHECK_MODULES(GLIB, glib-2.0 >= $1, have_glib=yes, have_glib=no), + PKG_CHECK_MODULES(GLIB, glib-2.0, have_glib=yes, have_glib=no) + ) + fi +fi + +# Not having GLib when unit testing has been explicitly requested is an error +if test "x$enable_unit_tests" = x"yes"; then + if test "x$have_glib" = x"no"; then + AC_MSG_ERROR(--enable-unit-tests=yes specified but glib-2.0 not found) + fi +fi + +# Having unit testing disabled when GLib has been explicitly requested is an error +if test "x$enable_unit_tests" = x"no"; then + if test "x$with_glib" = x"yes"; then + AC_MSG_ERROR(--enable-unit-tests=yes specified but glib-2.0 not found) + fi +fi + +# Not having GLib when it has been explicitly requested is an error +if test "x$with_glib" = x"yes"; then + if test "x$have_glib" = x"no"; then + AC_MSG_ERROR(--with-glib=yes specified but glib-2.0 not found) + fi +fi + +AM_CONDITIONAL(HAVE_GLIB, test "$have_glib" = yes) +) # XORG_WITH_GLIB + +# XORG_LD_WRAP(required|optional) +# --------------------------------- +# Minimum version: 1.13.0 +# +# Check if linker supports -wrap, passed via compiler flags +# +# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing. +# Otherwise the value of $enable_unit_tests is blank. +# +# Argument added in 1.16.0 - default is "required", to match existing behavior +# of returning an error if enable_unit_tests is yes, and ld -wrap is not +# available, an argument of "optional" allows use when some unit tests require +# ld -wrap and others do not. +# +AC_DEFUN(XORG_LD_WRAP, +XORG_CHECK_LINKER_FLAGS(-Wl,-wrap,exit,have_ld_wrap=yes,have_ld_wrap=no, + AC_LANG_PROGRAM(#include <stdlib.h> + void __wrap_exit(int status) { return; }, + exit(0);)) +# Not having ld wrap when unit testing has been explicitly requested is an error +if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then + if test "x$have_ld_wrap" = x"no"; then + AC_MSG_ERROR(--enable-unit-tests=yes specified but ld -wrap support is not available) + fi +fi +AM_CONDITIONAL(HAVE_LD_WRAP, test "$have_ld_wrap" = yes) +# +) # XORG_LD_WRAP + +# XORG_CHECK_LINKER_FLAGS +# ----------------------- +# SYNOPSIS +# +# XORG_CHECK_LINKER_FLAGS(FLAGS, ACTION-SUCCESS, ACTION-FAILURE, PROGRAM-SOURCE) +# +# DESCRIPTION +# +# Check whether the given linker FLAGS work with the current language's +# linker, or whether they give an error. +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# PROGRAM-SOURCE is the program source to link with, if needed +# +# NOTE: Based on AX_CHECK_COMPILER_FLAGS. +# +# LICENSE +# +# Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org> +# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu> +# Copyright (c) 2009 Matteo Frigo +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well.# +AC_DEFUN(XORG_CHECK_LINKER_FLAGS, +AC_MSG_CHECKING(whether the linker accepts $1) +dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: +AS_LITERAL_IF($1, + AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_$1), + ax_save_FLAGS=$LDFLAGS + LDFLAGS="$1" + AC_LINK_IFELSE(m4_default($4,AC_LANG_PROGRAM()), + AS_TR_SH(xorg_cv_linker_flags_$1)=yes, + AS_TR_SH(xorg_cv_linker_flags_$1)=no) + LDFLAGS=$ax_save_FLAGS), + ax_save_FLAGS=$LDFLAGS + LDFLAGS="$1" + AC_LINK_IFELSE(AC_LANG_PROGRAM(), + eval AS_TR_SH(xorg_cv_linker_flags_$1)=yes, + eval AS_TR_SH(xorg_cv_linker_flags_$1)=no) + LDFLAGS=$ax_save_FLAGS) +eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_$1) +AC_MSG_RESULT($xorg_check_linker_flags) +if test "x$xorg_check_linker_flags" = xyes; then + m4_default($2, :) +else + m4_default($3, :) +fi +) # XORG_CHECK_LINKER_FLAGS + +# XORG_MEMORY_CHECK_FLAGS +# ----------------------- +# Minimum version: 1.16.0 +# +# This macro attempts to find appropriate memory checking functionality +# for various platforms which unit testing code may use to catch various +# forms of memory allocation and access errors in testing. +# +# Interface to module: +# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging +# Usually added to TESTS_ENVIRONMENT in Makefile.am +# +# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim. +# +AC_DEFUN(XORG_MEMORY_CHECK_FLAGS, + +AC_REQUIRE(AC_CANONICAL_HOST) +AC_ARG_VAR(XORG_MALLOC_DEBUG_ENV, + Environment variables to enable memory checking in tests) + +# Check for different types of support on different platforms +case $host_os in + solaris*) + AC_CHECK_LIB(umem, umem_alloc, + malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default') + ;; + *-gnu*) # GNU libc - Value is used as a single byte bit pattern, + # both directly and inverted, so should not be 0 or 255. + malloc_debug_env='MALLOC_PERTURB_=15' + ;; + darwin*) + malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib' + ;; + *bsd*) + malloc_debug_env='MallocPreScribble=1 MallocScribble=1' + ;; +esac + +# User supplied flags override default flags +if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then + malloc_debug_env="$XORG_MALLOC_DEBUG_ENV" +fi + +AC_SUBST(XORG_MALLOC_DEBUG_ENV,$malloc_debug_env) +) # XORG_WITH_LINT + +# XORG_CHECK_MALLOC_ZERO +# ---------------------- +# Minimum version: 1.0.0 +# +# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if +# malloc(0) returns NULL. Packages should add one of these cflags to +# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. +AC_DEFUN(XORG_CHECK_MALLOC_ZERO, +AC_ARG_ENABLE(malloc0returnsnull, + AS_HELP_STRING(--enable-malloc0returnsnull, + malloc(0) returns NULL (default: auto)), + MALLOC_ZERO_RETURNS_NULL=$enableval, + MALLOC_ZERO_RETURNS_NULL=auto) + +AC_MSG_CHECKING(whether malloc(0) returns NULL) +if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then +AC_CACHE_VAL(xorg_cv_malloc0_returns_null, + AC_RUN_IFELSE(AC_LANG_PROGRAM( +#include <stdlib.h> +, + char *m0, *r0, *c0, *p; + m0 = malloc(0); + p = malloc(10); + r0 = realloc(p,0); + c0 = calloc(0,10); + exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); +), + xorg_cv_malloc0_returns_null=yes, + xorg_cv_malloc0_returns_null=no)) +MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null +fi +AC_MSG_RESULT($MALLOC_ZERO_RETURNS_NULL) + +if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then + MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" + XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS + XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" +else + MALLOC_ZERO_CFLAGS="" + XMALLOC_ZERO_CFLAGS="" + XTMALLOC_ZERO_CFLAGS="" +fi + +AC_SUBST(MALLOC_ZERO_CFLAGS) +AC_SUBST(XMALLOC_ZERO_CFLAGS) +AC_SUBST(XTMALLOC_ZERO_CFLAGS) +) # XORG_CHECK_MALLOC_ZERO + +# XORG_WITH_LINT() +# ---------------- +# Minimum version: 1.1.0 +# +# This macro enables the use of a tool that flags some suspicious and +# non-portable constructs (likely to be bugs) in C language source code. +# It will attempt to locate the tool and use appropriate options. +# There are various lint type tools on different platforms. +# +# Interface to module: +# LINT: returns the path to the tool found on the platform +# or the value set to LINT on the configure cmd line +# also an Automake conditional +# LINT_FLAGS: an Automake variable with appropriate flags +# +# --with-lint: 'yes' user instructs the module to use lint +# 'no' user instructs the module not to use lint (default) +# +# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. +# If the user sets the value of LINT_FLAGS, they are used verbatim. +# +AC_DEFUN(XORG_WITH_LINT, + +AC_ARG_VAR(LINT, Path to a lint-style command) +AC_ARG_VAR(LINT_FLAGS, Flags for the lint-style command) +AC_ARG_WITH(lint, AS_HELP_STRING(--with-lint, + Use a lint-style source code checker (default: disabled)), + use_lint=$withval, use_lint=no) + +# Obtain platform specific info like program name and options +# The lint program on FreeBSD and NetBSD is different from the one on Solaris +case $host_os in + *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) + lint_name=splint + lint_options="-badflag" + ;; + *freebsd* | *netbsd*) + lint_name=lint + lint_options="-u -b" + ;; + *solaris*) + lint_name=lint + lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" + ;; +esac + +# Test for the presence of the program (either guessed by the code or spelled out by the user) +if test "x$use_lint" = x"yes" ; then + AC_PATH_PROG(LINT, $lint_name) + if test "x$LINT" = "x"; then + AC_MSG_ERROR(--with-lint=yes specified but lint-style tool not found in PATH) + fi +elif test "x$use_lint" = x"no" ; then + if test "x$LINT" != "x"; then + AC_MSG_WARN(ignoring LINT environment variable since --with-lint=no was specified) + fi +else + AC_MSG_ERROR(--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.) +fi + +# User supplied flags override default flags +if test "x$LINT_FLAGS" != "x"; then + lint_options=$LINT_FLAGS +fi + +AC_SUBST(LINT_FLAGS,$lint_options) +AM_CONDITIONAL(LINT, test "x$LINT" != x) + +) # XORG_WITH_LINT + +# XORG_LINT_LIBRARY(LIBNAME) +# -------------------------- +# Minimum version: 1.1.0 +# +# Sets up flags for building lint libraries for checking programs that call +# functions in the library. +# +# Interface to module: +# LINTLIB - Automake variable with the name of lint library file to make +# MAKE_LINT_LIB - Automake conditional +# +# --enable-lint-library: - 'yes' user instructs the module to created a lint library +# - 'no' user instructs the module not to create a lint library (default) + +AC_DEFUN(XORG_LINT_LIBRARY, +AC_REQUIRE(XORG_WITH_LINT) +AC_ARG_ENABLE(lint-library, AS_HELP_STRING(--enable-lint-library, + Create lint library (default: disabled)), + make_lint_lib=$enableval, make_lint_lib=no) + +if test "x$make_lint_lib" = x"yes" ; then + LINTLIB=llib-l$1.ln + if test "x$LINT" = "x"; then + AC_MSG_ERROR(Cannot make lint library without --with-lint) + fi +elif test "x$make_lint_lib" != x"no" ; then + AC_MSG_ERROR(--enable-lint-library expects 'yes' or 'no'.) +fi + +AC_SUBST(LINTLIB) +AM_CONDITIONAL(MAKE_LINT_LIB, test x$make_lint_lib != xno) + +) # XORG_LINT_LIBRARY + +# XORG_COMPILER_BRAND +# ------------------- +# Minimum version: 1.14.0 +# +# Checks for various brands of compilers and sets flags as appropriate: +# GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes" +# GNU g++ - relies on AC_PROG_CXX to set GXX to "yes" +# clang compiler - sets CLANGCC to "yes" +# Intel compiler - sets INTELCC to "yes" +# Sun/Oracle Solaris Studio cc - sets SUNCC to "yes" +# +AC_DEFUN(XORG_COMPILER_BRAND, +AC_LANG_CASE( + C, + AC_REQUIRE(AC_PROG_CC_C99) + , + C++, + AC_REQUIRE(AC_PROG_CXX) + +) +AC_CHECK_DECL(__clang__, CLANGCC="yes", CLANGCC="no") +AC_CHECK_DECL(__INTEL_COMPILER, INTELCC="yes", INTELCC="no") +AC_CHECK_DECL(__SUNPRO_C, SUNCC="yes", SUNCC="no") +) # XORG_COMPILER_BRAND + +# XORG_TESTSET_CFLAG(<variable>, <flag>, <alternative flag>, ...) +# --------------- +# Minimum version: 1.16.0 +# +# Test if the compiler works when passed the given flag as a command line argument. +# If it succeeds, the flag is appeneded to the given variable. If not, it tries the +# next flag in the list until there are no more options. +# +# Note that this does not guarantee that the compiler supports the flag as some +# compilers will simply ignore arguments that they do not understand, but we do +# attempt to weed out false positives by using -Werror=unknown-warning-option and +# -Werror=unused-command-line-argument +# +AC_DEFUN(XORG_TESTSET_CFLAG, +m4_if($#, 0, m4_fatal(XORG_TESTSET_CFLAG was given with an unsupported number of arguments)) +m4_if($#, 1, m4_fatal(XORG_TESTSET_CFLAG was given with an unsupported number of arguments)) + +AC_LANG_COMPILER_REQUIRE + +AC_LANG_CASE( + C, + AC_REQUIRE(AC_PROG_CC_C99) + define(PREFIX, C) + define(CACHE_PREFIX, cc) + define(COMPILER, $CC) + , + C++, + define(PREFIX, CXX) + define(CACHE_PREFIX, cxx) + define(COMPILER, $CXX) + +) + +xorg_testset_save_PREFIXFLAGS="$PREFIXFLAGS" + +if test "x$xorg_testset_CACHE_PREFIX_unknown_warning_option" = "x" ; then + PREFIXFLAGS="$PREFIXFLAGS -Werror=unknown-warning-option" + AC_CACHE_CHECK(if COMPILER supports -Werror=unknown-warning-option, + xorg_cv_CACHE_PREFIX_flag_unknown_warning_option, + AC_COMPILE_IFELSE(AC_LANG_SOURCE(int i;), + xorg_cv_CACHE_PREFIX_flag_unknown_warning_option=yes, + xorg_cv_CACHE_PREFIX_flag_unknown_warning_option=no)) + xorg_testset_CACHE_PREFIX_unknown_warning_option=$xorg_cv_CACHE_PREFIX_flag_unknown_warning_option + PREFIXFLAGS="$xorg_testset_save_PREFIXFLAGS" +fi + +if test "x$xorg_testset_CACHE_PREFIX_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_CACHE_PREFIX_unknown_warning_option" = "xyes" ; then + PREFIXFLAGS="$PREFIXFLAGS -Werror=unknown-warning-option" + fi + PREFIXFLAGS="$PREFIXFLAGS -Werror=unused-command-line-argument" + AC_CACHE_CHECK(if COMPILER supports -Werror=unused-command-line-argument, + xorg_cv_CACHE_PREFIX_flag_unused_command_line_argument, + AC_COMPILE_IFELSE(AC_LANG_SOURCE(int i;), + xorg_cv_CACHE_PREFIX_flag_unused_command_line_argument=yes, + xorg_cv_CACHE_PREFIX_flag_unused_command_line_argument=no)) + xorg_testset_CACHE_PREFIX_unused_command_line_argument=$xorg_cv_CACHE_PREFIX_flag_unused_command_line_argument + PREFIXFLAGS="$xorg_testset_save_PREFIXFLAGS" +fi + +found="no" +m4_foreach(flag, m4_cdr($@), + if test $found = "no" ; then + if test "x$xorg_testset_CACHE_PREFIX_unknown_warning_option" = "xyes" ; then + PREFIXFLAGS="$PREFIXFLAGS -Werror=unknown-warning-option" + fi + + if test "x$xorg_testset_CACHE_PREFIX_unused_command_line_argument" = "xyes" ; then + PREFIXFLAGS="$PREFIXFLAGS -Werror=unused-command-line-argument" + fi + + PREFIXFLAGS="$PREFIXFLAGS flag" + +dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname + AC_MSG_CHECKING(if COMPILER supports flag) + cacheid=AS_TR_SH(xorg_cv_CACHE_PREFIX_flag_flag) + AC_CACHE_VAL($cacheid, + AC_LINK_IFELSE(AC_LANG_PROGRAM(int i;), + eval $cacheid=yes, + eval $cacheid=no)) + + PREFIXFLAGS="$xorg_testset_save_PREFIXFLAGS" + + eval supported=\$$cacheid + AC_MSG_RESULT($supported) + if test "$supported" = "yes" ; then + $1="$$1 flag" + found="yes" + fi + fi +) +) # XORG_TESTSET_CFLAG + +# XORG_COMPILER_FLAGS +# --------------- +# Minimum version: 1.16.0 +# +# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line +# arguments supported by the selected compiler which do NOT alter the generated +# code. These arguments will cause the compiler to print various warnings +# during compilation AND turn a conservative set of warnings into errors. +# +# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in +# future versions of util-macros as options are added to new compilers. +# +AC_DEFUN(XORG_COMPILER_FLAGS, +AC_REQUIRE(XORG_COMPILER_BRAND) + +AC_ARG_ENABLE(selective-werror, + AS_HELP_STRING(--disable-selective-werror, + Turn off selective compiler errors. (default: enabled)), + SELECTIVE_WERROR=$enableval, + SELECTIVE_WERROR=yes) + +AC_LANG_CASE( + C, + define(PREFIX, C) + , + C++, + define(PREFIX, CXX) + +) +# -v is too short to test reliably with XORG_TESTSET_CFLAG +if test "x$SUNCC" = "xyes"; then + BASE_PREFIXFLAGS="-v" +else + BASE_PREFIXFLAGS="" +fi + +# This chunk of warnings were those that existed in the legacy CWARNFLAGS +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wall) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wpointer-arith) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wmissing-declarations) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wformat=2, -Wformat) + +AC_LANG_CASE( + C, + XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wstrict-prototypes) + XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wmissing-prototypes) + XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wnested-externs) + XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wbad-function-cast) + XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wold-style-definition, -fd) + XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wdeclaration-after-statement) + +) + +# This chunk adds additional warnings that could catch undesired effects. +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wunused) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wuninitialized) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wshadow) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wmissing-noreturn) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wmissing-format-attribute) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wredundant-decls) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wlogical-op) + +# These are currently disabled because they are noisy. They will be enabled +# in the future once the codebase is sufficiently modernized to silence +# them. For now, I don't want them to drown out the other warnings. +# XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wparentheses) +# XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wcast-align) +# XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wcast-qual) + +# Turn some warnings into errors, so we don't accidently get successful builds +# when there are problems that should be fixed. + +if test "x$SELECTIVE_WERROR" = "xyes" ; then +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=implicit, -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=nonnull) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=init-self) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=main) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=missing-braces) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=sequence-point) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=return-type, -errwarn=E_FUNC_HAS_NO_RETURN_STMT) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=trigraphs) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=array-bounds) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=write-strings) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=address) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=int-to-pointer-cast, -errwarn=E_BAD_PTR_INT_COMBINATION) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Werror=pointer-to-int-cast) # Also -errwarn=E_BAD_PTR_INT_COMBINATION +else +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) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wimplicit) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wnonnull) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Winit-self) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wmain) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wmissing-braces) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wsequence-point) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wreturn-type) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wtrigraphs) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Warray-bounds) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wwrite-strings) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Waddress) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wint-to-pointer-cast) +XORG_TESTSET_CFLAG(BASE_PREFIXFLAGS, -Wpointer-to-int-cast) +fi + +AC_SUBST(BASE_PREFIXFLAGS) +) # XORG_COMPILER_FLAGS + +# XORG_CWARNFLAGS +# --------------- +# Minimum version: 1.2.0 +# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead) +# +# Defines CWARNFLAGS to enable C compiler warnings. +# +# This function is deprecated because it defines -fno-strict-aliasing +# which alters the code generated by the compiler. If -fno-strict-aliasing +# is needed, then it should be added explicitly in the module when +# it is updated to use BASE_CFLAGS. +# +AC_DEFUN(XORG_CWARNFLAGS, +AC_REQUIRE(XORG_COMPILER_FLAGS) +AC_REQUIRE(XORG_COMPILER_BRAND) +AC_LANG_CASE( + C, + CWARNFLAGS="$BASE_CFLAGS" + if test "x$GCC" = xyes ; then + CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing" + fi + AC_SUBST(CWARNFLAGS) + +) +) # XORG_CWARNFLAGS + +# XORG_STRICT_OPTION +# ----------------------- +# Minimum version: 1.3.0 +# +# Add configure option to enable strict compilation flags, such as treating +# warnings as fatal errors. +# If --enable-strict-compilation is passed to configure, adds strict flags to +# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS. +# +# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or +# when strict compilation is unconditionally desired. +AC_DEFUN(XORG_STRICT_OPTION, +AC_REQUIRE(XORG_CWARNFLAGS) +AC_REQUIRE(XORG_COMPILER_FLAGS) + +AC_ARG_ENABLE(strict-compilation, + AS_HELP_STRING(--enable-strict-compilation, + Enable all warnings from compiler and make them errors (default: disabled)), + STRICT_COMPILE=$enableval, STRICT_COMPILE=no) + +AC_LANG_CASE( + C, + define(PREFIX, C) + , + C++, + define(PREFIX, CXX) + +) + +STRICT_PREFIXFLAGS="" +XORG_TESTSET_CFLAG(STRICT_PREFIXFLAGS, -pedantic) +XORG_TESTSET_CFLAG(STRICT_PREFIXFLAGS, -Werror, -errwarn) + +# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not +# activate it with -Werror, so we add it here explicitly. +XORG_TESTSET_CFLAG(STRICT_PREFIXFLAGS, -Werror=attributes) + +if test "x$STRICT_COMPILE" = "xyes"; then + BASE_PREFIXFLAGS="$BASE_PREFIXFLAGS $STRICT_PREFIXFLAGS" + AC_LANG_CASE(C, CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS") +fi +AC_SUBST(STRICT_PREFIXFLAGS) +AC_SUBST(BASE_PREFIXFLAGS) +AC_LANG_CASE(C, AC_SUBST(CWARNFLAGS)) +) # XORG_STRICT_OPTION + +# XORG_DEFAULT_OPTIONS +# -------------------- +# Minimum version: 1.3.0 +# +# Defines default options for X.Org modules. +# +AC_DEFUN(XORG_DEFAULT_OPTIONS, +AC_REQUIRE(AC_PROG_INSTALL) +XORG_COMPILER_FLAGS +XORG_CWARNFLAGS +XORG_STRICT_OPTION +XORG_RELEASE_VERSION +XORG_CHANGELOG +XORG_INSTALL +XORG_MANPAGE_SECTIONS +m4_ifdef(AM_SILENT_RULES, AM_SILENT_RULES(yes), + AC_SUBST(AM_DEFAULT_VERBOSITY, 1)) +) # XORG_DEFAULT_OPTIONS + +# XORG_INSTALL() +# ---------------- +# Minimum version: 1.4.0 +# +# Defines the variable INSTALL_CMD as the command to copy +# INSTALL from $prefix/share/util-macros. +# +AC_DEFUN(XORG_INSTALL, +AC_REQUIRE(PKG_PROG_PKG_CONFIG) +macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` +INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ +mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ +|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \ +touch \$(top_srcdir)/INSTALL; \ +echo 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))" +AC_SUBST(INSTALL_CMD) +) # XORG_INSTALL +dnl Copyright 2005 Red Hat, Inc +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and its +dnl documentation for any purpose is hereby granted without fee, provided that +dnl the above copyright notice appear in all copies and that both that +dnl copyright notice and this permission notice appear in supporting +dnl documentation. +dnl +dnl The above copyright notice and this permission notice shall be included +dnl in all copies or substantial portions of the Software. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +dnl OTHER DEALINGS IN THE SOFTWARE. +dnl +dnl Except as contained in this notice, the name of the copyright holders shall +dnl not be used in advertising or otherwise to promote the sale, use or +dnl other dealings in this Software without prior written authorization +dnl from the copyright holders. +dnl + +# XORG_RELEASE_VERSION +# -------------------- +# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. + +AC_DEFUN(XORG_RELEASE_VERSION, + AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR, + `echo $PACKAGE_VERSION | cut -d . -f 1`, + Major version of this package) + PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` + if test "x$PVM" = "x"; then + PVM="0" + fi + AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR, + $PVM, + Minor version of this package) + PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` + if test "x$PVP" = "x"; then + PVP="0" + fi + AC_DEFINE_UNQUOTED(PACKAGE_VERSION_PATCHLEVEL, + $PVP, + Patch version of this package) +) + +# XORG_CHANGELOG() +# ---------------- +# Minimum version: 1.2.0 +# +# Defines the variable CHANGELOG_CMD as the command to generate +# ChangeLog from git. +# +# +AC_DEFUN(XORG_CHANGELOG, +CHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \ +mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ +|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \ +touch \$(top_srcdir)/ChangeLog; \ +echo 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))" +AC_SUBST(CHANGELOG_CMD) +) # XORG_CHANGELOG + +# Copyright (C) 2002-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN(AM_AUTOMAKE_VERSION, +am__api_version='1.16' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if($1, 1.16.5, , + AC_FATAL(Do not call $0, use AM_INIT_AUTOMAKE($1).))dnl +) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define(_AM_AUTOCONF_VERSION, ) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN(AM_SET_CURRENT_AUTOMAKE_VERSION, +AM_AUTOMAKE_VERSION(1.16.5)dnl +m4_ifndef(AC_AUTOCONF_VERSION, + m4_copy(m4_PACKAGE_VERSION, AC_AUTOCONF_VERSION))dnl +_AM_AUTOCONF_VERSION(m4_defn(AC_AUTOCONF_VERSION))) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR(foo), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN(AM_AUX_DIR_EXPAND, +AC_REQUIRE(AC_CONFIG_AUX_DIR_DEFAULT)dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN(AM_CONDITIONAL, +AC_PREREQ(2.52)dnl + m4_if($1, TRUE, AC_FATAL($0: invalid condition: $1), + $1, FALSE, AC_FATAL($0: invalid condition: $1))dnl +AC_SUBST($1_TRUE)dnl +AC_SUBST($1_FALSE)dnl +_AM_SUBST_NOTMAKE($1_TRUE)dnl +_AM_SUBST_NOTMAKE($1_FALSE)dnl +m4_define(_AM_COND_VALUE_$1, $2)dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR(conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.) +fi)) + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN(_AM_DEPENDENCIES, +AC_REQUIRE(AM_SET_DEPDIR)dnl +AC_REQUIRE(AM_OUTPUT_DEPENDENCY_COMMANDS)dnl +AC_REQUIRE(AM_MAKE_INCLUDE)dnl +AC_REQUIRE(AM_DEP_TRACK)dnl + +m4_if($1, CC, depcc="$CC" am_compiler_list=, + $1, CXX, depcc="$CXX" am_compiler_list=, + $1, OBJC, depcc="$OBJC" am_compiler_list='gcc3 gcc', + $1, OBJCXX, depcc="$OBJCXX" am_compiler_list='gcc3 gcc', + $1, UPC, depcc="$UPC" am_compiler_list=, + $1, GCJ, depcc="$GCJ" am_compiler_list='gcc3 gcc', + depcc="$$1" am_compiler_list=) + +AC_CACHE_CHECK(dependency style of $depcc, + am_cv_$1_dependencies_compiler_type, +if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\(a-zA-Z0-9*\))$/\1/p' < ./depcomp` + fi + am__universal=false + m4_case($1, CC, + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac, + CXX, + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +) +AC_SUBST($1DEPMODE, depmode=$am_cv_$1_dependencies_compiler_type) +AM_CONDITIONAL(am__fastdep$1, + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3) +) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN(AM_SET_DEPDIR, +AC_REQUIRE(AM_SET_LEADING_DOT)dnl +AC_SUBST(DEPDIR, "${am__leading_dot}deps")dnl +) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN(AM_DEP_TRACK, +AC_ARG_ENABLE(dependency-tracking, dnl +AS_HELP_STRING( + --enable-dependency-tracking, + do not reject slow dependency extractors) +AS_HELP_STRING( + --disable-dependency-tracking, + speeds up one-time build)) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL(AMDEP, test "x$enable_dependency_tracking" != xno) +AC_SUBST(AMDEPBACKSLASH)dnl +_AM_SUBST_NOTMAKE(AMDEPBACKSLASH)dnl +AC_SUBST(am__nodep)dnl +_AM_SUBST_NOTMAKE(am__nodep)dnl +) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN(_AM_OUTPUT_DEPENDENCY_COMMANDS, +{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE($CONFIG_FILES, + *\'*, eval set x "$CONFIG_FILES", + *, set x $CONFIG_FILES) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO("$am_mf") | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME("$am_mf")` + am_filepart=`AS_BASENAME("$am_mf")` + AM_RUN_LOG(cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE(Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).) + fi + AS_UNSET(am_dirpart) + AS_UNSET(am_filepart) + AS_UNSET(am_mf) + AS_UNSET(am_rc) + rm -f conftest-deps.mk +} +)# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. +AC_DEFUN(AM_OUTPUT_DEPENDENCY_COMMANDS, +AC_CONFIG_COMMANDS(depfiles, + test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS, + AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}")) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define(AC_PROG_CC, +m4_defn(AC_PROG_CC) +_AM_PROG_CC_C_O +) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, NO-DEFINE) +# AM_INIT_AUTOMAKE(OPTIONS) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN(AM_INIT_AUTOMAKE, +AC_PREREQ(2.65)dnl +m4_ifdef(_$0_ALREADY_INIT, + m4_fatal($0 expanded multiple times +m4_defn(_$0_ALREADY_INIT)), + m4_define(_$0_ALREADY_INIT, m4_expansion_stack))dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow(^AM_A-Z+FLAGS$)dnl +AC_REQUIRE(AM_SET_CURRENT_AUTOMAKE_VERSION)dnl +AC_REQUIRE(AC_PROG_INSTALL)dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST(am__isrc, ' -I$(srcdir)')_AM_SUBST_NOTMAKE(am__isrc)dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR(source directory already configured; run "make distclean" there first) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST(CYGPATH_W) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval($2, +AC_DIAGNOSE(obsolete, + $0: two- and three-arguments forms are deprecated.) +m4_ifval($3, _AM_SET_OPTION(no-define))dnl + AC_SUBST(PACKAGE, $1)dnl + AC_SUBST(VERSION, $2), +_AM_SET_OPTIONS($1)dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifset(AC_PACKAGE_NAME, ok):m4_ifset(AC_PACKAGE_VERSION, ok), + ok:ok,, + m4_fatal(AC_INIT should be called with package and version arguments))dnl + AC_SUBST(PACKAGE, 'AC_PACKAGE_TARNAME')dnl + AC_SUBST(VERSION, 'AC_PACKAGE_VERSION'))dnl + +_AM_IF_OPTION(no-define,, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", Name of package) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", Version number of package))dnl + +# Some tools Automake needs. +AC_REQUIRE(AM_SANITY_CHECK)dnl +AC_REQUIRE(AC_ARG_PROGRAM)dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE(AM_PROG_INSTALL_SH)dnl +AC_REQUIRE(AM_PROG_INSTALL_STRIP)dnl +AC_REQUIRE(AC_PROG_MKDIR_P)dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> +# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> +AC_SUBST(mkdir_p, '$(MKDIR_P)') +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE(AC_PROG_AWK)dnl +AC_REQUIRE(AC_PROG_MAKE_SET)dnl +AC_REQUIRE(AM_SET_LEADING_DOT)dnl +_AM_IF_OPTION(tar-ustar, _AM_PROG_TAR(ustar), + _AM_IF_OPTION(tar-pax, _AM_PROG_TAR(pax), + _AM_PROG_TAR(v7))) +_AM_IF_OPTION(no-dependencies,, +AC_PROVIDE_IFELSE(AC_PROG_CC, + _AM_DEPENDENCIES(CC), + m4_define(AC_PROG_CC, + m4_defn(AC_PROG_CC)_AM_DEPENDENCIES(CC)))dnl +AC_PROVIDE_IFELSE(AC_PROG_CXX, + _AM_DEPENDENCIES(CXX), + m4_define(AC_PROG_CXX, + m4_defn(AC_PROG_CXX)_AM_DEPENDENCIES(CXX)))dnl +AC_PROVIDE_IFELSE(AC_PROG_OBJC, + _AM_DEPENDENCIES(OBJC), + m4_define(AC_PROG_OBJC, + m4_defn(AC_PROG_OBJC)_AM_DEPENDENCIES(OBJC)))dnl +AC_PROVIDE_IFELSE(AC_PROG_OBJCXX, + _AM_DEPENDENCIES(OBJCXX), + m4_define(AC_PROG_OBJCXX, + m4_defn(AC_PROG_OBJCXX)_AM_DEPENDENCIES(OBJCXX)))dnl +) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST(CTAGS) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST(ETAGS) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST(CSCOPE) + +AC_REQUIRE(AM_SILENT_RULES)dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +m4_provide_if(_AM_COMPILER_EXEEXT, + AM_CONDITIONAL(am__EXEEXT, test -n "$EXEEXT")))dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: <https://www.gnu.org/software/coreutils/>. + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR(Your 'rm' program is bad, sorry.) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define(_AC_COMPILER_EXEEXT, +m4_defn(_AC_COMPILER_EXEEXT)m4_provide(_AM_COMPILER_EXEEXT)) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN(_AC_AM_CONFIG_HEADER_HOOK, +# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME("$_am_arg")`/stamp-h$_am_stamp_count) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN(AM_PROG_INSTALL_SH, +AC_REQUIRE(AM_AUX_DIR_EXPAND)dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)) + +# Copyright (C) 2003-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN(AM_SET_LEADING_DOT, +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST(am__leading_dot)) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. +AC_DEFUN(AM_MAKE_INCLUDE, +AC_MSG_CHECKING(whether ${MAKE-make} supports the include directive) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG(${MAKE-make} -f confmf.$s && cat confinc.out) + AS_CASE($?:`cat confinc.out 2>/dev/null`, + '0:this is the am__doit target', + AS_CASE($s, + BSD, am__include='.include' am__quote='"', + am__include='include' am__quote='')) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT(${_am_result}) +AC_SUBST(am__include)) +AC_SUBST(am__quote)) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN(AM_MISSING_PROG, +AC_REQUIRE(AM_MISSING_HAS_RUN) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN(AM_MISSING_HAS_RUN, +AC_REQUIRE(AM_AUX_DIR_EXPAND)dnl +AC_REQUIRE_AUX_FILE(missing)dnl +if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN('missing' script is too old or missing) +fi +) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN(_AM_MANGLE_OPTION, +_AM_OPTION_m4_bpatsubst($1, ^a-zA-Z0-9_, _)) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN(_AM_SET_OPTION, +m4_define(_AM_MANGLE_OPTION($1), 1)) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN(_AM_SET_OPTIONS, +m4_foreach_w(_AM_Option, $1, _AM_SET_OPTION(_AM_Option))) + +# _AM_IF_OPTION(OPTION, IF-SET, IF-NOT-SET) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN(_AM_IF_OPTION, +m4_ifset(_AM_MANGLE_OPTION($1), $2, $3)) + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN(_AM_PROG_CC_C_O, +AC_REQUIRE(AM_AUX_DIR_EXPAND)dnl +AC_REQUIRE_AUX_FILE(compile)dnl +AC_LANG_PUSH(C)dnl +AC_CACHE_CHECK( + whether $CC understands -c and -o together, + am_cv_prog_cc_c_o, + AC_LANG_CONFTEST(AC_LANG_PROGRAM()) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG($CC -c conftest.$ac_ext -o conftest2.$ac_objext) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP(C)) + +# For backward compatibility. +AC_DEFUN_ONCE(AM_PROG_CC_C_O, AC_REQUIRE(AC_PROG_CC)) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN(AM_RUN_LOG, +{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN(AM_SANITY_CHECK, +AC_MSG_CHECKING(whether build environment is sane) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *\\\"\#\$\&\'\`$am_lf*) + AC_MSG_ERROR(unsafe absolute working directory name);; +esac +case $srcdir in + *\\\"\#\$\&\'\`$am_lf\ \ *) + AC_MSG_ERROR(unsafe srcdir value: '$srcdir');; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR(ls -t appears to fail. Make sure there is not a broken + alias in your environment) + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR(newly created file is older than distributed files! +Check your system clock) +fi +AC_MSG_RESULT(yes) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + AC_MSG_CHECKING(that generated files are newer than configure) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT(done)) +rm -f conftest.file +) + +# Copyright (C) 2009-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES(DEFAULT) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN(AM_SILENT_RULES, +AC_ARG_ENABLE(silent-rules, dnl +AS_HELP_STRING( + --enable-silent-rules, + less verbose build output (undo: "make V=1")) +AS_HELP_STRING( + --disable-silent-rules, + verbose build output (undo: "make V=0"))dnl +) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if($1, yes, 0, 1);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK(whether $am_make supports nested variables, + am_cv_make_support_nested_variables, + if AS_ECHO('TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit') | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST(AM_V)dnl +AM_SUBST_NOTMAKE(AM_V)dnl +AC_SUBST(AM_DEFAULT_V)dnl +AM_SUBST_NOTMAKE(AM_DEFAULT_V)dnl +AC_SUBST(AM_DEFAULT_VERBOSITY)dnl +AM_BACKSLASH='\' +AC_SUBST(AM_BACKSLASH)dnl +_AM_SUBST_NOTMAKE(AM_BACKSLASH)dnl +) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN(AM_PROG_INSTALL_STRIP, +AC_REQUIRE(AM_PROG_INSTALL_SH)dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL(STRIP, strip, :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST(INSTALL_STRIP_PROGRAM)) + +# Copyright (C) 2006-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN(_AM_SUBST_NOTMAKE) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN(AM_SUBST_NOTMAKE, _AM_SUBST_NOTMAKE($@)) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN(_AM_PROG_TAR, +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST(AMTAR, '$${TAR-tar}') + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if($1, ustar, plaintar) pax cpio none' + +m4_if($1, v7, + am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -', + + m4_case($1, + ustar, + # The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING(whether UID '$am_uid' is supported by ustar format) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + _am_tools=none + fi + AC_MSG_CHECKING(whether GID '$am_gid' is supported by ustar format) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + _am_tools=none + fi, + + pax, + , + + m4_fatal(Unknown tar format)) + + AC_MSG_CHECKING(how to create a $1 tar archive) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG($_am_tar --version) && break + done + am__tar="$_am_tar --format=m4_if($1, pax, posix, $1) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if($1, pax, posix, $1) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG(tardir=conftest.dir && eval $am__tar_ >conftest.tar) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG($am__untar <conftest.tar) + AM_RUN_LOG(cat conftest.dir/file) + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL(am_cv_prog_tar_$1, am_cv_prog_tar_$1=$_am_tool) + AC_MSG_RESULT($am_cv_prog_tar_$1)) + +AC_SUBST(am__tar) +AC_SUBST(am__untar) +) # _AM_PROG_TAR +
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/config.guess -> _service:tar_scm:libXft-2.3.7.tar.gz/config.guess
Changed
@@ -1,14 +1,14 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2021 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2021-06-03' +timestamp='2022-01-09' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -60,7 +60,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2021 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -437,7 +437,7 @@ # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 @@ -929,6 +929,9 @@ i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; *:Interix*:*) case $UNAME_MACHINE in x86) @@ -1522,6 +1525,9 @@ i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;;
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/config.sub -> _service:tar_scm:libXft-2.3.7.tar.gz/config.sub
Changed
@@ -1,14 +1,14 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2021 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2021-07-03' +timestamp='2022-01-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -76,7 +76,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2021 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -121,9 +121,11 @@ # Split fields of configuration type # shellcheck disable=SC2162 +saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <<EOF $1 EOF +IFS=$saved_IFS # Separate into logical components for further validation case $1 in @@ -172,6 +174,10 @@ basic_machine=$field1 basic_os=$field2 ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun234* \ @@ -931,9 +937,11 @@ *-*) # shellcheck disable=SC2162 + saved_IFS=$IFS IFS="-" read cpu vendor <<EOF $basic_machine EOF + IFS=$saved_IFS ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and @@ -1012,6 +1020,11 @@ ;; # Here we normalize CPU types with a missing or matching vendor + armh-unknown | armh-alt) + cpu=armv7l + vendor=alt + basic_os=${basic_os:-linux-gnueabihf} + ;; dpx20-unknown | dpx20-bull) cpu=rs6000 vendor=bull @@ -1113,7 +1126,7 @@ xscale-* | xscaleebl-*) cpu=`echo "$cpu" | sed 's/^xscale/arm/'` ;; - arm64-*) + arm64-* | aarch64le-*) cpu=aarch64 ;; @@ -1296,7 +1309,7 @@ if test x$basic_os != x then -# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. case $basic_os in gnu/linux*) @@ -1313,9 +1326,11 @@ ;; *-*) # shellcheck disable=SC2162 + saved_IFS=$IFS IFS="-" read kernel os <<EOF $basic_os EOF + IFS=$saved_IFS ;; # Default OS when just kernel was specified nto*) @@ -1697,7 +1712,7 @@ # Now, validate our (potentially fixed-up) OS. case $os in # Sometimes we do "kernel-libc", so those need to count as OSes. - musl* | newlib* | uclibc*) + musl* | newlib* | relibc* | uclibc*) ;; # Likewise for "kernel-abi" eabi* | gnueabi*) @@ -1738,7 +1753,8 @@ | skyos* | haiku* | rdos* | toppers* | drops* | es* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ - | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*) + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ + | fiwix* ) ;; # This one is extra strict with allowed versions sco3.2v2 | sco3.2v4-9* | sco5v6*) @@ -1755,11 +1771,12 @@ # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os in - linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* ) + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ + | linux-musl* | linux-relibc* | linux-uclibc* ) ;; uclinux-uclibc* ) ;; - -dietlibc* | -newlib* | -musl* | -uclibc* ) + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/configure -> _service:tar_scm:libXft-2.3.7.tar.gz/configure
Changed
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for libXft 2.3.4. +# Generated by GNU Autoconf 2.71 for libXft 2.3.7. # # Report bugs to <https://gitlab.freedesktop.org/xorg/lib/libXft/issues>. # @@ -622,8 +622,8 @@ # Identity of this package. PACKAGE_NAME='libXft' PACKAGE_TARNAME='libXft' -PACKAGE_VERSION='2.3.4' -PACKAGE_STRING='libXft 2.3.4' +PACKAGE_VERSION='2.3.7' +PACKAGE_STRING='libXft 2.3.7' PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/lib/libXft/issues' PACKAGE_URL='' @@ -705,6 +705,7 @@ AR DLLTOOL OBJDUMP +FILECMD LN_S NM ac_ct_DUMPBIN @@ -1391,7 +1392,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libXft 2.3.4 to adapt to many kinds of systems. +\`configure' configures libXft 2.3.7 to adapt to many kinds of systems. Usage: $0 OPTION... VAR=VALUE... @@ -1462,7 +1463,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libXft 2.3.4:";; + short | recursive ) echo "Configuration of libXft 2.3.7:";; esac cat <<\_ACEOF @@ -1595,7 +1596,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libXft configure 2.3.4 +libXft configure 2.3.7 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1865,7 +1866,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libXft $as_me 2.3.4, which was +It was created by libXft $as_me 2.3.7, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3139,7 +3140,7 @@ # Define the identity of the package. PACKAGE='libXft' - VERSION='2.3.4' + VERSION='2.3.7' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -3252,8 +3253,8 @@ -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.4.7' +macro_revision='2.4.7' @@ -5130,13 +5131,13 @@ mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -5274,7 +5275,7 @@ fi fi - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -5378,7 +5379,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -5421,7 +5422,7 @@ sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.* //'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.* //'` else lt_cv_sys_max_cmd_len=32768 fi @@ -5627,6 +5628,114 @@ if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. +set dummy ${ac_tool_prefix}file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FILECMD"; then + ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FILECMD="${ac_tool_prefix}file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +FILECMD=$ac_cv_prog_FILECMD +if test -n "$FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 +printf "%s\n" "$FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_FILECMD"; then + ac_ct_FILECMD=$FILECMD + # Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_FILECMD"; then + ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_FILECMD="file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD +if test -n "$ac_ct_FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 +printf "%s\n" "$ac_ct_FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_FILECMD" = x; then + FILECMD=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + FILECMD=$ac_ct_FILECMD + fi +else + FILECMD="$ac_cv_prog_FILECMD" +fi + + + + + + + +if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -5769,7 +5878,7 @@ bsdi45*) lt_cv_deplibs_check_method='file_magic ELF 0-90-9*-bit MLSB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -5803,14 +5912,14 @@ lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i3-986 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -5824,7 +5933,7 @@ ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s0-90-90-9|ELF-0-90-9) shared object file - IA64' @@ -5861,7 +5970,7 @@ lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib^/+(\.so\.0-9+\.0-9+|_pic\.a)$' else @@ -5871,7 +5980,7 @@ newos6*) lt_cv_deplibs_check_method='file_magic ELF 0-90-9*-bit MLSB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -6245,13 +6354,29 @@ fi : ${AR=ar} -: ${AR_FLAGS=cru} +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS + + + + + + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. + @@ -6668,7 +6793,7 @@ if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -6686,20 +6811,20 @@ # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -6723,7 +6848,7 @@ if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ @@ -6741,9 +6866,9 @@ " s1~prfx {split(s1,t,\"@\"); print f,t1,substr(t1,length(prfx))}"\ " ' prfx=^$ac_symprfx" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.* \($symcode$symcode*\) *$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.* \($symcode$symcode*\) *$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -6769,11 +6894,8 @@ test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -6946,7 +7068,7 @@ fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -7071,7 +7193,7 @@ ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -7092,7 +7214,7 @@ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -7104,7 +7226,7 @@ ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -7130,7 +7252,7 @@ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -7138,7 +7260,7 @@ emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -7146,7 +7268,7 @@ emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -7170,14 +7292,14 @@ ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -7285,7 +7407,7 @@ ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -8068,8 +8190,8 @@ _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF @@ -8096,17 +8218,12 @@ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin91*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.012,.*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.012,*|,*powerpc*-darwin5-8*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -8494,8 +8611,8 @@ ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -8959,6 +9076,12 @@ lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) @@ -9003,7 +9126,7 @@ lt_prog_compiler_static='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ 1-7.* | *Sun*Fortran*\ 8.0-3*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' @@ -9426,20 +9549,23 @@ case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs=no + ;; esac ld_shlibs=yes @@ -9486,7 +9612,7 @@ whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ 01.* | *\ 2.0-9.* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -9598,6 +9724,7 @@ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; interix3-9*) @@ -9612,7 +9739,7 @@ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -9655,7 +9782,7 @@ compiler_needs_object=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes @@ -9667,13 +9794,14 @@ if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) @@ -9683,7 +9811,7 @@ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -9694,7 +9822,7 @@ fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -9815,7 +9943,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\(^B*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\(^B*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -10086,12 +10214,12 @@ cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes @@ -10132,7 +10260,7 @@ fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. @@ -10173,8 +10301,8 @@ output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no @@ -10208,7 +10336,7 @@ ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -10371,6 +10499,7 @@ if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi + link_all_deplibs=no else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' @@ -10388,11 +10517,12 @@ # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -10459,6 +10589,7 @@ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; osf3*) @@ -11151,7 +11282,7 @@ case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; @@ -11161,14 +11292,14 @@ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -11187,7 +11318,7 @@ done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\(a-zA-Z\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\(a-zA-Z\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -11224,7 +11355,7 @@ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -11257,7 +11388,7 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -11511,6 +11642,18 @@ dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -12410,30 +12553,41 @@ old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +if test -z "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - fi - ;; - *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - ;; - esac + ;; + esac + fi fi @@ -19106,8 +19260,8 @@ # pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XRENDER" >&5 -printf %s "checking for XRENDER... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for xrender >= 0.8.2 x11" >&5 +printf %s "checking for xrender >= 0.8.2 x11... " >&6; } if test -n "$XRENDER_CFLAGS"; then pkg_cv_XRENDER_CFLAGS="$XRENDER_CFLAGS" @@ -19147,7 +19301,7 @@ if test $pkg_failed = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -19174,7 +19328,7 @@ and XRENDER_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} @@ -19199,8 +19353,8 @@ # Check freetype configuration pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for FREETYPE" >&5 -printf %s "checking for FREETYPE... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for freetype2 >= 2.1.6" >&5 +printf %s "checking for freetype2 >= 2.1.6... " >&6; } if test -n "$FREETYPE_CFLAGS"; then pkg_cv_FREETYPE_CFLAGS="$FREETYPE_CFLAGS" @@ -19240,7 +19394,7 @@ if test $pkg_failed = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -19267,7 +19421,7 @@ and FREETYPE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} @@ -19292,8 +19446,8 @@ # Check fontconfig configuration pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for FONTCONFIG" >&5 -printf %s "checking for FONTCONFIG... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fontconfig >= 2.5.92" >&5 +printf %s "checking for fontconfig >= 2.5.92... " >&6; } if test -n "$FONTCONFIG_CFLAGS"; then pkg_cv_FONTCONFIG_CFLAGS="$FONTCONFIG_CFLAGS" @@ -19333,7 +19487,7 @@ if test $pkg_failed = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -19360,7 +19514,7 @@ and FONTCONFIG_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} @@ -19918,7 +20072,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libXft $as_me 2.3.4, which was +This file was extended by libXft $as_me 2.3.7, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19986,7 +20140,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -libXft config.status 2.3.4 +libXft config.status 2.3.7 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" @@ -20149,6 +20303,7 @@ lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' @@ -20157,6 +20312,7 @@ DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' @@ -20277,6 +20433,7 @@ lt_SP2NL \ lt_NL2SP \ reload_flag \ +FILECMD \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ @@ -20285,7 +20442,6 @@ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ -AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ @@ -21112,7 +21268,6 @@ cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. @@ -21232,6 +21387,9 @@ # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd +# A file(cmd) program that detects file types. +FILECMD=$lt_FILECMD + # An object symbol dumper. OBJDUMP=$lt_OBJDUMP @@ -21256,8 +21414,11 @@ # The archiver. AR=$lt_AR +# Flags to create an archive (by configure). +lt_ar_flags=$lt_ar_flags + # Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS +AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec @@ -21633,7 +21794,7 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" ||
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/configure.ac -> _service:tar_scm:libXft-2.3.7.tar.gz/configure.ac
Changed
@@ -27,13 +27,13 @@ # version. This version number will be substituted into Xft.h # Please bump the minor library number at each release as well. # -AC_INIT(libXft, 2.3.4, +AC_INIT(libXft, 2.3.7, https://gitlab.freedesktop.org/xorg/lib/libXft/issues, libXft) AC_CONFIG_SRCDIR(Makefile.am) AC_CONFIG_HEADERS(config.h) # Initialize Automake -AM_INIT_AUTOMAKE(foreign dist-bzip2) +AM_INIT_AUTOMAKE(foreign dist-xz) # Initialize libtool AC_PROG_LIBTOOL
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/include/X11/Xft/Xft.h -> _service:tar_scm:libXft-2.3.7.tar.gz/include/X11/Xft/Xft.h
Changed
@@ -1,24 +1,25 @@ /* include/X11/Xft/Xft.h. Generated from Xft.h.in by configure. */ /* + * Copyright © 2022 Thomas E. Dickey * Copyright © 2000 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the above copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The above copyright holders make no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. + * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF + * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _XFT_H_ @@ -30,7 +31,7 @@ /* #undef will be substituted by configure */ #define XFT_MAJOR 2 #define XFT_MINOR 3 -#define XFT_REVISION 4 +#define XFT_REVISION 7 #define XFT_VERSION ((XFT_MAJOR * 10000) + (XFT_MINOR * 100) + (XFT_REVISION)) #define XftVersion XFT_VERSION @@ -56,6 +57,7 @@ #define XFT_XLFD "xlfd" #define XFT_MAX_GLYPH_MEMORY "maxglyphmemory" #define XFT_MAX_UNREF_FONTS "maxunreffonts" +#define XFT_TRACK_MEM_USAGE "trackmemusage" extern FT_Library _XftFTlibrary; @@ -435,6 +437,9 @@ FcPattern *XftNameParse (_Xconst char *name); +FcBool +XftNameUnparse (FcPattern *pat, char *dest, int len); + /* xftrender.c */ void XftGlyphRender (Display *dpy,
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/include/X11/Xft/Xft.h.in -> _service:tar_scm:libXft-2.3.7.tar.gz/include/X11/Xft/Xft.h.in
Changed
@@ -1,23 +1,24 @@ /* + * Copyright © 2022 Thomas E. Dickey * Copyright © 2000 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the above copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The above copyright holders make no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. + * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF + * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _XFT_H_ @@ -55,6 +56,7 @@ #define XFT_XLFD "xlfd" #define XFT_MAX_GLYPH_MEMORY "maxglyphmemory" #define XFT_MAX_UNREF_FONTS "maxunreffonts" +#define XFT_TRACK_MEM_USAGE "trackmemusage" extern FT_Library _XftFTlibrary; @@ -434,6 +436,9 @@ FcPattern *XftNameParse (_Xconst char *name); +FcBool +XftNameUnparse (FcPattern *pat, char *dest, int len); + /* xftrender.c */ void XftGlyphRender (Display *dpy,
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/ltmain.sh -> _service:tar_scm:libXft-2.3.7.tar.gz/ltmain.sh
Changed
@@ -1,12 +1,12 @@ -#! /bin/sh +#! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 +## by inline-source v2019-02-19.15 -# libtool (GNU libtool) 2.4.6 +# libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.6 -package_revision=2.4.6 +VERSION="2.4.7 Debian-2.4.7-4" +package_revision=2.4.7 ## ------ ## @@ -64,34 +64,25 @@ # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2015-01-20.17; # UTC +scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# <https://opensource.org/license/MIT>, and GPL version 2 or later +# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# Please report bugs or propose patches to gary@gnu.org. +# Please report bugs or propose patches to: +# <https://github.com/gnulib-modules/bootstrap/issues> ## ------ ## @@ -139,9 +130,12 @@ _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# These NLS vars are set unconditionally (bootstrap issue #24). Unset those +# in case the environment reset is needed later and the $save_* variant is not +# defined (see the code above). +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' @@ -159,6 +153,26 @@ fi +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + ## ------------------------- ## ## Locate command utilities. ## @@ -259,7 +273,7 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } @@ -295,7 +309,7 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } @@ -360,6 +374,35 @@ s/\\(^$_G_bs\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" +# require_check_ifs_backslash +# --------------------------- +# Check if we can use backslash as IFS='\' separator, and set +# $check_ifs_backshlash_broken to ':' or 'false'. +require_check_ifs_backslash=func_require_check_ifs_backslash +func_require_check_ifs_backslash () +{ + _G_save_IFS=$IFS + IFS='\' + _G_check_ifs_backshlash='a\\b' + for _G_i in $_G_check_ifs_backshlash + do + case $_G_i in + a) + check_ifs_backshlash_broken=false + ;; + '') + break + ;; + *) + check_ifs_backshlash_broken=: + break + ;; + esac + done + IFS=$_G_save_IFS + require_check_ifs_backslash=: +} + ## ----------------- ## ## Global variables. ## @@ -387,7 +430,7 @@ # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # -# debug_cmd='eval echo "${FUNCNAME0} $*" >&2' bash your-script-name +# debug_cmd='echo "${FUNCNAME0} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: @@ -580,16 +623,16 @@ { $debug_cmd - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" } fi @@ -1091,85 +1134,203 @@ } -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () +# func_quote_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () { $debug_cmd - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - case $1 in - *\\\`\"\$*) - _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; - *) - _G_unquoted_arg=$1 ;; - esac - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + $require_check_ifs_backslash + + func_quote_portable_result=$2 + + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break fi - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *\\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ *|**|"") - _G_quoted_arg=\"$_G_unquoted_arg\" + # Quote for eval. + case $func_quote_portable_result in + *\\\`\"\$*) + # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string + # contains the shell wildcard characters. + case $check_ifs_backshlash_broken$func_quote_portable_result in + :*|*\\*\?*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break + ;; + esac + + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done + done + IFS=$func_quote_portable_old_IFS ;; - *) - _G_quoted_arg=$_G_unquoted_arg - ;; + *) ;; esac - - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift + break done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result in + # double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # many bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *\\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ *|**|"") + func_quote_portable_result=\"$func_quote_portable_result\" + ;; + esac } -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - $debug_cmd +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + ;; + *) + printf -v func_quotefast_eval_result %q "$1" + ;; + esac + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi - case $1 in - *\\\`\"*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; + +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () +{ + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: + ;; esac - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *\\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ *|**|"") - _G_arg=\"$_G_arg\" + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result ;; esac +} + - func_quote_for_expand_result=$_G_arg +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" + else + func_append func_quote_result "$func_quote_arg_result" + fi + shift + done } @@ -1215,8 +1376,8 @@ _G_cmd=$1 _G_fail_exp=${2-':'} - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" + func_quote_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" @@ -1241,8 +1402,8 @@ _G_fail_exp=${2-':'} $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || { @@ -1369,30 +1530,26 @@ # End: #! /bin/sh -# Set a version string for this script. -scriptversion=2014-01-07.03; # UTC - # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 -# Copyright (C) 2010-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# <https://opensource.org/license/MIT>, and GPL version 2 or later +# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# Please report bugs or propose patches to: +# <https://github.com/gnulib-modules/bootstrap/issues> -# Please report bugs or propose patches to gary@gnu.org. +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC ## ------ ## @@ -1415,7 +1572,7 @@ # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. +# starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the @@ -1427,7 +1584,7 @@ # to display verbose messages only when your user has specified # '--verbose'. # -# After sourcing this file, you can plug processing for additional +# After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. @@ -1476,8 +1633,8 @@ ## ------------------------- ## # This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. +# in the main code. A hook is just a list of function names that can be +# run in order later on. # func_hookable FUNC_NAME # ----------------------- @@ -1510,7 +1667,8 @@ # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +# Remove HOOK_FUNC from the list of hook functions to be called by +# FUNC_NAME. func_remove_hook () { $debug_cmd @@ -1519,10 +1677,28 @@ } +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi +} + + # func_run_hooks FUNC_NAME ARG... # --------------------------------- # Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more +# It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. @@ -1530,24 +1706,23 @@ { $debug_cmd + _G_rc_run_hooks=false + case " $hookable_fns " in *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; + *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift + fi done - - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result } @@ -1557,10 +1732,18 @@ ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed -# options in '<hooked_function_name>_result', escaped suitably for -# 'eval'. Like this: +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '<hooked_function_name>_result', escaped +# suitably for 'eval'. +# +# The '<hooked_function_name>_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). +# +# Like this: # # my_options_prep () # { @@ -1570,9 +1753,8 @@ # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # @@ -1581,25 +1763,36 @@ # { # $debug_cmd # -# # Note that for efficiency, we parse as many options as we can +# args_changed=false +# +# # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in -# --silent|-s) opt_silent=: ;; +# --silent|-s) opt_silent=: +# args_changed=: +# ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift +# args_changed=: # ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# # Only call 'func_quote' here if we processed at least one argument. +# if $args_changed; then +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result +# fi # } # func_add_hook func_parse_options my_silent_option # @@ -1610,17 +1803,26 @@ # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." -# -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # -# You'll alse need to manually amend $usage_message to reflect the extra +# You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. +# func_options_finish ARG... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish +} + + # func_options ARG... # --------------------- # All the functions called inside func_options are hookable. See the @@ -1630,17 +1832,27 @@ { $debug_cmd - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} + _G_options_quoted=false - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} + for my_func in options_prep parse_options validate_options options_finish + do + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: + fi + done - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_result + } } @@ -1649,9 +1861,8 @@ # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning. +# needs to propagate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { @@ -1662,9 +1873,7 @@ opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} - - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result + func_propagate_result func_run_hooks func_options_prep } @@ -1676,25 +1885,32 @@ { $debug_cmd - func_parse_options_result= - + _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} - - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false + fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. + _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" + func_echo "enabling shell trace mode" >&2 $debug_cmd ;; @@ -1704,7 +1920,10 @@ ;; --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break + if test $# = 0 && func_missing_arg $_G_opt; then + _G_parse_options_requote=: + break + fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above @@ -1757,15 +1976,24 @@ shift ;; - --) break ;; + --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; esac + + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi done - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + if $_G_parse_options_requote; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result + fi } @@ -1782,12 +2010,10 @@ test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} + func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE - - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result } @@ -1843,8 +2069,8 @@ # func_split_equals STRING # ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. +# Set func_split_equals_lhs and func_split_equals_rhs shell variables +# after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ @@ -1859,8 +2085,9 @@ func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. @@ -1870,7 +2097,7 @@ func_split_equals_lhs=`expr "x$1" : 'x\(^=*\)'` func_split_equals_rhs= - test "x$func_split_equals_lhs" = "x$1" \ + test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x^=*=\(.*\)$'` } fi #func_split_equals @@ -1896,7 +2123,7 @@ { $debug_cmd - func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt @@ -1938,31 +2165,44 @@ # func_version # ------------ # Echo version message to standard output and exit. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more - } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\) 0-9,-* ,-\(1-90-9* \)|\1 \2| - p + /^# Written by /!b + s|^# ||; p; n + + :fwd2blnk + /./ { + n + b fwd2blnk } - /^# Written by / { - s|^# || - p + p; n + + :holdwrnt + s|^# || + s|^# *$|| + /^Copyright /!{ + /./H + n + b holdwrnt } - /^warranty; /q' < "$progpath" + + s|\((C)\) 0-9,-* ,-\(1-90-9* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" exit $? } @@ -1972,12 +2212,12 @@ # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.6' +scriptversion='(GNU libtool) 2.4.7' # func_echo ARG... @@ -2068,12 +2308,12 @@ compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.6 + version: $progname $scriptversion Debian-2.4.7-4 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to <bug-libtool@gnu.org>. -GNU libtool home page: <http://www.gnu.org/software/libtool/>. +GNU libtool home page: <http://www.gnu.org/s/libtool/>. General help using GNU software: <http://www.gnu.org/gethelp/>." exit 0 } @@ -2124,7 +2364,7 @@ # a configuration failure hint, and exit. func_fatal_configuration () { - func__fatal_error ${1+"$@"} \ + func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } @@ -2270,6 +2510,10 @@ nonopt= preserve_args= + _G_rc_lt_options_prep=: + + _G_rc_lt_options_prep=: + # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) @@ -2293,11 +2537,16 @@ uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; + *) + _G_rc_lt_options_prep=false + ;; esac - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote eval ${1+"$@"} + libtool_options_prep_result=$func_quote_result + fi } func_add_hook func_options_prep libtool_options_prep @@ -2309,9 +2558,12 @@ { $debug_cmd + _G_rc_lt_parse_options=false + # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do + _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in @@ -2386,15 +2638,20 @@ func_append preserve_args " $_G_opt" ;; - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done - - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + libtool_parse_options_result=$func_quote_result + fi } func_add_hook func_parse_options libtool_parse_options @@ -2451,8 +2708,8 @@ } # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options @@ -3418,8 +3675,8 @@ esac done - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ + func_quote_arg pretty "$libobj" + test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '~#^*{};<>?"'"'"' &()|`$' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" @@ -3492,8 +3749,8 @@ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result + func_quote_arg pretty "$srcfile" + qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then @@ -3648,7 +3905,8 @@ -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler + -Wc,FLAG + -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. @@ -3754,6 +4012,8 @@ -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wa,FLAG + -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) @@ -4096,8 +4356,8 @@ case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " + func_quote_arg pretty "$nonopt" + install_prog="$func_quote_arg_result " arg=$1 shift else @@ -4107,8 +4367,8 @@ # The real first argument should be the name of the installation program. # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *\\\ /cp\ *) install_cp=: ;; @@ -4165,12 +4425,12 @@ esac # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then - func_quote_for_eval "$arg2" + func_quote_arg pretty "$arg2" fi - func_append install_shared_prog " $func_quote_for_eval_result" + func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ @@ -4181,8 +4441,8 @@ if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" + func_quote_arg pretty "$install_override_mode" + func_append install_shared_prog " -m $func_quote_arg_result" fi fi @@ -4478,8 +4738,8 @@ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$relink_command" + eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else @@ -5258,7 +5518,8 @@ if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + func_quote_arg pretty "$ECHO" + qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. @@ -5268,7 +5529,7 @@ \$1 _LTECHO_EOF' } - ECHO=\"$qECHO\" + ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to @@ -6611,9 +6872,9 @@ while test "$#" -gt 0; do arg=$1 shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" + func_quote_arg pretty,unquoted "$arg" + qarg=$func_quote_arg_unquoted_result + func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then @@ -6849,6 +7110,13 @@ prev= continue ;; + xassembler) + func_append compiler_flags " -Xassembler $qarg" + prev= + func_append compile_command " -Xassembler $qarg" + func_append finalize_command " -Xassembler $qarg" + continue + ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" @@ -7019,7 +7287,7 @@ # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; @@ -7039,7 +7307,7 @@ esac elif test X-lc_r = "X$arg"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -7069,8 +7337,20 @@ prev=xcompiler continue ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. + -pthread) + case $host in + *solaris2*) ;; + *) + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + ;; + esac + continue + ;; + -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" @@ -7211,9 +7491,9 @@ save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $func_quote_arg_result" + func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" @@ -7227,16 +7507,21 @@ save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $wl$func_quote_arg_result" + func_append compiler_flags " $wl$func_quote_arg_result" + func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; + -Xassembler) + prev=xassembler + continue + ;; + -Xcompiler) prev=xcompiler continue @@ -7254,8 +7539,8 @@ # -msg_* for osf cc -msg_*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: @@ -7272,12 +7557,19 @@ # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang + # -fsanitize=* Clang/GCC memory and address sanitizer + # -fuse-ld=* Linker select flags for GCC + # -static-* direct GCC to link specific libraries statically + # -fcilkplus Cilk Plus language extension features for C/C++ + # -Wa,* Pass flags directly to the assembler -64|-mips0-9|-r0-90-9*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t45*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus|-Wa,*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" @@ -7298,15 +7590,15 @@ continue else # Otherwise treat like 'Some other compiler flag' below - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; *.$objext) @@ -7426,8 +7718,8 @@ *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; esac # arg @@ -7568,7 +7860,10 @@ case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then @@ -7887,19 +8182,19 @@ # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done continue fi # $pass = conv @@ -8632,7 +8927,7 @@ test CXX = "$tagname" && { case $host_os in linux*) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi @@ -8805,7 +9100,7 @@ # case $version_type in # correct linux to gnu/linux during the next big refactor - darwin|freebsd-elf|linux|osf|windows|none) + darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor @@ -8823,6 +9118,9 @@ revision=$number_minor lt_irix_increment=no ;; + *) + func_fatal_configuration "$modename: unknown library version type '$version_type'" + ;; esac ;; no) @@ -8896,7 +9194,7 @@ versuffix=.$current.$revision ;; - freebsd-elf) + freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision @@ -9122,7 +9420,7 @@ *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -9933,8 +10231,8 @@ for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10027,8 +10325,8 @@ eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10502,12 +10800,13 @@ elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty "$var_value" + relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" + relink_command=$func_quote_arg_unquoted_result fi # Only actually do things if not in dry run mode. @@ -10747,13 +11046,15 @@ elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty,unquoted "$var_value" + relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + func_quote_arg pretty,unquoted "$relink_command" + relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/man/Makefile.am -> _service:tar_scm:libXft-2.3.7.tar.gz/man/Makefile.am
Changed
@@ -1,11 +1,101 @@ -libman_PRE = Xft.man libmandir = $(LIB_MAN_DIR) + +libman_PRE = \ + Xft.man \ + $(Xft_sources) + +Xft_sources = \ + $(Xft_shadows:=.man) + +Xft_shadows = \ + XftCharExists \ + XftCharFontSpecRender \ + XftCharIndex \ + XftCharSpecRender \ + XftColorAllocName \ + XftColorAllocValue \ + XftColorFree \ + XftDefaultHasRender \ + XftDefaultSet \ + XftDefaultSubstitute \ + XftDrawChange \ + XftDrawCharFontSpec \ + XftDrawCharSpec \ + XftDrawColormap \ + XftDrawCreate \ + XftDrawCreateAlpha \ + XftDrawCreateBitmap \ + XftDrawDestroy \ + XftDrawDisplay \ + XftDrawDrawable \ + XftDrawGlyphFontSpec \ + XftDrawGlyphSpec \ + XftDrawGlyphs \ + XftDrawPicture \ + XftDrawRect \ + XftDrawSetClip \ + XftDrawSetClipRectangles \ + XftDrawSetSubwindowMode \ + XftDrawSrcPicture \ + XftDrawString16 \ + XftDrawString32 \ + XftDrawString8 \ + XftDrawStringUtf16 \ + XftDrawStringUtf8 \ + XftDrawVisual \ + XftFontCheckGlyph \ + XftFontClose \ + XftFontCopy \ + XftFontInfoCreate \ + XftFontInfoDestroy \ + XftFontInfoEqual \ + XftFontInfoHash \ + XftFontLoadGlyphs \ + XftFontMatch \ + XftFontOpen \ + XftFontOpenInfo \ + XftFontOpenName \ + XftFontOpenPattern \ + XftFontOpenXlfd \ + XftFontUnloadGlyphs \ + XftGetVersion \ + XftGlyphExtents \ + XftGlyphFontSpecRender \ + XftGlyphRender \ + XftGlyphSpecRender \ + XftInit \ + XftInitFtLibrary \ + XftListFonts \ + XftLockFace \ + XftNameParse \ + XftNameUnparse \ + XftTextExtents16 \ + XftTextExtents32 \ + XftTextExtents8 \ + XftTextExtentsUtf16 \ + XftTextExtentsUtf8 \ + XftTextRender16 \ + XftTextRender16BE \ + XftTextRender16LE \ + XftTextRender32 \ + XftTextRender32BE \ + XftTextRender32LE \ + XftTextRender8 \ + XftTextRenderUtf16 \ + XftTextRenderUtf8 \ + XftUnlockFace \ + XftXlfdParse + libman_DATA = $(libman_PRE:man=$(LIB_MAN_SUFFIX)) EXTRA_DIST = $(libman_PRE) -CLEANFILES = $(libman_DATA) +CLEANFILES = $(libman_DATA) $(Xft_sources) + SUFFIXES = .$(LIB_MAN_SUFFIX) .man +$(Xft_sources) : + $(AM_V_GEN)echo ".so man__libmansuffix__/Xft.__libmansuffix__" > $@ + # String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure .man.$(LIB_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/man/Makefile.in -> _service:tar_scm:libXft-2.3.7.tar.gz/man/Makefile.in
Changed
@@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.16.4 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. @@ -186,6 +186,7 @@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ @@ -297,11 +298,96 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -libman_PRE = Xft.man libmandir = $(LIB_MAN_DIR) +libman_PRE = \ + Xft.man \ + $(Xft_sources) + +Xft_sources = \ + $(Xft_shadows:=.man) + +Xft_shadows = \ + XftCharExists \ + XftCharFontSpecRender \ + XftCharIndex \ + XftCharSpecRender \ + XftColorAllocName \ + XftColorAllocValue \ + XftColorFree \ + XftDefaultHasRender \ + XftDefaultSet \ + XftDefaultSubstitute \ + XftDrawChange \ + XftDrawCharFontSpec \ + XftDrawCharSpec \ + XftDrawColormap \ + XftDrawCreate \ + XftDrawCreateAlpha \ + XftDrawCreateBitmap \ + XftDrawDestroy \ + XftDrawDisplay \ + XftDrawDrawable \ + XftDrawGlyphFontSpec \ + XftDrawGlyphSpec \ + XftDrawGlyphs \ + XftDrawPicture \ + XftDrawRect \ + XftDrawSetClip \ + XftDrawSetClipRectangles \ + XftDrawSetSubwindowMode \ + XftDrawSrcPicture \ + XftDrawString16 \ + XftDrawString32 \ + XftDrawString8 \ + XftDrawStringUtf16 \ + XftDrawStringUtf8 \ + XftDrawVisual \ + XftFontCheckGlyph \ + XftFontClose \ + XftFontCopy \ + XftFontInfoCreate \ + XftFontInfoDestroy \ + XftFontInfoEqual \ + XftFontInfoHash \ + XftFontLoadGlyphs \ + XftFontMatch \ + XftFontOpen \ + XftFontOpenInfo \ + XftFontOpenName \ + XftFontOpenPattern \ + XftFontOpenXlfd \ + XftFontUnloadGlyphs \ + XftGetVersion \ + XftGlyphExtents \ + XftGlyphFontSpecRender \ + XftGlyphRender \ + XftGlyphSpecRender \ + XftInit \ + XftInitFtLibrary \ + XftListFonts \ + XftLockFace \ + XftNameParse \ + XftNameUnparse \ + XftTextExtents16 \ + XftTextExtents32 \ + XftTextExtents8 \ + XftTextExtentsUtf16 \ + XftTextExtentsUtf8 \ + XftTextRender16 \ + XftTextRender16BE \ + XftTextRender16LE \ + XftTextRender32 \ + XftTextRender32BE \ + XftTextRender32LE \ + XftTextRender8 \ + XftTextRenderUtf16 \ + XftTextRenderUtf8 \ + XftUnlockFace \ + XftXlfdParse + libman_DATA = $(libman_PRE:man=$(LIB_MAN_SUFFIX)) EXTRA_DIST = $(libman_PRE) -CLEANFILES = $(libman_DATA) +CLEANFILES = $(libman_DATA) $(Xft_sources) SUFFIXES = .$(LIB_MAN_SUFFIX) .man all: all-am @@ -524,6 +610,9 @@ .PRECIOUS: Makefile +$(Xft_sources) : + $(AM_V_GEN)echo ".so man__libmansuffix__/Xft.__libmansuffix__" > $@ + # String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure .man.$(LIB_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/man/Xft.man -> _service:tar_scm:libXft-2.3.7.tar.gz/man/Xft.man
Changed
@@ -1,31 +1,87 @@ -.\" +'\" t +.\" Copyright © 2022 Thomas E. Dickey .\" Copyright © 2000 Keith Packard .\" .\" Permission to use, copy, modify, distribute, and sell this software and its .\" documentation for any purpose is hereby granted without fee, provided that .\" the above copyright notice appear in all copies and that both that .\" copyright notice and this permission notice appear in supporting -.\" documentation, and that the name of Keith Packard not be used in -.\" advertising or publicity pertaining to distribution of the software without -.\" specific, written prior permission. Keith Packard makes no -.\" representations about the suitability of this software for any purpose. It -.\" is provided "as is" without express or implied warranty. +.\" documentation, and that the name of the above copyright holders not be used +.\" in advertising or publicity pertaining to distribution of the software +.\" without specific, written prior permission. The above copyright holders +.\" make no representations about the suitability of this software for any +.\" purpose. It is provided "as is" without express or implied warranty. .\" -.\" KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -.\" INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -.\" EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR -.\" CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -.\" DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -.\" TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +.\" THE ABOVE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS +.\" SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, +.\" INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +.\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR .\" PERFORMANCE OF THIS SOFTWARE. .\" -.TH Xft __libmansuffix__ __vendorversion__ +.de TA +.ie n .ta 0.8i 1.6i 2.4i 3.2i +.el .ta 0.5i 1.0i 1.5i 2.0i +.. +.de PS +.sp +.ns +.TP \\$1 +.na +.nf +.ie n .ta 0.8i 3.0i +.el .ta 0.5i 2.0i +.. +.de PE +.br +.ad +.fi +.sp +.TA +.. +.de QS +.in +.2i +.nf +.na +.ie n .ta 1.0i 3.0i +.el .ta 0.6i 2.0i +.. +.de QC +.QS +.ie n .ta 2.0i 3.0i +.el .ta 1.6i 2.6i +.ft CR +.. +.de QE +.in -.2i +.ft +.fi +.ad +.TA +.. +.de bP +.ie n .IP \(bu 4 +.el .IP \(bu 2 +.. +.ie \n(.g .ds `` \(lq +.el .ds `` `` +.ie \n(.g .ds '' \(rq +.el .ds '' '' +.TH Xft __libmansuffix__ __vendorversion__ "X Version 11" .SH NAME - Xft \- X FreeType interface library +Xft \- X FreeType interface library .SH DESCRIPTION .B Xft -is a simple library designed to interface the FreeType rasterizer with the X -Rendering Extension. +is a simple library which draws text and graphics: +.bP +using information provided by the Fontconfig library, +.bP +.B Xft +converts font glyphs using the FreeType rasterizer, and +.bP +displays the converted font data using the X Rendering Extension. +.PP This manual page barely scratches the surface of this library. .SH "HEADER FILE" .B #include <X11/Xft/Xft.h> @@ -58,7 +114,7 @@ The following example illustrates how .BR Xft 's version constants might be used: -.nf +.QS #if (XFT_VERSION >= 20107) (void) puts("Version 2.1.7 or later of the Xft library is in" " use."); @@ -68,41 +124,125 @@ XFT_MINOR, XFT_REVISION); #endif -.fi +.QE .\" I don't understand what these are for. -- BR, 2005-04-02 -.\" XFT_CORE used in xftname.c -.\" XFT_RENDER used in xftdpy.c, xftfreetype.c, xftname.c -.\" XFT_XLFD used in xftname.c, xftxlfd.c -.\" XFT_MAX_GLYPH_MEMORY used in xftdpy.c, xftfreetype.c -.\" XFT_MAX_UNREF_FONTS used in xftdpy.c .\" XFT_NMISSING used in xftcore.c, xftextent.c, xftglyphs.c, .\" xftrender.c .SH "DATA TYPES" -.TP -.B XftFont -.nf +Xft datatypes follow a naming convention, +prefixing all names with \*(``Xft\*('' +.SS From Xlib... +Xlib datatypes do not follow a naming convention. +They are documented in +.IR "Xlib \- C Language Interface" . +.PP +.B Xft +uses these names: +Bool, +Colormap, +Display, +Drawable, +Pixmap, +Region, +Visual, and +XRectangle. +.PP +Some datatypes are especially relevant to +.BR Xft : +.TP 5 +.B Drawable +Declared in \fI<X11/X.h>\fP, +this is an X resource ID, +e.g., a window associated with a display. +Both windows and pixmaps can be used as sources and destinations +in graphics operations. +These windows and pixmaps are collectively known as drawables. +However, an +.B InputOnly +window cannot be used as a source or destination in a +graphics operation. +.TP 5 +.B Region +Declared in \fI<X11/Xutil.h>\fP and \fI<X11/Xregion.h>\fP, +a +.B Region +is an arbitrary set of pixel locations which Xlib can manipulate. +Internally, a +.B Region +is represented by the union of an arbitrary number of rectangles. +Xlib maintains a rectangle which tells it the extent of this union. +.TP 5 +.B Visual +Declared in \fI<X11/Xutil.h>\fP, +this structure contains information about the possible color mapping. +.SS From XRender... +The X Render Extension library +datatypes are inspired by Xlib, +but lack the corresponding documentation. +Refer to the header file for details: +.RS +.PP +.I <X11/extensions/Xrender.h> +.RE +.PP +or read the source code (which provides an outline of libXrender). +.PP +.B Xft +uses these names: +Picture, +XGlyphInfo, +XRenderColor. +.SS From Fontconfig... +Fontconfig datatypes follow a naming convention, +prefixing all names with \*(``Fc\*('' which are documented in +.IR "Fontconfig Developers Reference" . +.PP +.B Xft +uses these Fontconfig names: +FcBool, +FcChar8, +FcChar16, +FcChar32, +FcCharSet, +FcEndian, +FcFontSet, +FcPattern, and +FcResult. +.SS From FreeType 2... +FreeType 2 datatypes follow a naming convention, +prefixing all names with \*(``FT_\*('' which are documented in +.IR "FreeType API Reference" . +.PP +.B Xft +uses these names: +FT_Face, +FT_Library, and +FT_UInt. +.PP +FreeType 2 uses +.B FT_UInt +(an unsigned integer) +to represent +.IR glyphs . +.SS XftFont +.QS typedef struct _XftFont { - int ascent; - int descent; - int height; - int max_advance_width; - FcCharSet *charset; - FcPattern *pattern; + int ascent; + int descent; + int height; + int max_advance_width; + FcCharSet *charset; + FcPattern *pattern; } XftFont; -.fi +.QE +.PP An .B XftFont is the primary data structure of interest to programmers using .BR Xft ; it contains general font metrics and pointers to the Fontconfig character set and pattern associated with the font. -The -.B FcCharSet -and -.B FcPattern -data types are defined by the Fontconfig library. -.TP -.B "" +.PP .BR XftFont s are populated with any of .BR XftFontOpen (), @@ -124,8 +264,7 @@ .BR Xft ; the programmer does not ordinarily need to allocate or free storage for them. -.TP -.B "" +.PP .BR XftDrawGlyphs (), the .BR XftDrawString *() @@ -139,15 +278,13 @@ .B XftDraw object, which may correspond to either a core X drawable or an X Rendering Extension drawable. -.TP -.B "" +.PP .BR XftGlyphExtents () and the .BR XftTextExtents *() family are used to determine the extents (maximum dimensions) of an .BR XftFont . -.TP -.B "" +.PP An .BR XftFont 's glyph or character coverage can be determined with @@ -158,8 +295,7 @@ returns the .BR XftFont -specific character index corresponding to a given Unicode codepoint. -.TP -.B "" +.PP .BR XftGlyphRender (), .BR XftGlyphSpecRender (), .BR XftCharSpecRender (), @@ -170,6 +306,7 @@ to draw into X Rendering Extension .B Picture structures. +.PP .B Note: .BR XftDrawGlyphs (), the @@ -180,11 +317,7 @@ .BR XftDrawGlyphSpec () provide a means of rendering fonts that is independent of the availability of the X Rendering Extension on the X server. -.\" I'm not sure what these are for; they're used internally, but why -.\" would any external users want them? -- BR, 2005-04-02 -.\" .BR XftLockFace() -.\" .BR XftUnlockFace() -.TP +.SS .B XftFontInfo is an opaque object that stores information about a font. .B XftFontInfo @@ -199,8 +332,7 @@ .BR Xft ; the programmer does not ordinarily need to allocate or free storage for them. -.TP -.B "" +.PP Each .B XftFontInfo structure in use is associated with a unique identifier, which can be @@ -212,23 +344,20 @@ .B XftFontInfo data with .BR XftFontOpenInfo (). -.TP +.SS .B XftColor -.nf +.QS typedef struct _XftColor { - unsigned long pixel; - XRenderColor color; + unsigned long pixel; + XRenderColor color; } XftColor; -.fi +.QE +.PP An .B XftColor object permits text and other items to be rendered in a particular color (or the closest approximation offered by the X visual in use). -The -.B XRenderColor -data type is defined by the X Render Extension library. -.TP -.B "" +.PP .BR XftColorAllocName () and .BR XftColorAllocValue () @@ -238,9 +367,8 @@ .BR XftColorFree () instructs the X server to free the color currently allocated for an .BR XftColor . -.TP -.B "" -One an +.PP +Once an .B XftColor has been initialized, .BR XftDrawSrcPicture (), @@ -255,12 +383,11 @@ and .BR XftDrawRect () may be used to draw various objects using it. -.TP +.SS .B XftDraw is an opaque object which holds information used to render to an X drawable using either the core protocol or the X Rendering extension. -.TP -.B "" +.PP .B XftDraw objects are created with any of .BR XftDrawCreate () @@ -276,20 +403,19 @@ .B XftDraw can be changed with .BR XftDrawChange (). -.BR XftDraw s -are internally allocated and freed by +.B XftDraw +objects are internally allocated and freed by .BR Xft ; the programmer does not ordinarily need to allocate or free storage for them. -.TP -.B "" +.PP The X .BR Display , .BR Drawable , .BR Colormap , and .B Visual -of an +properties of an .B XftDraw can be queried with .BR XftDrawDisplay (), @@ -298,97 +424,296 @@ and .BR XftDrawVisual (), respectively. +.PP +Several functions use +.B XftDraw +objects: +.BR XftDrawCharFontSpec (), +.BR XftDrawCharSpec (), +.BR XftDrawGlyphFontSpec (), +.BR XftDrawGlyphSpec (), +.BR XftDrawGlyphs (), +.BR XftDrawRect (), +.BR XftDrawSetClip (), +.BR XftDrawSetClipRectangles (), +.BR XftDrawSetSubwindowMode (), +and the +.BR XftDrawString *() +family. +.PP The X Rendering Extension .B Picture associated with an .B XftDraw is returned by -.BR XftDrawPicture (). -.\" XftDrawSrcPicture -.\" XftDrawGlyphs -.\" XftDrawString* -.\" XftDrawCharSpec -.\" XftDrawCharFontSpec -.\" XftDrawGlyphSpec -.\" XftDrawGlyphFontSpec -.\" XftDrawRect -.\" XftDrawSetClip -.\" XftDrawSetClipRectangles -.\" XftDrawSetSubwindowMode -.TP +.BR XftDrawPicture (), +and +.BR XftDrawSrcPicture (). +It is used by +.BR XftCharFontSpecRender (), +.BR XftCharSpecRender (), +.BR XftGlyphFontSpecRender (), +.BR XftGlyphRender (), +.BR XftGlyphSpecRender (), +and the +.BR XftTextRender *() +family. +.SS .B XftCharSpec -.nf +.QS typedef struct _XftCharSpec { - FcChar32 ucs4; - short x; - short y; + FcChar32 ucs4; + short x; + short y; } XftCharSpec; -.fi -.TP -.B "" -The -.B FcChar32 -data type is defined by the Fontconfig library. -.\" XftDrawCharSpec -.\" XftCharSpecRender -.TP +.QE +.PP +.B XftCharSpec +is used by +.BR XftDrawCharSpec (), +and +.BR XftCharSpecRender (). +.SS .B XftCharFontSpec -.nf +.QS typedef struct _XftCharFontSpec { - XftFont *font; - FcChar32 ucs4; - short x; - short y; + XftFont *font; + FcChar32 ucs4; + short x; + short y; } XftCharFontSpec; -.fi -.TP -.B "" -The -.B FcChar32 -data type is defined by the Fontconfig library. -.\" XftDrawCharFontSpec -.\" XftCharFontSpecRender -.TP +.QE +.PP +.B XftCharFontSpec +is used by +.BR XftCharFontSpecRender (). +.SS .B XftGlyphSpec -.nf +.QS typedef struct _XftGlyphSpec { - FT_UInt glyph; - short x; - short y; + FT_UInt glyph; + short x; + short y; } XftGlyphSpec; -.fi -.TP -.B "" -The -.B FT_UInt -data type is defined by the FreeType library. -.\" XftDrawGlyphSpec -.\" XftGlyphSpecRender -.TP -.B XftGlyphFontSpec -.nf +.QE +.PP +.B XftGlyphSpec +is used by +.BR XftDrawGlyphSpec (). +.SS XftGlyphFontSpec +.QS typedef struct _XftGlyphFontSpec { - XftFont *font; - FT_UInt glyph; - short x; - short y; + XftFont *font; + FT_UInt glyph; + short x; + short y; } XftGlyphFontSpec; -.fi -.TP -.B "" -The -.B FT_UInt -data type is defined by the FreeType library. -.\" XftDrawGlyphFontSpec -.\" XftGlyphFontSpecRender +.QE +.PP +.B XftGlyphFontSpec +is used by +.BR XftDrawGlyphFontSpec (), +and +.BR XftGlyphFontSpecRender (). .SH FUNCTIONS +.\" ************************************************************************* +.SS "Initialization" +A typical application using +.B Xft +does not explicitly initialize the library. +That is usually done as a side-effect of opening a font. +.PP +When +.B Xft +initializes, it collects information about the display, +and stores some of that information in a Fontconfig pattern +(essentially a collection of properties with typed values). +The calling application can modify that pattern +to change the library's behavior. +.PP +Not all of the collected information is stored in a pattern. +The remainder is stored in internal data structures. +.B Xft +makes some of that available to the application via functions. +.PS +\fBBool\fP \fBXftDefaultHasRender\fP ( + \fBDisplay\fP *\fIdpy\fP); +.PE +Obtain information about the display +.I dpy +if not done already, and +return true if +.B Xft +found that the display supports the X Render extension, +and if it is able to find a suitable +.B XRenderPictFormat +(X Render's datatype which is analogous to Xlib's Visual) +on the display. +.PS +\fBBool\fP \fBXftDefaultSet\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBFcPattern\fP *\fIdefaults\fP); +.PE +Obtain information about the display +.I dpy +if not done already, and +set the Fontconfig pattern holding default properties +which +.B Xft +will use for this display. +.IP +.B Xft +uses those properties initially to obtain these limits: +.RS 10 +.TP 5 +XFT_MAX_GLYPH_MEMORY +(maxglyphmemory). +This is the maximum amount of glyph memory for all fonts used by +.B Xft +(default: 4*1024*1024). +.TP 5 +XFT_MAX_UNREF_FONTS +(maxunreffonts). +This is the maximum number of unreferenced fonts +(default: 16). +.TP 5 +XFT_TRACK_MEM_USAGE +(trackmemusage). +When true, +.B Xft +tracks usage of glyph memory to improve performance when +deciding which to unload when the maximum amount of glyph memory is reached +(default: false). +.RE +.IP +.B Xft +also uses these default properties in +.BR XftDefaultSubstitute (). +.PS +\fBvoid\fP \fBXftDefaultSubstitute\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBint\fP \fIscreen\fP, + \fBFcPattern\fP *\fIpattern\fP); +.PE +.B Xft +fills in missing properties in the given +.I pattern +using default properties for the specified display +.IR dpy , +e.g., as set in +.BR XftDefaultSet (). +.IP +Typical +.B Xft +applications use this function to help Fontconfig +choose a suitable font. +These properties are substituted before calling +.BR FcDefaultSubstitute (): +.RS 10 +.TP 5 +FC_ANTIALIAS +True if FreeType should use antialiasing +(default: False). +(default: True). +.TP 5 +FC_AUTOHINT +True if FreeType should use autohinting +(default: False). +.TP 5 +FC_DPI +Dots/inch used for resolution +(default: computed from the display height). +.TP 5 +FC_EMBOLDEN +True if +.BR FT_GlyphSlot_Embolden () +should be used to embolden a font +(default: False). +.TP 5 +FC_HINTING +True if hinting should be used when filling in properties to open a font +(default: True). +.TP 5 +FC_HINT_STYLE +Hinting style used when filling in properties to open a font +(default: FC_HINT_FULL). +.TP 5 +FC_LCD_FILTER +Parameter passed to +.BR FT_Library_SetLcdFilter () +when loading glyphs +(default: FC_LCD_DEFAULT). +.TP 5 +FC_MINSPACE +Minimum space value used when filling in properties to open a font +(default: False). +.TP 5 +FC_RGBA +RGBA value used when filling in properties to open a font +(default: computed by calling +.BR XRenderQuerySubpixelOrder ()). +.TP 5 +FC_SCALE +Scale used in Fontconfig +(default: 1.0). +.TP 5 +XFT_MAX_GLYPH_MEMORY +Maximum memory for one font +(default: 1024*1024). +.TP 5 +XFT_RENDER +True if the display supports X Render extension +(default: result from +.BR XftDefaultHasRender ()). +.RE +.PS +\fBFcBool\fP \fBXftInit\fP ( + \fB_Xconst char\fP *\fIconfig\fP); +.PE +Initializes the Fontconfig library (calling +.BR FcInit ()). +.IP +The \fIconfig\fP parameter is unused. +.IP +.B Xft +does not deinitialize the Fontconfig library when it is done. +.PS +\fBFcBool\fP \fBXftInitFtLibrary\fP (\fBvoid\fP); +.PE +Initializes the FreeType library +(calling +.BR FT_Init_FreeType () +to create a library object) +if it has not already been initialized. +This is needed before using the FreeType library to read font data from a file. +.IP +.B Xft +calls +.BR XftInitFtLibrary () +internally via +.BR XftFontInfoCreate "() and" +.BR XftFontOpenPattern (). +.IP +.B Xft +does not discard the library object +(e.g., using +.BR FT_Done_FreeType ()) +when it is done. +.PS +\fBint\fP \fBXftGetVersion\fP (\fBvoid\fP); +.PE +Return \fBXftVersion\fP, enabling an application to determine the +actual version of +.B Xft +which is in use. +.\" ************************************************************************* .SS "Opening and Matching Fonts" -.nf -\fBXftFont *\fR -\fBXftFontOpen (Display *\fIdpy\fB,\fR -\fB int \fIscreen\fB,\fR -\fB ...);\fR\fR -.fi +.PS +\fBXftFont\fP *\fBXftFontOpen\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBint\fP \fIscreen\fP, + ...); +.PE .B XftFontOpen takes a list of pattern element triples of the form .IR field , " type" , " value" @@ -397,28 +722,27 @@ .I screen on display .IR dpy . -The -.B Display -data type is defined by the X11 library. -Returns NULL if no match is found. +Return the matched font, or +NULL if no match is found. .PP Example: -.nf +.QS font = XftFontOpen (dpy, screen, XFT_FAMILY, XftTypeString, "charter", XFT_SIZE, XftTypeDouble, 12.0, NULL); -.fi -This opens the \(lqcharter\(rq font at 12 points. +.QE +.IP +This opens the \*(``charter\*('' font at 12 points. The point size is automatically converted to the correct pixel size based on the resolution of the monitor. .PP -.nf -\fBXftFont *\fR -\fBXftFontOpenName (Display *\fIdpy\fB,\fR -\fB int \fIscreen\fB,\fR -\fB unsigned char *\fIname\fB);\fR -.fi +.PS +\fBXftFont\fP *\fBXftFontOpenName\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBint\fP \fIscreen\fP, + \fB_Xconst char\fP *\fIname\fP); +.PE .B XftFontOpenName behaves as .B XftFontOpen @@ -427,45 +751,139 @@ .BR FcNameParse () function). .PP -.nf -\fBXftFont *\fR -\fBXftFontOpenXlfd (Display *\fIdpy\fB,\fR -\fB int \fIscreen\fB,\fR -\fB unsigned char *\fIxlfd\fB)\fR -.fi +.PS +\fBXftFont\fP *\fBXftFontOpenXlfd\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBint\fP \fIscreen\fP, + \fB_Xconst char\fP *\fIxlfd\fP) +.PE .B XftFontOpenXlfd behaves as .B XftFontOpen does, except that it takes a string containing an X Logical Font -Description (XLFD). +Description (XLFD), +and uses the +.BR XftXlfdParse () +function. .PP -.nf -\fBFcPattern *\fR -\fBXftFontMatch (Display *\fIdpy\fB,\fR -\fB int \fIscreen\fB,\fR -\fB FcPattern *\fIpattern\fB,\fR -\fB FcResult *\fIresult\fB);\fR -.fi +.PS +\fBFcPattern\fP *\fBXftFontMatch\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBint\fP \fIscreen\fP, + \fB_Xconst FcPattern\fP *\fIpattern\fP, + \fBFcResult\fP *\fIresult\fP); +.PE Also used internally by the .BR XftFontOpen * functions, .B XftFontMatch can also be used directly to determine the Fontconfig font pattern -resulting from an Xft font open request. -The -.B FcPattern +resulting from an +.B Xft +font open request. +.PS +\fBFcPattern\fP *\fBXftXlfdParse\fP ( + \fB_Xconst char\fP *\fIxlfd_orig\fP, + \fBBool\fP \fIignore_scalable\fP, + \fBBool\fP \fIcomplete\fP); +.PE +.B XftXlfdParse +parses the +.I xlfd_orig +parameter according to the +.I X Logical Font Description Conventions +document, but ignores +some of the fields: +.IR setwidth_name , +.IR add_style_name , +.IR spacing , and -.B FcResult -data types are defined by the Fontconfig library. -.SS "Determining the Pixel Extents of a Text String" -.nf -\fBvoid\fR -\fBXftTextExtents8 (Display *\fIdpy\fB,\fR -\fB XftFont *\fIfont\fB,\fR -\fB FcChar8 *\fIstring\fB,\fR -\fB int \fIlen\fB,\fR -\fB XGlyphInfo *\fIextents\fB);\fR -.fi +.IR average_width . +.IP +.B XftXlfdParse +creates a Fontconfig pattern, +setting the property +.B XFT_XLFD +to the +.I xlfd_orig +value, +and +maps the collected information to Fontconfig properties. +Empty or \*(``*\*('' fields are ignored: +.RS 10 +.TP 5 +FC_FOUNDRY +from +.IR foundry . +.TP 5 +FC_FAMILY +from +.IR family . +.TP 5 +FC_WEIGHT +.IR weight_name , +defaulting to +FC_WEIGHT_MEDIUM. +.TP 5 +FC_SLANT +from +.IR slant , +defaulting to +FC_SLANT_ROMAN. +.TP 5 +FC_SIZE +from +.IR point_size . +.TP 5 +FC_PIXEL_SIZE +from +.IR pixel_size . +If +.I point_size +was set, as well as +.IR resolution_x and +.IR resolution_y , +then the value is scaled convert the font's height to points. +.RE +.\" ************************************************************************* +.SS "Families of Functions" +.B Xft +provides groups of drawing functions which differ according to the way +the data is encoded, e.g., 8-bit (ISO-8859-1) versus UTF-8. +Here is a summary of these related functions: +.TS +l l l l +_ _ _ _ +l l l l. +\fBEncoding\fP \fBXftDrawString*\fP \fBXftTextExtents*\fP \fBXftTextRender*\fP +8 XftDrawString8 XftTextExtents8 XftTextRender8 +16 XftDrawString16 XftTextExtents16 XftTextRender16 +16BE XftDrawString16 XftTextExtents16 XftTextRender16BE +16LE XftDrawString16 XftTextExtents16 XftTextRender16LE +32 XftDrawString32 XftTextExtents32 XftTextRender32 +32BE XftDrawString32 XftTextExtents32 XftTextRender32BE +32LE XftDrawString32 XftTextExtents32 XftTextRender32LE +UTF-8 XftDrawStringUtf8 XftTextExtentsUtf8 XftTextRenderUtf8 +UTF-16 XftDrawStringUtf16 XftTextExtentsUtf16 XftTextRenderUtf16 +.TE +.\" ************************************************************************* +.SS "Determining Text Extents" +.B Xft +provides several functions for determining the required height and width +for displaying a text-string. +After accounting for the +.IR offset , +in cases where the string will be shifted up, down, left or right, +these numbers are referred to as +.IR "text extents" . +.PS +\fBvoid\fP \fBXftTextExtents8\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBXftFont\fP *\fIfont\fP, + \fB_Xconst FcChar8\fP *\fIstring\fP, + \fBint\fP \fIlen\fP, + \fBXGlyphInfo\fP *\fIextents\fP); +.PE .B XftTextExtents8 computes the pixel extents on display .I dpy @@ -477,20 +895,15 @@ .IR font , storing them in .IR extents . -The -.B FcChar8 -data type is defined by the Fontconfig library, and the -.B XGlyphInfo -data type is defined by the X Rendering Extension library. .PP -.nf -\fBvoid\fR -\fBXftTextExtents16 (Display *\fIdpy\fB,\fR -\fB XftFont *\fIfont\fB,\fR -\fB FcChar16 *\fIstring\fB,\fR -\fB int \fIlen\fB,\fR -\fB XGlyphInfo *\fIextents\fB);\fR -.fi +.PS +\fBvoid\fP \fBXftTextExtents16\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBXftFont\fP *\fIfont\fP, + \fB_Xconst FcChar16\fP *\fIstring\fP, + \fBint\fP \fIlen\fP, + \fBXGlyphInfo\fP *\fIextents\fP); +.PE .B XftTextExtents16 computes the pixel extents on display .I dpy @@ -502,20 +915,15 @@ .IR font , storing them in .IR extents . -The -.B FcChar16 -data type is defined by the Fontconfig library, and the -.B XGlyphInfo -data type is defined by the X Rendering Extension library. .PP -.nf -\fBvoid\fR -\fBXftTextExtents32 (Display *\fIdpy\fB,\fR -\fB XftFont *\fIfont\fB,\fR -\fB FcChar32 *\fIstring\fB,\fR -\fB int \fIlen\fB,\fR -\fB XGlyphInfo *\fIextents\fB);\fR -.fi +.PS +\fBvoid\fP \fBXftTextExtents32\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBXftFont\fP *\fIfont\fP, + \fB_Xconst FcChar32\fP *\fIstring\fP, + \fBint\fP \fIlen\fP, + \fBXGlyphInfo\fP *\fIextents\fP); +.PE .B XftTextExtents32 computes the pixel extents on display .I dpy @@ -527,20 +935,15 @@ .IR font , storing them in .IR extents . -The -.B FcChar32 -data type is defined by the Fontconfig library, and the -.B XGlyphInfo -data type is defined by the X Rendering Extension library. .PP -.nf -\fBvoid\fR -\fBXftTextExtentsUtf8 (Display *\fIdpy\fB,\fR -\fB XftFont *\fIfont\fB,\fR -\fB FcChar8 *\fIstring\fB,\fR -\fB int \fIlen\fB,\fR -\fB XGlyphInfo *\fIextents\fB);\fR -.fi +.PS +\fBvoid\fP \fBXftTextExtentsUtf8\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBXftFont\fP *\fIfont\fP, + \fB_Xconst FcChar8\fP *\fIstring\fP, + \fBint\fP \fIlen\fP, + \fBXGlyphInfo\fP *\fIextents\fP); +.PE .B XftTextExtentsUtf8 computes the pixel extents on display .I dpy @@ -552,19 +955,16 @@ .IR font , storing them in .IR extents . -The -.B XGlyphInfo -data type is defined by the X Rendering Extension library. .PP -.nf -\fBvoid\fR -\fBXftTextExtentsUtf16 (Display *\fIdpy\fB,\fR -\fB XftFont *\fIfont\fB,\fR -\fB FcChar8 *\fIstring\fB,\fR -\fB FcEndian \fIendian\fB,\fR -\fB int \fIlen\fB,\fR -\fB XGlyphInfo *\fIextents\fB);\fR -.fi +.PS +\fBvoid\fR \fBXftTextExtentsUtf16\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBXftFont\fP *\fIfont\fP, + \fB_Xconst FcChar8\fP *\fIstring\fP, + \fBFcEndian\fP \fIendian\fP, + \fBint\fP \fIlen\fP, + \fBXGlyphInfo\fP *\fIextents\fP); +.PE .B XftTextExtentsUtf16 computes the pixel extents on display .I dpy @@ -580,22 +980,17 @@ .I string must be specified in .IR endian . -The -.B FcEndian -data type is defined by the Fontconfig library, and the -.B XGlyphInfo -data type is defined by the X Rendering Extension library. .PP -.nf -\fBvoid\fR -\fBXftGlyphExtents (Display *\fIdpy\fB,\fR -\fB XftFont *\fIfont\fB,\fR -\fB FT_UInt *\fIglyphs\fB,\fR -\fB int \fInglyphs\fB,\fR -\fB XGlyphInfo *\fIextents\fB);\fR -.fi +.PS +\fBvoid\fP \fBXftGlyphExtents\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBXftFont\fP *\fIfont\fP, + \fB_Xconst FT_UInt\fP *\fIglyphs\fP, + \fBint\fP \fInglyphs\fP, + \fBXGlyphInfo\fP *\fIextents\fP); +.PE Also used internally by the -.BR XftTextExtents * +.BR XftTextExtents *() functions, .B XftGlyphExtents computes the pixel extents on display @@ -608,19 +1003,136 @@ .IR font , storing them in .IR extents . +.IP +If any of the +.I glyphs +are missing (determined by a check with +.BR XftFontCheckGlyph ()), +the corresponding entry in +.I extents +is filled with zeroes. +.\" ************************************************************************* +.SS "Managing XftColor" +.PS +\fBBool\fP \fBXftColorAllocName\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fB_Xconst Visual\fP *\fIvisual\fP, + \fBColormap\fP \fIcmap\fP, + \fB_Xconst char\fP *\fIname\fP, + \fBXftColor\fP *\fIresult\fP); +.PE +Use +.BR XAllocNamedColor () +to look up the named color +.I name +for the screen associated with the colormap +.IR cmap . +.RS 7 +.bP +If +.BR XAllocNamedColor () +returns nonzero, +.BR XftColorAllocName () +fills in the resulting +.B XftColor +pixel field with the closest color supported by the screen, +as well as the exact red, green and blue fields from the database, +and returns True. +.bP +If +.BR XAllocNamedColor () +returns zero, +.BR XftColorAllocName () +returns False, and does not update the +.B XftColor +referenced by +.IR result . +.RE +.IP The -.B FT_UInt -data type is defined by the FreeType library, and the -.B XGlyphInfo -data type is defined by the X Rendering Extension library. -.SS "Drawing Strings (and Other Things)" -.nf -\fBXftDraw *\fR -\fBXftDrawCreate (Display *\fIdpy\fB,\fR -\fB Drawable \fIdrawable\fB,\fR -\fB Visual *\fIvisual\fB,\fR -\fB Colormap \fIcolormap\fB);\fR -.fi +.I visual +parameter is unused. +.PS +\fBBool\fP \fBXftColorAllocValue\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBVisual\fP *\fIvisual\fP, + \fBColormap\fP \fIcmap\fP, + \fB_Xconst XRenderColor\fP *\fIcolor\fP, + \fBXftColor\fP *\fIresult\fP); +.PE +Allocate a color value: +.RS 7 +.bP +If the +.I visual +class is TrueColor, +.BR XftColorAllocValue () +sets the +.I pixel +field in the +.B XftColor +referenced by +.I result +using the red, green and blue fields from the +.I color +parameter. +.bP +If the +.I visual +class is not TrueColor, +.BR XftColorAllocValue () +calls +.BR XAllocColor () +to allocate an entry in the colormap +.IR cmap . +which returns the +pixel value of the color closest to the specified RGB elements supported by the +hardware. +.IP +If +.BR XAllocColor () +succeeds +.BR XftColorAllocValue () +stores that pixel value in the +.B XRenderColor +referenced by +.I result +and returns True. +.IP +If +.BR XAllocColor () +fails, +.BR XftColorAllocValue () +returns False and does not modify the result. +.RE +.PS +\fBvoid\fP \fBXftColorFree\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBVisual\fP *\fIvisual\fP, + \fBColormap\fP \fIcmap\fP, + \fBXftColor\fP *\fIcolor\fP); +.PE +If the +.I visual +class is not TrueColor, +.B Xft +calls +.BR XFreeColors () +to free the entry from the colormap +.I cmap +whose pixel value in the +.I color +parameter was allocated by +.BR XftColorAllocName (). +.\" ************************************************************************* +.SS "Managing XftDraw" +.PS +\fBXftDraw\fP *\fBXftDrawCreate\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBDrawable\fP \fIdrawable\fP, + \fBVisual\fP *\fIvisual\fP, + \fBColormap\fP \fIcolormap\fP); +.PE .B XftDrawCreate creates a structure that can be used to render text and rectangles using the specified @@ -630,139 +1142,280 @@ .I colormap on .IR display . -The -.BR Drawable , -.BR Visual , -and -.B Colormap -data types are defined by the X11 library. .PP -.nf -\fBXftDraw *\fR -\fBXftDrawCreateBitmap (Display *\fIdpy\fB,\fR -\fB Pixmap \fIbitmap\fB);\fR -.fi +.PS +\fBXftDraw\fP *\fBXftDrawCreateBitmap\fP ( + \fBDisplay\fP *\fIdpy\fB,\fR + \fBPixmap\fP \fIbitmap\fB);\fR +.PE .B XftDrawCreateBitmap behaves as -.BR XftDrawCreate , -except it uses an X pixmap of color depth 1 instead of an X drawable. -The -.B Pixmap -data type is defined by the X11 library. +.BR XftDrawCreate (), +except that it uses an X pixmap of color depth 1 instead of an X drawable. .PP -.nf -\fBXftDraw *\fR -\fBXftDrawCreateAlpha (Display *\fIdpy\fB,\fR -\fB Pixmap \fIpixmap\fB,\fR -\fB int \fIdepth\fB);\fR -.fi +.PS +\fBXftDraw *\fP \fBXftDrawCreateAlpha\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBPixmap\fP \fIpixmap\fP, + \fBint\fP \fIdepth\fP); +.PE .B XftDrawCreateAlpha behaves as -.BR XftDrawCreate , -except it uses an X pixmap of color depth +.BR XftDrawCreate (), +except that it uses an X pixmap of color depth .I depth instead of an X drawable. -The -.B Pixmap -data type is defined by the X11 library. .PP -.nf -\fBvoid\fR -\fBXftDrawChange (XftDraw *\fIdraw\fB,\fR -\fB Drawable \fIdrawable\fB);\fR -.fi +.PS +\fBvoid\fP \fBXftDrawChange\fP ( + \fBXftDraw\fP *\fIdraw\fP, + \fBDrawable\fP \fIdrawable\fP); +.PE .B XftDrawChange -changes the X drawable association of the existing Xft draw object +changes the X drawable association of the existing +.B Xft +draw object .I draw from its current value to .IR drawable . .PP -.nf -\fBDisplay *\fR -\fBXftDrawDisplay (XftDraw *\fIdraw\fB);\fR -.fi +.PS +\fBDisplay\fP *\fBXftDrawDisplay\fP ( + \fBXftDraw\fP *\fIdraw\fP); +.PE .B XftDrawDisplay -returns a pointer to the display associated with the Xft draw object +returns a pointer to the display associated with the +.B Xft +draw object .IR draw . .PP -.nf -\fBDrawable\fR -\fBXftDrawDrawable (XftDraw *\fIdraw\fB);\fR -.fi +.PS +\fBDrawable\fP \fBXftDrawDrawable\fP ( + \fBXftDraw\fP *\fIdraw\fP); +.PE .B XftDrawDrawable -returns the X drawable associated with the Xft draw object +returns the X drawable associated with the +.B Xft +draw object .IR draw . .PP -.nf -\fBColormap\fR -\fBXftDrawColormap (XftDraw *\fIdraw\fB);\fR -.fi -.B XftDrawColormap -returns the colormap associated with the Xft draw object +.PS +\fBColormap\fP \fBXftDrawColormap\fP ( + \fBXftDraw\fP *\fIdraw\fP); +.PE +.BR XftDrawColormap () +returns the colormap associated with the +.B Xft +draw object .IR draw . .PP -.nf -\fBVisual *\fR -\fBXftDrawVisual (XftDraw *\fIdraw\fB);\fR -.fi +.PS +\fBVisual\fR *\fBXftDrawVisual\fP ( + \fBXftDraw\fP *\fIdraw\fP); +.PE .B XftDrawVisual -returns a pointer to the visual associated with the Xft draw object +returns a pointer to the visual associated with the +.B Xft +draw object .IR draw . .PP -.nf -\fBPicture\fR -\fBXftDrawPicture (XftDraw *\fIdraw\fB);\fR -.fi +.PS +\fBPicture\fP \fBXftDrawPicture\fP ( + \fBXftDraw\fP *\fIdraw\fP); +.PE .B XftDrawPicture -returns the picture associated with the Xft draw object +returns the picture associated with the +.B Xft +draw object .IR draw . +.IP If the the X server does not support the X Rendering Extension, 0 is returned. .PP -.nf -\fBPicture\fR -\fBXftDrawSrcPicture (XftDraw *\fIdraw\fB,\fR -\fB XftColor *\fIcolor\fB);\fR -.fi -.\" Unfortunately, I'm not quite sure what this does. I think it is the gizmo -.\" that is used to create an Xrender Picture object so that glyphs can be -.\" drawn in the XftDraw object -.\" .I draw -.\" using the specified -.\" .IR color . -.\" -- BR, 2005-04-02 -This function is never called if the X server doesn't support the X -Rendering Extension; instead, -.B XftGlyphCore -is used. -.PP -.nf -\fBvoid\fR -\fBXftDrawDestroy (XftDraw *\fIdraw\fB);\fR -.fi +.PS +\fBPicture\fP \fBXftDrawSrcPicture\fP ( + \fBXftDraw\fP *\fIdraw\fP, + \fB_Xconst XftColor\fP *\fIcolor\fP); +.PE +Return an X Render Picture object, +which is used for rendering glyphs, +e.g., with +.BR XftGlyphRender (), +.BR XftGlyphSpecRender (), +or +.BR XftGlyphFontSpecRender (), +by +.BR XftDrawGlyphs (), +.BR XftDrawGlyphSpec (), +.BR XftDrawGlyphFontSpec (), +respectively. +.IP +If the X server does not support the X Render extension, +those functions use +.BR XftGlyphCore (), +.BR XftGlyphSpecCore (), +or +.BR XftGlyphFontSpecCore (). +.PS +\fBvoid\fP \fBXftDrawDestroy\fP ( + \fBXftDraw\fP *\fIdraw\fP); +.PE .B XftDrawDestroy destroys .I draw (created by one of the -.B XftCreate +.BR XftDrawCreate *() functions) and frees the memory that was allocated for it. -.PP -.nf -\fBvoid\fR -\fBXftDrawString8 (XftDraw *\fId\fB,\fR -\fB XftColor *\fIcolor\fB,\fR -\fB XftFont *\fIfont\fB,\fR -\fB int \fIx\fB,\fR -\fB int \fIy\fB,\fR -\fB unsigned char *\fIstring\fB,\fR -\fB int \fIlen\fB);\fR -.fi +.PS +\fBBool\fP \fBXftDrawSetClip\fP ( + \fBXftDraw\fP *\fIdraw\fP, + \fBRegion\fP \fIr\fP); +.PE +Set up clipping for the given +.B XftDraw +parameter +.I draw +starting with a +.BR Region : +.RS 7 +.bP +If the +.B Region +parameter +.I r +is not null, +.B Xft +creates a new +.B Region +(to copy the parameter), +.bP +.B Xft +destroys any existing clipping region. +.bP +.B Xft +sets the clip_type +for the +.I draw +parameter to +.B XftClipTypeRegion +if the +.I r +parameter was not null. +Otherwise it sets the clip_type to +.BR XftClipTypeNone . +.bP +Finally, +.B Xft +updates clipping for existing objects, +updates the clip_mask for its X Render +.B Picture +object +and sets the clipping-mask in the graphic context (GC) associated with the +.B XftDraw +parameter. +.RE +.IP +.BR XftDrawSetClip () +returns +.B True +if no change was necessary, or if the operation succeeded. +It returns +.B False +if it was unable to create the new +.BR Region (). +.PS +\fBBool\fP \fBXftDrawSetClipRectangles\fP ( + \fBXftDraw\fP *\fIdraw\fP, + \fBint\fP \fIxOrigin\fP, + \fBint\fP \fIyOrigin\fP, + \fB_Xconst XRectangle\fP *\fIrects\fP, + \fBint\fP \fIn\fP); +.PE +Like +.BR XftDrawSetClip (), +.B XftDrawSetClipRectangles() +sets up clipping for the given +.B XftDraw +parameter +.I draw +but uses a set of +.I n +rectangles (the +.I rects +parameter) +which could be used to construct a +.B Region . +.IP +.B Xft +sets the clip_type for +.I draw +to +XftClipTypeRectangles +and uses +.BR XSetClipRectangles () +for core (X11) clipping +and +.BR XRenderSetPictureClipRectangles () +for X Render clipping. +.PS +\fBvoid\fP \fBXftDrawSetSubwindowMode\fP ( + \fBXftDraw\fP *\fIdraw\fP, + \fBint\fP \fImode\fP); +.PE +Sets the subwindow-mode for the given +.B XftDraw +parameter +.IR draw . +The mode can be either +.B ClipByChildren +(the default), or +.BR IncludeInferiors : +.RS 7 +.bP +For +.BR ClipByChildren , +both source and destination windows are +additionally clipped by all viewable +.B InputOutput +children. +.bP +For +.BR IncludeInferiors , +neither source nor destination window is clipped by inferiors. +This will result in including subwindow contents in the source +and drawing through subwindow boundaries of the destination. +.RE +.IP +In addition to the subwindow-mode maintained by +.BR Xft , +it updates the subwindow mode for any associated graphics context +.B GC +using +.BR XSetSubwindowMode () +as well as for an X Render +.B Picture +using +.BR XRenderChangePicture (). +.\" ************************************************************************* +.SS "Drawing Strings" +.PS +\fBvoid\fP \fBXftDrawString8\fP ( + \fBXftDraw\fP *\fId\fP, + \fB_Xconst XftColor\fP *\fIcolor\fP, + \fBXftFont\fP *\fIfont\fP, + \fBint\fP \fIx\fP, + \fBint\fP \fIy\fP, + \fB_Xconst FcChar8\fP *\fIstring\fP, + \fBint\fP \fIlen\fP); +.PE .B XftDrawString8 draws no more than .I len glyphs of .I string -to Xft drawable +to +.B Xft +drawable .I d using .I font @@ -770,16 +1423,17 @@ .I color at position .IR x , " y" . -.PP -.nf -\fBvoid\fR -\fBXftDrawRect (XftDraw *\fId\fB,\fR -\fB XftColor *\fIcolor\fB,\fR -\fB int \fIx\fB,\fR -\fB int \fIy\fB,\fR -\fB unsigned int \fIwidth\fB,\fR -\fB unsigned int \fIheight\fB);\fR -.fi +.\" ************************************************************************* +.SS "Drawing Other Things" +.PS +\fBvoid\fP \fBXftDrawRect\fP ( + \fBXftDraw\fP *\fId\fP, + \fB_Xconst XftColor\fP *\fIcolor\fP, + \fBint\fP \fIx\fP, + \fBint\fP \fIy\fP, + \fBunsigned int\fP \fIwidth\fP, + \fBunsigned int\fP \fIheight\fP); +.PE .B XftDrawRect draws a solid rectangle of the specified .IR color , @@ -788,23 +1442,354 @@ .I height at position .IR x , " y" -to Xft drawable +to +.B Xft +drawable .IR d . +.PS +\fBvoid\fP \fBXftCharFontSpecRender\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBint\fP \fIop\fP, + \fBPicture\fP \fIsrc\fP, + \fBPicture\fP \fIdst\fP, + \fBint\fP \fIsrcx\fP, + \fBint\fP \fIsrcy\fP, + \fB_Xconst XftCharFontSpec\fP *\fIchars\fP, + \fBint\fP \fIlen\fP); +.PE +.BR XftCharFontSpecRender () +converts the +.I chars +parameter from +.B XftCharFontSpec +to +.BR XftGlyphFontSpec , +passing the converted array along with the other parameters unchanged to +.BR XftGlyphFontSpecRender () +to render the data. +.PS +\fBvoid\fP \fBXftDrawGlyphFontSpec\fP ( + \fBXftDraw\fP *\fIdraw\fP, + \fB_Xconst XftColor\fP *\fIcolor\fP, + \fB_Xconst XftGlyphFontSpec\fP *\fIglyphs\fP, + \fBint\fP \fIlen\fP); +.PE +Draw a list of glyphs associated with fonts at specified coordinates, +passed as an array of +.I len +.B XftGlyphFontSpec +structures via the parameter +.IR glyphs . +All of the glyphs are drawn using the color specified in the +.I color +parameter. +.IP +For each entry in the +.I glyphs +array: +.RS 7 +.bP +If the associated font uses the X Render extension, then +.B Xft +uses +.BR XftGlyphFontSpecRender () +to draw the glyph, +using a +.B Picture +obtained from calling +.B XftDrawSrcPicture () +with the +.I draw +and +.I color +parameters. +.bP +Otherwise, +.B Xft +provides an analogous feature using Xlib. +.RE +.PS +\fBvoid\fP \fBXftGlyphFontSpecRender\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBint\fP \fIop\fP, + \fBPicture\fP \fIsrc\fP, + \fBPicture\fP \fIdst\fP, + \fBint\fP \fIsrcx\fP, + \fBint\fP \fIsrcy\fP, + \fB_Xconst XftGlyphFontSpec\fP *\fIglyphs\fP, + \fBint\fP \fInglyphs\fP); +.PE +This involves several steps: +.RS 7 +.bP +First, +.B Xft +ensures that the +.I glyphs +array is complete using +.BR XftFontCheckGlyph () +and loading any missing glyphs with +.BR XftFontLoadGlyphs (). +.bP +Then +.B Xft +examines the glyphs to find the maximum Unicode value. +That determines the encoding size, i.e., the +.IR width . +.bP +Then, for each glyph, +.B Xft +checks if its Unicode value is handled by the corresponding font. +If not, the value is set to zero (0), to ignore it. +While doing this, +.B Xft +also remembers which was the first font used, +and computes the position at which each glyph will be drawn. +.bP +.B Xft +then constructs an equivalent array of glyphs in the format expected by +the X Render library. +.bP +Finally, +.BR XftGlyphFontSpecRender () +uses the X Render extension to draw the glyphs, +with the appropriate +.BR XRenderCompositeText *() +function according to the +.IR width , +and discards temporary data. +.IP +The +.IR op , +.IR dst , +.IR src , +.IR srcx , +and +.I srcy +parameters are used as described in the documentation for the X Render library. +.RE +.\" ************************************************************************* +.SS Manipulating patterns +.PS +\fBFcFontSet\fP *\fBXftListFonts\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBint\fP \fIscreen\fP, + ...); +.PE +.B Xft +uses +.BR FcPatternVapBuild () +and +.BR FcObjectSetVapBuild () +to process the variable-length parameter list, +and +.BR FcFontList () +to obtain a list of matching Fontconfig patterns, +which it returns to the caller. +The caller can dispose of the return value using +.BR FcPatternDestroy (). +.PS +\fBFcPattern\fP *\fBXftNameParse\fP ( + \fB_Xconst char\fP *\fIname\fP); +.PE +.B Xft +uses Fontconfig to parse the name, +passing the +.I name +to +.BR FcNameParse (), +returning the result. +.PS +\fBFcBool\fP \fBXftNameUnparse\fP ( + \fBFcPattern\fP *\fIpat\fP, + \fBchar\fP *\fIdest\fP, + \fBint\fP \fIlen\fP); +.PE +Like +.BR XfgNameParse (), +.B Xft +uses Fontconfig. +In this case, it uses +.BR FcNameUnparse (), +which converts the pattern +.I pat +back into a string that can be parsed. +.BR XftNameUnparse () +stores the result via the caller's pointer +.IR dest , +but checks first if it will fit, +using the +.I len +parameter. +If it fits, +.B Xft +copies the string and returns +.BR FcTrue , +otherwise it returns +.BR FcFalse . +.\" ************************************************************************* +.SS Manipulating Font data +.PS +\fBvoid\fP \fBXftFontLoadGlyphs\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBXftFont\fP *\fIpub\fP, + \fBFcBool\fP \fIneed_bitmaps\fP, + \fB_Xconst FT_UInt\fP *\fIglyphs\fP, + \fBint\fP \fInglyph\fP); +.PE +Using +.BR FT_Load_Glyph (), +load +.I nglyphs +for the glyph indices (Unicode values) +listed in the array +.I glyphs +from the given font +.IR pub . +.IP +Loading a glyph entails more than just reading data into memory. +.B Xft +uses the Fontconfig pattern associated with the display +.I dpy +(e.g., via +.BR XftDefaultSet ()) +to determine whether to use a bounding box, +clip the glyphs into those bounds, +scale the glyphs, +compute font metrics, and +add it to the +X Render extension using +.BR XRenderAddGlyphs (). +.PS +\fBvoid\fP \fBXftFontUnloadGlyphs\fP ( + \fBDisplay\fP *\fIdpy\fP, + \fBXftFont\fP *\fIpub\fP, + \fB_Xconst FT_UInt\fP *\fIglyphs\fP, + \fBint\fP \fInglyph\fP); +.PE +Discards data for up to +.I nglyph +glyphs whose glyph indices (Unicode values) +are listed in the array +.I glyphs +for the given font +.IR pub . +If the glyphs were added to the X Render extension, +.B Xft +removes those using +.BR XRenderFreeGlyphs (). +.B Xft +keeps track of the amount of memory used for glyphs, +and updates the usage associated with the display +.IR dpy . +.PS +\fBFT_Face\fP \fBXftLockFace\fP ( + \fBXftFont\fP *\fIpub\fP); +.PE +If no FreeType 2 \*(``face\*('' +(in-memory representation of a given typeface in a given style) +has been created for the +.I pub +font, create one using +.BR FT_New_Face (). +Face-locks are a reference count used by +.B Xft +to ensure that only one face is created, +and that it is retained until the font is no longer used. +.IP +Face-locking is used directly in +.BR XftCharIndex () +and +.BR XftFontLoadGlyphs (), +which in turn are used in many functions of +.BR Xft . +.IP +Face-locking was introduced in version 1 (October 2002). +A few applications, such as Gdk/Gimp relied upon these functions. +In version 2.1.9 (June 2006), +face-locking was retained as part of the public API +when improved shared-library configurations provided +for hiding private symbols. +.PS +\fBvoid\fP \fBXftUnlockFace\fP ( + \fBXftFont\fP *\fIpub\fP); +.PE +Decrements the reference count for the FreeType 2 \*(``face\*('' +associated with the font. +.IP +.B FT_Face +objects are deallocated using +.BR FT_Done_Face (). +.B Xft +does this in +.BR XftFontInfoDestroy () +and when cleaning up on failure in +.BR XftFontInfoCreate () +and +.BR XftFontOpenPattern (). +.\" ************************************************************************* +.SH DEBUGGING +.B Xft +reads the environment variable +.B XFT_DEBUG +and converts that to an integer. +Each bit in the resulting value tells +.B Xft +to print debugging information to the standard output: +.TP 5 +1 +font-opening +.TP 5 +2 +additional font-matching and opening (verbose) +.TP 5 +4 +shows details about the +.B XRenderPictFormat +which will be used. +.TP 5 +8 +shows the string which +.BR XftDrawString8 () +will draw. +.TP 5 +16 +shows which font-ids are matched. +.TP 5 +32 +shows useful information about the glyphs which will be drawn +.TP 5 +64 +shows an ASCII-art representation of the glyphs. +.TP 5 +128 +shows details about the memory-cache management +.TP 5 +256 +shows details about managing glyph cached-memory +.TP 5 +512 +shows a report on memory-usage +.TP 5 +1024 +shows details on extended management of glyph cached-memory +.\" ************************************************************************* .SH COMPATIBILITY -As of version 2, +As of version 2 (May 2002), .B Xft -has become relatively stable and is expected to retain source and binary -compatibility in future releases. +became relatively stable. +It is expected to retain source and binary compatibility in future releases. .PP .B Xft -does provide a compatibility interface to its previous major version, +provides a compatibility interface to its previous major version, Xft .RI 1. x , described below. -.SS "Xft 1.x Compatibility Header File" +.\" ************************************************************************* +.SS "Xft 1.x Header File" .B #include <X11/Xft/XftCompat.h> -.\" .SS "Xft 1.x Compatibility Constants" -.SS "Xft 1.x Compatibility Data Types" +.\" .SS "Xft 1.x Constants" +.SS "Xft 1.x Data Types" .TP .B XftPattern holds a set of names with associated value lists; each name refers to a @@ -826,15 +1811,19 @@ .B XftObjectSet holds a set of names and is used to specify which fields from fonts are placed in the the list of returned patterns when listing fonts. -.\" .SS "Xft 1.x Compatibility Functions" +.\" .SS "Xft 1.x Functions" .SH AUTHOR Keith Packard +.br +Thomas E. Dickey (performance improvements) .SH "SEE ALSO" .I Fontconfig Developers Reference .br .I FreeType API Reference .br .I Xlib \- C Language Interface +.br +.I X Logical Font Description Conventions .\" Set Vim modeline; textwidth is 70 to account for the extra margin .\" padding that man (on Debian GNU/Linux) does for output to .\" terminals (7 spaces on the left, 2 on the right), so that we don't
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftCharExists.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftCharFontSpecRender.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftCharIndex.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftCharSpecRender.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftColorAllocName.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftColorAllocValue.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftColorFree.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDefaultHasRender.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDefaultSet.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDefaultSubstitute.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawChange.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawCharFontSpec.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawCharSpec.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawColormap.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawCreate.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawCreateAlpha.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawCreateBitmap.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawDestroy.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawDisplay.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawDrawable.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawGlyphFontSpec.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawGlyphSpec.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawGlyphs.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawPicture.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawRect.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawSetClip.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawSetClipRectangles.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawSetSubwindowMode.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawSrcPicture.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawString16.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawString32.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawString8.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawStringUtf16.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawStringUtf8.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftDrawVisual.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftFontCheckGlyph.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftFontClose.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftFontCopy.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftFontInfoCreate.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftFontInfoDestroy.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftFontInfoEqual.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftFontInfoHash.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftFontLoadGlyphs.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftFontMatch.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftFontOpen.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftFontOpenInfo.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftFontOpenName.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftFontOpenPattern.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftFontOpenXlfd.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftFontUnloadGlyphs.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftGetVersion.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftGlyphExtents.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftGlyphFontSpecRender.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftGlyphRender.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftGlyphSpecRender.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftInit.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftInitFtLibrary.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftListFonts.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftLockFace.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftNameParse.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftNameUnparse.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftTextExtents16.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftTextExtents32.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftTextExtents8.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftTextExtentsUtf16.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftTextExtentsUtf8.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftTextRender16.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftTextRender16BE.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftTextRender16LE.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftTextRender32.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftTextRender32BE.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftTextRender32LE.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftTextRender8.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftTextRenderUtf16.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftTextRenderUtf8.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftUnlockFace.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.7.tar.gz/man/XftXlfdParse.man
Added
@@ -0,0 +1,1 @@ +.so man__libmansuffix__/Xft.__libmansuffix__
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/src/Makefile.in -> _service:tar_scm:libXft-2.3.7.tar.gz/src/Makefile.in
Changed
@@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.16.4 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. @@ -249,6 +249,7 @@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/src/xftcolor.c -> _service:tar_scm:libXft-2.3.7.tar.gz/src/xftcolor.c
Changed
@@ -23,11 +23,11 @@ #include "xftint.h" _X_EXPORT Bool -XftColorAllocName (Display *dpy, - _Xconst Visual *visual, - Colormap cmap, +XftColorAllocName (Display *dpy, + _Xconst Visual *visual _X_UNUSED, + Colormap cmap, _Xconst char *name, - XftColor *result) + XftColor *result) { XColor screen, exact;
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/src/xftcore.c -> _service:tar_scm:libXft-2.3.7.tar.gz/src/xftcore.c
Changed
@@ -233,7 +233,7 @@ int y); static XftSharpGlyph -_XftSharpGlyphFind (XftDraw *draw, XftFont *public) +_XftSharpGlyphFind (XftDraw *draw _X_UNUSED, XftFont *public) { XftFontInt *font = (XftFontInt *) public; @@ -390,7 +390,10 @@ ((((s) << 9) & 0xf80000) | (((s) << 4) & 0x70000))) -#define XftIntMult(a,b,t,cast) ( ((t) = (cast)((a) * (b) + 0x80)), ( ( ( (t)>>8 ) + (t) )>>8 ) ) +#define XftIntMult(a,b,t,cast) \ + ( ((t) = (cast)((a) * (b) + 0x80)), \ + ( ( ( (t) >> 8 ) + (t) ) >> 8 ) ) + #define XftIntDiv(a,b) (((CARD16) (a) * 255) / (b)) #define XftGet8(v,i) ((CARD16) (CARD8) ((v) >> i)) @@ -403,30 +406,37 @@ * this difference will have two versions using the same convention. */ -#define XftOverU(x,y,i,a,t) ((t) = (CARD16) XftIntMult(XftGet8(y,i),(a),(t),CARD16) + XftGet8(x,i),\ - (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) +#define XftOverU(x,y,i,a,t) \ + ((t) = (CARD16) XftIntMult(XftGet8(y,i),(a),(t),CARD16) + \ + XftGet8(x,i),\ + (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) -#define XftOverC(x,y,i,a,t) ((t) = (CARD16) XftIntMult(XftGet8(y,i),XftGet8(a,i),(t),CARD16) + XftGet8(x,i),\ - (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) +#define XftOverC(x,y,i,a,t) \ + ((t) = (CARD16) XftIntMult(XftGet8(y,i),XftGet8(a,i),(t),CARD16) + \ + XftGet8(x,i),\ + (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) -#define XftInU(x,i,a,t) ((CARD32) XftIntMult(XftGet8(x,i),(a),(t),CARD16) << (i)) +#define XftInU(x,i,a,t) \ + ((CARD32) XftIntMult(XftGet8(x,i),(a),(t),CARD16) << (i)) -#define XftInC(x,i,a,t) ((CARD32) XftIntMult(XftGet8(x,i),XftGet8(a,i),(t),CARD32) << (i)) +#define XftInC(x,i,a,t) \ + ((CARD32) XftIntMult(XftGet8(x,i),XftGet8(a,i),(t),CARD32) << (i)) -#define XftGen(x,y,i,ax,ay,t,u,v) ((t) = (XftIntMult(XftGet8(y,i),ay,(u),CARD32) + \ - XftIntMult(XftGet8(x,i),ax,(v),CARD32)),\ - (CARD32) ((CARD8) ((t) | \ - (0 - ((t) >> 8)))) << (i)) +#define XftGen(x,y,i,ax,ay,t,u,v) \ + ((t) = (XftIntMult(XftGet8(y,i),ay,(u),CARD32) + \ + XftIntMult(XftGet8(x,i),ax,(v),CARD32)),\ + (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) -#define XftAdd(x,y,i,t) ((t) = XftGet8(x,i) + XftGet8(y,i), \ - (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) +#define XftAdd(x,y,i,t) \ + ((t) = XftGet8(x,i) + XftGet8(y,i), \ + (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) static CARD32 fbOver24 (CARD32 x, CARD32 y) { CARD16 a = (CARD16)(~x >> 24); - CARD16 t; + CARD16 t = 0; CARD32 m,n,o; m = XftOverU(x,y,0,a,t); @@ -923,7 +933,7 @@ return font->glyphs0; } -static int XftGetImageErrorHandler (Display *dpy, XErrorEvent *error_event) +static int XftGetImageErrorHandler (Display *dpy _X_UNUSED, XErrorEvent *error_event _X_UNUSED) { return 0; }
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/src/xftdpy.c -> _service:tar_scm:libXft-2.3.7.tar.gz/src/xftdpy.c
Changed
@@ -22,10 +22,12 @@ #include "xftint.h" +#define BtoS(b) ((b) ? "true" : "false") + _X_HIDDEN XftDisplayInfo *_XftDisplayInfo; static int -_XftCloseDisplay (Display *dpy, XExtCodes *codes) +_XftCloseDisplay (Display *dpy, XExtCodes *codes _X_UNUSED) { XftDisplayInfo *info, **prev; @@ -51,7 +53,8 @@ for (prev = &_XftDisplayInfo; (info = *prev); prev = &(*prev)->next) if (info->display == dpy) break; - *prev = info->next; + if (info != NULL) + *prev = info->next; free (info); return 0; @@ -85,7 +88,7 @@ if (!createIfNecessary) return NULL; - info = (XftDisplayInfo *) malloc (sizeof (XftDisplayInfo)); + info = malloc (sizeof (XftDisplayInfo)); if (!info) goto bail0; info->codes = XAddExtension (dpy); @@ -169,7 +172,7 @@ XFT_MAX_GLYPH_MEMORY, 0, XFT_DPY_MAX_GLYPH_MEMORY); if (XftDebug () & XFT_DBG_CACHE) - printf ("global max cache memory %ld\n", info->max_glyph_memory); + printf ("global max cache memory %lu\n", info->max_glyph_memory); info->num_unref_fonts = 0; @@ -177,7 +180,14 @@ XFT_MAX_UNREF_FONTS, 0, XFT_DPY_MAX_UNREF_FONTS); if (XftDebug() & XFT_DBG_CACHE) - printf ("global max unref fonts %d\n", info->max_unref_fonts); + printf ("global max unref fonts %d\n", info->max_unref_fonts); + + info->track_mem_usage = FcFalse; + info->track_mem_usage = XftDefaultGetBool (dpy, + XFT_TRACK_MEM_USAGE, 0, + FcFalse); + if (XftDebug() & XFT_DBG_CACHE) + printf ("global track mem usage %s\n", BtoS(info->track_mem_usage)); memset (info->fontHash, '\0', sizeof (XftFont *) * XFT_NUM_FONT_HASH); return info; @@ -210,7 +220,7 @@ glyph_memory += font->glyph_memory; } if (glyph_memory != info->glyph_memory) - printf ("Display glyph cache incorrect has %ld bytes, should have %ld\n", + printf ("Display glyph cache incorrect has %lu bytes, should have %lu\n", info->glyph_memory, glyph_memory); } @@ -227,7 +237,7 @@ if (XftDebug () & XFT_DBG_CACHE) { if (info->glyph_memory > info->max_glyph_memory) - printf ("Reduce global memory from %ld to %ld\n", + printf ("Reduce global memory from %lu to %lu\n", info->glyph_memory, info->max_glyph_memory); _XftDisplayValidateMemory (info); } @@ -272,16 +282,29 @@ if (info->defaults) FcPatternDestroy (info->defaults); info->defaults = defaults; + if (!info->max_glyph_memory) info->max_glyph_memory = XFT_DPY_MAX_GLYPH_MEMORY; info->max_glyph_memory = (unsigned long)XftDefaultGetInteger (dpy, XFT_MAX_GLYPH_MEMORY, 0, (int)info->max_glyph_memory); + if (XftDebug () & XFT_DBG_CACHE) + printf ("update max cache memory %lu\n", info->max_glyph_memory); + if (!info->max_unref_fonts) info->max_unref_fonts = XFT_DPY_MAX_UNREF_FONTS; info->max_unref_fonts = XftDefaultGetInteger (dpy, XFT_MAX_UNREF_FONTS, 0, info->max_unref_fonts); + if (XftDebug() & XFT_DBG_CACHE) + printf ("update max unref fonts %d\n", info->max_unref_fonts); + + info->track_mem_usage = XftDefaultGetBool (dpy, + XFT_TRACK_MEM_USAGE, 0, + info->track_mem_usage); + if (XftDebug() & XFT_DBG_CACHE) + printf ("update track mem usage %s\n", BtoS(info->track_mem_usage)); + return True; }
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/src/xftdraw.c -> _service:tar_scm:libXft-2.3.7.tar.gz/src/xftdraw.c
Changed
@@ -112,7 +112,7 @@ for (i = 0; i < nformats; i++) { - if (formatsi.depth == depth) + if ((unsigned) formatsi.depth == depth) { draw->bits_per_pixel = (unsigned)formatsi.bits_per_pixel; break; @@ -132,7 +132,7 @@ { XftDraw *draw; - draw = (XftDraw *) malloc (sizeof (XftDraw)); + draw = malloc (sizeof (XftDraw)); if (!draw) return NULL; @@ -158,7 +158,7 @@ { XftDraw *draw; - draw = (XftDraw *) malloc (sizeof (XftDraw)); + draw = malloc (sizeof (XftDraw)); if (!draw) return NULL; draw->dpy = dpy; @@ -184,7 +184,7 @@ { XftDraw *draw; - draw = (XftDraw *) malloc (sizeof (XftDraw)); + draw = malloc (sizeof (XftDraw)); if (!draw) return NULL; draw->dpy = dpy; @@ -324,8 +324,8 @@ { if (info->colorsi.pict && info->colorsi.screen == draw->screen && - !memcmp ((void *) &color->color, - (void *) &info->colorsi.color, + !memcmp ((const void *) &color->color, + (const void *) &info->colorsi.color, sizeof (XRenderColor))) return info->colorsi.pict; } @@ -525,7 +525,7 @@ glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (FT_UInt)); + glyphs = AllocUIntArray (len); if (!glyphs) return; } @@ -548,11 +548,14 @@ FT_UInt *glyphs, glyphs_localNUM_LOCAL; int i; + if (len <= 0) + return; + if (len <= NUM_LOCAL) glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (FT_UInt)); + glyphs = AllocUIntArray (len); if (!glyphs) return; } @@ -576,11 +579,14 @@ FT_UInt *glyphs, glyphs_localNUM_LOCAL; int i; + if (len <= 0) + return; + if (len <= NUM_LOCAL) glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (FT_UInt)); + glyphs = AllocUIntArray (len); if (!glyphs) return; } @@ -607,6 +613,9 @@ int l; int size; + if (len <= 0) + return; + i = 0; glyphs = glyphs_local; size = NUM_LOCAL; @@ -614,7 +623,7 @@ { if (i == size) { - glyphs_new = malloc ((size_t)size * 2 * sizeof (FT_UInt)); + glyphs_new = AllocUIntArray (size * 2); if (!glyphs_new) { if (glyphs != glyphs_local) @@ -652,6 +661,9 @@ int l; int size; + if (len <= 0) + return; + i = 0; glyphs = glyphs_local; size = NUM_LOCAL; @@ -659,7 +671,7 @@ { if (i == size) { - glyphs_new = malloc ((size_t)size * 2 * sizeof (FT_UInt)); + glyphs_new = AllocUIntArray (size * 2); if (!glyphs_new) { if (glyphs != glyphs_local) @@ -755,11 +767,14 @@ XftGlyphSpec *glyphs, glyphs_localNUM_LOCAL; int i; + if (len <= 0) + return; + if (len <= NUM_LOCAL) glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (XftGlyphSpec)); + glyphs = AllocGlyphSpecArray (len); if (!glyphs) return; } @@ -784,11 +799,14 @@ XftGlyphFontSpec *glyphs, glyphs_localNUM_LOCAL; int i; + if (len <= 0) + return; + if (len <= NUM_LOCAL) glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (XftGlyphFontSpec)); + glyphs = AllocGlyphFontSpecArray (len); if (!glyphs) return; }
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/src/xftextent.c -> _service:tar_scm:libXft-2.3.7.tar.gz/src/xftextent.c
Changed
@@ -123,11 +123,14 @@ FT_UInt *glyphs, glyphs_localNUM_LOCAL; int i; + if (len < 0) + return; + if (len <= NUM_LOCAL) - glyphs = glyphs_local; + *(glyphs = glyphs_local) = 0; else { - glyphs = malloc ((size_t)len * sizeof (FT_UInt)); + glyphs = AllocUIntArray (len); if (!glyphs) { memset (extents, '\0', sizeof (XGlyphInfo)); @@ -151,11 +154,14 @@ FT_UInt *glyphs, glyphs_localNUM_LOCAL; int i; + if (len < 0) + return; + if (len <= NUM_LOCAL) - glyphs = glyphs_local; + *(glyphs = glyphs_local) = 0; else { - glyphs = malloc ((size_t)len * sizeof (FT_UInt)); + glyphs = AllocUIntArray (len); if (!glyphs) { memset (extents, '\0', sizeof (XGlyphInfo)); @@ -179,11 +185,14 @@ FT_UInt *glyphs, glyphs_localNUM_LOCAL; int i; + if (len < 0) + return; + if (len <= NUM_LOCAL) - glyphs = glyphs_local; + *(glyphs = glyphs_local) = 0; else { - glyphs = malloc ((size_t)len * sizeof (FT_UInt)); + glyphs = AllocUIntArray (len); if (!glyphs) { memset (extents, '\0', sizeof (XGlyphInfo)); @@ -210,14 +219,17 @@ int l; int size; + if (len < 0) + return; + i = 0; - glyphs = glyphs_local; + *(glyphs = glyphs_local) = 0; size = NUM_LOCAL; while (len && (l = FcUtf8ToUcs4 (string, &ucs4, len)) > 0) { if (i == size) { - glyphs_new = malloc ((size_t)size * 2 * sizeof (FT_UInt)); + glyphs_new = AllocUIntArray (size * 2); if (!glyphs_new) { if (glyphs != glyphs_local) @@ -254,14 +266,17 @@ int l; int size; + if (len < 0) + return; + i = 0; - glyphs = glyphs_local; + *(glyphs = glyphs_local) = 0; size = NUM_LOCAL; while (len && (l = FcUtf16ToUcs4 (string, endian, &ucs4, len)) > 0) { if (i == size) { - glyphs_new = malloc ((size_t)size * 2 * sizeof (FT_UInt)); + glyphs_new = AllocUIntArray (size * 2); if (!glyphs_new) { if (glyphs != glyphs_local)
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/src/xftfont.c -> _service:tar_scm:libXft-2.3.7.tar.gz/src/xftfont.c
Changed
@@ -120,7 +120,7 @@ FcResult result; XftFont *font; - pat = FcNameParse ((FcChar8 *) name); + pat = FcNameParse ((const FcChar8 *) name); if (XftDebug () & XFT_DBG_OPEN) { printf ("XftFontOpenName \"%s\": ", name);
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/src/xftfreetype.c -> _service:tar_scm:libXft-2.3.7.tar.gz/src/xftfreetype.c
Changed
@@ -1,23 +1,24 @@ /* + * Copyright © 2022 Thomas E. Dickey * Copyright © 2000 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the above copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The above copyright holders make no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. + * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF + * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "xftint.h" @@ -45,7 +46,7 @@ for (f = _XftFtFiles; f; f = f->next) { - if (!strcmp (f->file, (char *) file) && f->id == id) + if (!strcmp (f->file, (const char *) file) && f->id == id) { ++f->ref; if (XftDebug () & XFT_DBG_REF) @@ -54,11 +55,11 @@ return f; } } - f = malloc (sizeof (XftFtFile) + strlen ((char *) file) + 1); + f = malloc (sizeof (XftFtFile) + strlen ((const char *) file) + 1); if (!f) return NULL; - XftMemAlloc (XFT_MEM_FILE, (int)(sizeof (XftFtFile) + strlen ((char *) file) + 1)); + XftMemAlloc (XFT_MEM_FILE, sizeof (XftFtFile) + strlen ((const char *) file) + 1); if (XftDebug () & XFT_DBG_REF) printf ("FontFile %s/%d matches new\n", file, id); @@ -68,7 +69,7 @@ f->ref = 1; f->file = (char *) (f+1); - strcpy (f->file, (char *) file); + strcpy (f->file, (const char *) file); f->id = id; f->lock = 0; @@ -87,7 +88,7 @@ f = malloc (sizeof (XftFtFile)); if (!f) return NULL; - XftMemAlloc (XFT_MEM_FILE, sizeof(XftFtFile)); + XftMemAlloc (XFT_MEM_FILE, sizeof (XftFtFile)); f->next = NULL; f->ref = 1; @@ -132,7 +133,7 @@ XftFtFile *f; while ((n = _XftNumFiles ()) > XftMaxFreeTypeFiles) { - f = _XftNthFile (rand () % n); + f = _XftNthFile (n ? (rand () % n) : 0); if (f) { if (XftDebug() & XFT_DBG_REF) @@ -366,10 +367,10 @@ { XftDisplayInfo *info = _XftDisplayInfoGet (dpy, True); FcChar8 *filename; - int id; + int id, mid; double dsize; double aspect; - FcMatrix *font_matrix; + FcMatrix *font_matrix, fm1; FcBool hinting, vertical_layout, autohint, global_advance; int hint_style; FcChar32 hash, *hashp; @@ -385,7 +386,7 @@ * hash or XftFontInfoEqual(). */ - memset (fi, '\0', sizeof(*fi)); + memset (fi, '\0', sizeof (*fi)); /* * Find the associated file @@ -432,7 +433,7 @@ if (XftDebug() & XFT_DBG_OPEN) printf ("XftFontInfoFill: %s: %d (%g pixels)\n", - (filename ? filename : (FcChar8 *) "<none>"), id, dsize); + (filename ? filename : (const FcChar8 *) "<none>"), id, dsize); /* * Get antialias value */ @@ -490,6 +491,22 @@ goto bail1; } + mid = 1; + while (FcPatternGetMatrix (pattern, FC_MATRIX, mid, &font_matrix) == FcResultMatch) { + FcMatrixInit(&fm1); +#define PreScale(value) ((double) (value) / (double) 0x10000L) + fm1.xx = PreScale(fi->matrix.xx); + fm1.yy = PreScale(fi->matrix.yy); + fm1.xy = PreScale(fi->matrix.xy); + fm1.yx = PreScale(fi->matrix.yx); + FcMatrixMultiply(&fm1, font_matrix, &fm1); + fi->matrix.xx = (FT_Fixed)(0x10000L * fm1.xx); + fi->matrix.yy = (FT_Fixed)(0x10000L * fm1.yy); + fi->matrix.xy = (FT_Fixed)(0x10000L * fm1.xy); + fi->matrix.yx = (FT_Fixed)(0x10000L * fm1.yx); + mid++; + } + fi->transform = (fi->matrix.xx != 0x10000 || fi->matrix.xy != 0 || fi->matrix.yx != 0 || fi->matrix.yy != 0x10000); @@ -523,7 +540,7 @@ /* * Compute glyph load flags */ - fi->load_flags = FT_LOAD_DEFAULT; + fi->load_flags = FT_LOAD_DEFAULT | FT_LOAD_COLOR; #ifndef XFT_EMBEDDED_BITMAP #define XFT_EMBEDDED_BITMAP "embeddedbitmap" @@ -717,7 +734,7 @@ } static void -XftFontInfoEmpty (Display *dpy, XftFontInfo *fi) +XftFontInfoEmpty (Display *dpy _X_UNUSED, XftFontInfo *fi) { if (fi->file) _XftReleaseFile (fi->file); @@ -757,7 +774,7 @@ _X_EXPORT FcBool XftFontInfoEqual (_Xconst XftFontInfo *a, _Xconst XftFontInfo *b) { - return memcmp ((void *) a, (void *) b, sizeof (XftFontInfo)) == 0; + return memcmp ((const void *) a, (const void *) b, sizeof (XftFontInfo)) == 0; } _X_EXPORT XftFont * @@ -775,11 +792,12 @@ FcChar32 hash_value; FcChar32 rehash_value; FcBool antialias; + FcBool color; int max_glyph_memory; - int alloc_size; + size_t alloc_size; int ascent, descent, height; int i; - int num_glyphs; + FT_UInt num_glyphs; if (!info) return NULL; @@ -831,12 +849,18 @@ if (!(face->face_flags & FT_FACE_FLAG_SCALABLE)) antialias = FcFalse; + color = FT_HAS_COLOR(face) ? FcTrue : FcFalse; + /* * Find the appropriate picture format */ if (fi->render) { - if (antialias) + if (color) + { + format = XRenderFindStandardFormat (dpy, PictStandardARGB32); + } + else if (antialias) { switch (fi->rgba) { case FC_RGBA_RGB: @@ -869,7 +893,6 @@ } else { - num_unicode = 0; hash_value = 0; rehash_value = 0; } @@ -878,11 +901,11 @@ * Sometimes the glyphs are numbered 1..n, other times 0..n-1, * accept either numbering scheme by making room in the table */ - num_glyphs = (int)face->num_glyphs + 1; + num_glyphs = (FT_UInt)face->num_glyphs + 1; alloc_size = (sizeof (XftFontInt) + (size_t)num_glyphs * sizeof (XftGlyph *) + hash_value * sizeof (XftUcsHash)); - font = malloc ((size_t)alloc_size); + font = malloc (alloc_size); if (!font) goto bail2; @@ -968,6 +991,13 @@ * which doesn't happen in XftFontInfoFill */ font->info.antialias = antialias; + + /* + * Set color value, which is only known once the + * font was loaded + */ + font->info.color = color; + /* * bump XftFile reference count */ @@ -980,10 +1010,15 @@ memset (font->glyphs, '\0', (size_t)num_glyphs * sizeof (XftGlyph *)); font->num_glyphs = num_glyphs; /* + * Memory-usage tracking + */ + font->newest = FT_UINT_MAX; + font->total_inuse = 0; + /* * Unicode hash table information */ font->hash_table = (XftUcsHash *) (font->glyphs + font->num_glyphs); - for (i = 0; i < hash_value; i++) + for (i = 0; (FcChar32) i < hash_value; i++) { font->hash_tablei.ucs4 = ((FcChar32) ~0); font->hash_tablei.glyph = 0; @@ -999,9 +1034,13 @@ /* * Glyph memory management fields */ - font->glyph_memory = 0; + font->glyph_memory = 0; font->max_glyph_memory = (unsigned long)max_glyph_memory; - font->use_free_glyphs = info->use_free_glyphs; + font->track_mem_usage = info->track_mem_usage; + font->use_free_glyphs = info->use_free_glyphs; + font->sizeof_glyph = (font->track_mem_usage + ? sizeof(XftGlyphUsage) + : sizeof(XftGlyph)); _XftUnlockFile (fi->file); @@ -1030,7 +1069,7 @@ } _X_EXPORT XftFont * -XftFontCopy (Display *dpy, XftFont *public) +XftFontCopy (Display *dpy _X_UNUSED, XftFont *public) { XftFontInt *font = (XftFontInt *) public; @@ -1043,7 +1082,7 @@ { XftDisplayInfo *info = _XftDisplayInfoGet (dpy, False); XftFontInt *font = (XftFontInt *) public; - int i; + FT_UInt i; /* note reduction in memory use */ if (info)
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/src/xftglyphs.c -> _service:tar_scm:libXft-2.3.7.tar.gz/src/xftglyphs.c
Changed
@@ -1,23 +1,24 @@ /* + * Copyright © 2022 Thomas E. Dickey * Copyright © 2000 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the above copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The above copyright holders make no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. + * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF + * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "xftint.h" @@ -26,12 +27,54 @@ #include FT_SYNTHESIS_H +#include FT_GLYPH_H + +typedef double m3x333; + +static void +m3x3_uniform(m3x3 m) +{ + m00 = m11 = m22 = 1.0; + m01 = m10 = m02 = m12 = m20 = m21 = 0; +} + +static void +m3x3_transform(FT_Vector *v, m3x3 m) +{ + double x, y; + + x = (double)v->x; + y = (double)v->y; + v->x = (FT_Pos)(x * m00 + y * m01 + m02 + 0.5); + v->y = (FT_Pos)(x * m10 + y * m11 + m12 + 0.5); +} + +static void +m3x3_invert(m3x3 m, m3x3 mi) +{ + double det; + + det = m00 * (m11 * m22 - m12 * m21); + det -= m01 * (m10 * m22 - m12 * m20); + det += m02 * (m10 * m21 - m11 * m20); + det = 1.0 / det; + mi00 = det * (m11 * m22 - m12 * m21); + mi10 = det * (m12 * m20 - m10 * m22); + mi20 = det * (m10 * m21 - m11 * m20); + mi01 = det * (m02 * m21 - m01 * m22); + mi11 = det * (m00 * m22 - m02 * m20); + mi21 = det * (m01 * m20 - m00 * m21); + mi02 = det * (m01 * m12 - m02 * m11); + mi12 = det * (m02 * m10 - m00 * m12); + mi22 = det * (m00 * m11 - m01 * m10); +} + /* * Validate the memory info for a font */ static void -_XftFontValidateMemory (Display *dpy, XftFont *public) +_XftFontValidateMemory (Display *dpy _X_UNUSED, XftFont *public) { XftFontInt *font = (XftFontInt *) public; unsigned long glyph_memory; @@ -48,10 +91,72 @@ } } if (glyph_memory != font->glyph_memory) - printf ("Font glyph cache incorrect has %ld bytes, should have %ld\n", + printf ("Font glyph cache incorrect has %lu bytes, should have %lu\n", font->glyph_memory, glyph_memory); } +/* + * Validate the glyph usage-links for a font. + */ +static void +_XftValidateGlyphUsage(XftFontInt *font) +{ + if (font->newest != FT_UINT_MAX) { + FT_UInt forward; + FT_UInt reverse; + FT_UInt next; + XftGlyphUsage *x1st = (XftGlyphUsage *) font->glyphsfont->newest; + XftGlyphUsage *xuse = x1st; + for (forward = 1, + next = x1st->newer; + xuse != NULL && + next != font->newest; + next = xuse->newer) { + if (next >= font->num_glyphs) { + printf("Xft: out of range; %d\n", next); + break; + } + if (++forward > font->total_inuse) { + printf("Xft: too many in-use glyphs (%d vs %d)\n", + forward, font->total_inuse); + if (forward > font->total_inuse + 10) + break; + } + xuse = (XftGlyphUsage *) font->glyphsnext; + } + if (forward < font->total_inuse) { + printf("Xft: too few in-use glyphs (%u vs %d)\n", + forward, font->total_inuse); + } + for (reverse = 1, + next = x1st->older; + xuse != NULL && + next != font->newest; + next = xuse->older) { + if (next >= font->num_glyphs) { + printf("Xft out of range; %d\n", next); + break; + } + if (++reverse > font->total_inuse) { + printf("Xft: too many in-use glyphs (%d vs %d)\n", + reverse, font->total_inuse); + if (reverse > font->total_inuse + 10) + break; + } + xuse = (XftGlyphUsage *) font->glyphsnext; + } + if (reverse < font->total_inuse) { + printf("Xft: too few in-use glyphs (%u vs %d)\n", + reverse, font->total_inuse); + } + if (forward != reverse) { + printf("Xft: forward %d vs reverse %d\n", + forward, reverse); + exit(1); + } + } +} + /* we sometimes need to convert the glyph bitmap in a FT_GlyphSlot * into a different format. For example, we want to convert a * FT_PIXEL_MODE_LCD or FT_PIXEL_MODE_LCD_V bitmap into a 32-bit @@ -78,7 +183,9 @@ static int _compute_xrender_bitmap_size( FT_Bitmap* target, FT_GlyphSlot slot, - FT_Render_Mode mode ) + FT_Render_Mode mode, + FT_Matrix* matrix, + m3x3 m ) { FT_Bitmap* ftbit; int width, height, pitch; @@ -91,6 +198,63 @@ width = (int)ftbit->width; height = (int)ftbit->rows; + + if ( matrix && mode == FT_RENDER_MODE_NORMAL ) + { + FT_Matrix mirror, inverse; + FT_Vector vector; + int xc, yc; + int left, right, top, bottom; + + left = right = top = bottom = 0; + for (xc = 0; xc <= 1; xc++) { + for (yc = 0; yc <= 1; yc++) { + vector.x = xc * width; + vector.y = yc * height; + FT_Vector_Transform(&vector, matrix); + if (xc == 0 && yc == 0) { + left = right = (int)vector.x; + top = bottom = (int)vector.y; + } else { + if (left > vector.x) left = (int)vector.x; + if (right < vector.x) right = (int)vector.x; + if (bottom > vector.y) bottom = (int)vector.y; + if (top < vector.y) top = (int)vector.y; + } + } + } + width = (int)(right - left); + height = (int)(top - bottom); + + mirror.xx = + 0x10000; + mirror.yy = - 0x10000; + mirror.xy = mirror.yx = 0; + inverse = *matrix; + FT_Matrix_Multiply(&mirror, &inverse); + FT_Matrix_Invert(&inverse); + FT_Matrix_Multiply(&mirror, &inverse); + + vector.x = vector.y = 0; + FT_Vector_Transform(&vector, &inverse); + left = (int)vector.x; + bottom = (int)vector.y; + vector.x = width; + vector.y = height; + FT_Vector_Transform(&vector, &inverse); + right = (int)vector.x; + top = (int)vector.y; + left = (right - left) - (int)ftbit->width; + bottom = (top - bottom) - (int)ftbit->rows; + + m00 = (double)inverse.xx / 0x10000; + m01 = (double)inverse.xy / 0x10000; + m10 = (double)inverse.yx / 0x10000; + m11 = (double)inverse.yy / 0x10000; + m02 = (double)-left / 2; + m12 = (double)-bottom / 2; + m20 = m21 = 0.0; + m22 = 1.0; + } pitch = (width+3) & ~3; switch ( ftbit->pixel_mode ) @@ -112,6 +276,10 @@ } break; + case FT_PIXEL_MODE_BGRA: + pitch = width * 4; + break; + case FT_PIXEL_MODE_LCD: if ( mode != FT_RENDER_MODE_LCD ) return -1; @@ -143,6 +311,125 @@ } /* this functions converts the glyph bitmap found in a FT_GlyphSlot + * into a different format while scaling by applying the given matrix + * (see _compute_xrender_bitmap_size) + * + * you should call this function after _compute_xrender_bitmap_size + * + * target :: target bitmap descriptor. Note that its 'buffer' pointer + * must point to memory allocated by the caller + * + * source :: the source bitmap descriptor + * + * matrix :: the scaling matrix to apply + */ +static void +_scaled_fill_xrender_bitmap( FT_Bitmap* target, + FT_Bitmap* source, + m3x3 m ) +{ + unsigned char* src_buf = source->buffer; + unsigned char* dst_line = target->buffer; + int src_pitch = source->pitch; + int width = (int) target->width; + int height = (int) target->rows; + int pitch = target->pitch; + int i, x, y; + FT_Vector vector, vector0; + int sampling_width; + int sampling_height; + int sample_count; + + if ( src_pitch < 0 ) + src_buf -= ((unsigned) src_pitch * (source->rows - 1)); + + /* compute how many source pixels a target pixel spans */ + vector.x = 1; + vector.y = 1; + m3x3_transform(&vector, m); + vector0.x = 0; + vector0.y = 0; + m3x3_transform(&vector0, m); + sampling_width = (int) ((vector.x - vector0.x) / 2); + sampling_height = (int) ((vector.y - vector0.y) / 2); + if (sampling_width < 0) sampling_width = -sampling_width; + if (sampling_height < 0) sampling_height = -sampling_height; + sample_count = (2 * sampling_width + 1) * (2 * sampling_height + 1); + + for ( y = height; y > 0; y--, dst_line += pitch ) + { + for ( x = 0; x < width; x++ ) + { + unsigned char* src; + + /* compute target pixel location in source space */ + vector.x = x; + vector.y = height - y; + m3x3_transform(&vector, m); + + if (source->pixel_mode == FT_PIXEL_MODE_BGRA) + { + if (vector.x < -sampling_width + || vector.x > (source->width + (unsigned) sampling_width)) + continue; + if (vector.y < -sampling_height + || vector.y > (source->rows + (unsigned) sampling_height)) + continue; + } + else + { + if (vector.x < 0 || vector.x >= source->width) + continue; + if (vector.y < 0 || vector.y >= source->rows) + continue; + } + + switch ( source->pixel_mode ) + { + case FT_PIXEL_MODE_MONO: /* convert mono to 8-bit gray, scale using nearest pixel */ + src = src_buf + (vector.y * src_pitch); + if ( src(vector.x >> 3) & (0x80 >> (vector.x & 7)) ) + dst_linex = 0xff; + break; + + case FT_PIXEL_MODE_GRAY: /* scale using nearest pixel */ + src = src_buf + (vector.y * src_pitch); + dst_linex = srcvector.x; + break; + + case FT_PIXEL_MODE_BGRA: /* scale by averaging all relevant source pixels, keep BGRA format */ + { + int sample_x, sample_y; + int bgra4 = { 0, 0, 0, 0 }; + + for (sample_y = - sampling_height; sample_y < sampling_height + 1; ++sample_y) + { + int src_y = (int) (vector.y + sample_y); + + if (src_y < 0 || (FT_Pos) src_y >= source->rows) + continue; + src = src_buf + (src_y * src_pitch); + for (sample_x = - sampling_width; sample_x < sampling_width + 1; ++sample_x) + { + int src_x = (int) (vector.x + sample_x); + + if (src_x < 0 || (FT_Pos) src_x >= source->width) + continue; + for (i = 0; i < 4; ++i) + bgrai += srcsrc_x * 4 + i; + } + } + + for (i = 0; i < 4; ++i) + dst_line4 * x + i = (unsigned char) (bgrai / sample_count); + break; + } + } + } + } +} + +/* this functions converts the glyph bitmap found in a FT_GlyphSlot * into a different format (see _compute_xrender_bitmap_size) * * you should call this function after _compute_xrender_bitmap_size @@ -166,15 +453,15 @@ { unsigned char* srcLine = ftbit->buffer; - unsigned char* dstLine = target->buffer; - int src_pitch = ftbit->pitch; - int width = (int)target->width; - int height = (int)target->rows; - int pitch = target->pitch; - int subpixel; - int h; - - subpixel = ( mode == FT_RENDER_MODE_LCD || + unsigned char* dstLine = target->buffer; + int src_pitch = ftbit->pitch; + int width = (int)target->width; + int height = (int)target->rows; + int pitch = target->pitch; + int subpixel; + int h; + + subpixel = ( mode == FT_RENDER_MODE_LCD || mode == FT_RENDER_MODE_LCD_V ); if ( src_pitch < 0 ) @@ -244,6 +531,11 @@ } break; + case FT_PIXEL_MODE_BGRA: /* Preserve BGRA format */ + for ( h = height; h > 0; h--, srcLine += src_pitch, dstLine += pitch ) + memcpy( dstLine, srcLine, (size_t) width * 4 ); + break; + case FT_PIXEL_MODE_LCD: if ( !bgr ) { @@ -363,8 +655,11 @@ FT_Bitmap* ftbit; FT_Bitmap local; FT_Vector vector; + m3x3 m; FT_Face face; FT_Render_Mode mode = FT_RENDER_MODE_MONO; + FcBool transform; + FcBool glyph_transform; if (!info) return; @@ -374,6 +669,8 @@ if (!face) return; + if (font->info.color) + mode = FT_RENDER_MODE_NORMAL; if (font->info.antialias) { switch (font->info.rgba) { @@ -390,6 +687,8 @@ } } + transform = font->info.transform && mode != FT_RENDER_MODE_MONO; + while (nglyph--) { glyphindex = *glyphs++; @@ -440,29 +739,29 @@ /* * Compute glyph metrics from FreeType information */ - if(font->info.transform && glyphslot->format != FT_GLYPH_FORMAT_BITMAP) + if (transform) { /* * calculate the true width by transforming all four corners. */ int xc, yc; left = right = top = bottom = 0; - for(xc = 0; xc <= 1; xc ++) { - for(yc = 0; yc <= 1; yc++) { + for (xc = 0; xc <= 1; xc++) { + for (yc = 0; yc <= 1; yc++) { vector.x = glyphslot->metrics.horiBearingX + xc * glyphslot->metrics.width; vector.y = glyphslot->metrics.horiBearingY - yc * glyphslot->metrics.height; FT_Vector_Transform(&vector, &font->info.matrix); if (XftDebug() & XFT_DBG_GLYPH) printf("Trans %d %d: %d %d\n", (int) xc, (int) yc, (int) vector.x, (int) vector.y); - if(xc == 0 && yc == 0) { + if (xc == 0 && yc == 0) { left = right = (int)vector.x; top = bottom = (int)vector.y; } else { - if(left > vector.x) left = (int)vector.x; - if(right < vector.x) right = (int)vector.x; - if(bottom > vector.y) bottom = (int)vector.y; - if(top < vector.y) top = (int)vector.y; + if (left > vector.x) left = (int)vector.x; + if (right < vector.x) right = (int)vector.x; + if (bottom > vector.y) bottom = (int)vector.y; + if (top < vector.y) top = (int)vector.y; } } @@ -470,7 +769,7 @@ left = (int)FLOOR(left); right = (int)CEIL(right); bottom = (int)FLOOR(bottom); - top = CEIL(top); + top = (int)CEIL(top); } else { left = (int)FLOOR( glyphslot->metrics.horiBearingX ); @@ -480,14 +779,11 @@ bottom = (int)FLOOR( glyphslot->metrics.horiBearingY - glyphslot->metrics.height ); } - width = TRUNC(right - left); - height = TRUNC( top - bottom ); - /* * Clip charcell glyphs to the bounding box * XXX transformed? */ - if (font->info.spacing >= FC_CHARCELL && !font->info.transform) + if (font->info.spacing >= FC_CHARCELL && !transform) { if (font->info.load_flags & FT_LOAD_VERTICAL_LAYOUT) { @@ -500,7 +796,6 @@ adjust = top; top -= adjust; bottom -= adjust; - height = font->public.max_advance_width; } } else @@ -514,23 +809,24 @@ adjust = left; left -= adjust; right -= adjust; - width = font->public.max_advance_width; } } } + glyph_transform = transform; if ( glyphslot->format != FT_GLYPH_FORMAT_BITMAP ) { error = FT_Render_Glyph( face->glyph, mode ); if (error) continue; + glyph_transform = False; } FT_Library_SetLcdFilter( _XftFTlibrary, FT_LCD_FILTER_NONE ); if (font->info.spacing >= FC_MONO) { - if (font->info.transform) + if (transform) { if (font->info.load_flags & FT_LOAD_VERTICAL_LAYOUT) { @@ -542,20 +838,20 @@ vector.x = face->size->metrics.max_advance; vector.y = 0; } - FT_Vector_Transform (&vector, &font->info.matrix); - xftg->metrics.xOff = (short)(vector.x >> 6); - xftg->metrics.yOff = (short)(-(vector.y >> 6)); + FT_Vector_Transform(&vector, &font->info.matrix); + xftg->metrics.xOff = (short)(TRUNC(ROUND(vector.x))); + xftg->metrics.yOff = (short)(TRUNC(ROUND(vector.y))); } else { if (font->info.load_flags & FT_LOAD_VERTICAL_LAYOUT) { xftg->metrics.xOff = 0; - xftg->metrics.yOff = (short)(-font->public.max_advance_width); + xftg->metrics.yOff = (short)(-TRUNC(ROUND(glyphslot->advance.y))); } else { - xftg->metrics.xOff = (short)(font->public.max_advance_width); + xftg->metrics.xOff = (short)(TRUNC(ROUND(glyphslot->advance.x))); xftg->metrics.yOff = 0; } } @@ -603,7 +899,7 @@ { for (x = 0; x < width * 8; x++) { - printf ("%c", linex>>3 & (1 << (x & 7)) ? '#' : ' '); + printf ("%c", (linex>>3 & (1 << (x & 7))) ? '#' : ' '); } } printf ("|\n"); @@ -613,20 +909,35 @@ } } - size = _compute_xrender_bitmap_size( &local, glyphslot, mode ); + m3x3_uniform(m); + size = _compute_xrender_bitmap_size( &local, glyphslot, mode, glyph_transform ? &font->info.matrix : NULL, m ); if ( size < 0 ) continue; xftg->metrics.width = (unsigned short)local.width; xftg->metrics.height = (unsigned short)local.rows; - xftg->metrics.x = (short)(- glyphslot->bitmap_left); - xftg->metrics.y = (short)( glyphslot->bitmap_top); + if (glyph_transform) + { + m3x3 mi; + + m3x3_invert(m, mi); + vector.x = - glyphslot->bitmap_left; + vector.y = glyphslot->bitmap_top; + m3x3_transform(&vector, mi); + xftg->metrics.x = (short)vector.x; + xftg->metrics.y = (short)vector.y; + } + else + { + xftg->metrics.x = (short)(- glyphslot->bitmap_left); + xftg->metrics.y = (short)( glyphslot->bitmap_top); + } /* * If the glyph is relatively large (> 1% of server memory), * don't send it until necessary. */ - if (!need_bitmaps && size > info->max_glyph_memory / 100) + if (!need_bitmaps && ((unsigned long) size > (info->max_glyph_memory / 100))) continue; /* @@ -645,9 +956,12 @@ local.buffer = bufBitmap; - _fill_xrender_bitmap( &local, glyphslot, mode, - (font->info.rgba == FC_RGBA_BGR || - font->info.rgba == FC_RGBA_VBGR ) ); + if (mode == FT_RENDER_MODE_NORMAL && glyph_transform) + _scaled_fill_xrender_bitmap(&local, &glyphslot->bitmap, m); + else + _fill_xrender_bitmap( &local, glyphslot, mode, + (font->info.rgba == FC_RGBA_BGR || + font->info.rgba == FC_RGBA_VBGR) ); /* * Copy or convert into local buffer. @@ -662,7 +976,12 @@ */ glyph = (Glyph) glyphindex; - xftg->glyph_memory = (size_t)size + sizeof (XftGlyph); + if (xftg->picture) + { + XRenderFreePicture(dpy, xftg->picture); + xftg->picture = 0; + } + xftg->glyph_memory = (size_t)size + font->sizeof_glyph; if (font->format) { if (!font->glyphset) @@ -685,15 +1004,43 @@ } } } - else if ( mode != FT_RENDER_MODE_NORMAL ) + else if (glyphslot->bitmap.pixel_mode == FT_PIXEL_MODE_BGRA || mode != FT_RENDER_MODE_NORMAL) { /* invert ARGB <=> BGRA */ if (ImageByteOrder (dpy) != XftNativeByteOrder ()) XftSwapCARD32 ((CARD32 *) bufBitmap, size >> 2); } - XRenderAddGlyphs (dpy, font->glyphset, &glyph, - &xftg->metrics, 1, - (char *) bufBitmap, size); + + if (glyphslot->bitmap.pixel_mode == FT_PIXEL_MODE_BGRA) + { + Pixmap pixmap = XCreatePixmap(dpy, DefaultRootWindow(dpy), local.width, local.rows, 32); + GC gc = XCreateGC(dpy, pixmap, 0, NULL); + XImage image = { + (int) local.width, (int) local.rows, 0, ZPixmap, (char *)bufBitmap, + dpy->byte_order, dpy->bitmap_unit, dpy->bitmap_bit_order, 32, + 32, (int) (local.width * 4 - (unsigned) local.pitch), 32, + 0, 0, 0, NULL, { NULL } + }; + + XInitImage(&image); + XPutImage(dpy, pixmap, gc, &image, 0, 0, 0, 0, local.width, local.rows); + xftg->picture = XRenderCreatePicture(dpy, pixmap, font->format, 0, NULL); + + XFreeGC(dpy, gc); + XFreePixmap(dpy, pixmap); + /* + * Record 256 times higher memory pressure for unrotated + * pictures, and maximum for rotated pictures. + */ + if (font->info.matrix.xy || font->info.matrix.yx) + xftg->glyph_memory += font->max_glyph_memory - (unsigned long) size; + else + xftg->glyph_memory += (size_t)size * 255; + } + else + XRenderAddGlyphs (dpy, font->glyphset, &glyph, + &xftg->metrics, 1, + (char *) bufBitmap, size); } else { @@ -712,8 +1059,46 @@ if (XftDebug() & XFT_DBG_CACHE) _XftFontValidateMemory (dpy, pub); if (XftDebug() & XFT_DBG_CACHEV) - printf ("Caching glyph 0x%x size %ld\n", glyphindex, + printf ("Caching glyph 0x%x size %lu\n", glyphindex, xftg->glyph_memory); + + if (font->track_mem_usage) { + XftGlyphUsage *xuse = (XftGlyphUsage *) xftg; + + if (font->newest == FT_UINT_MAX) { + xuse->older = glyphindex; + xuse->newer = glyphindex; + if (XftDebug() & XFT_DBG_USAGE) + printf("alloc %p -> %d: %p USE %d.%d\n", + (void *) font, glyphindex, + (void *) xuse, xuse->older, xuse->newer); + } else { + XftGlyphUsage *xnew; + XftGlyphUsage *xold; + + assert(font->glyphsfont->newest != NULL); + xnew = (XftGlyphUsage *) font->glyphsfont->newest; + + assert(font->glyphsxnew->newer != NULL); + xold = (XftGlyphUsage *) font->glyphsxnew->newer; + + xuse->older = font->newest; + xuse->newer = xnew->newer; + xnew->newer = glyphindex; + xold->older = glyphindex; + if (XftDebug() & XFT_DBG_USAGE) + printf("alloc %p -> %d: %p USE %d.%d, %p NEW %d.%d %p OLD %d.%d\n", + (void *) font, glyphindex, + (void *) xuse, xuse->older, xuse->newer, + (void *) xnew, xnew->older, xnew->newer, + (void *) xold, xold->older, xold->newer); + } + + font->newest = glyphindex; + font->total_inuse++; + if (XftDebug() & XFT_DBG_USAGE) + _XftValidateGlyphUsage(font); + } } if (bufBitmap != bufLocal) free (bufBitmap); @@ -742,9 +1127,14 @@ continue; if (xftg->glyph_memory) { + if (XftDebug() & XFT_DBG_CACHEV) + printf ("Uncaching glyph 0x%x size %lu\n", + glyphindex, xftg->glyph_memory); if (font->format) { - if (font->glyphset) + if (xftg->picture) + XRenderFreePicture(dpy, xftg->picture); + else if (font->glyphset) { glyphBufnused++ = (Glyph) glyphindex; if (nused == sizeof (glyphBuf) / sizeof (glyphBuf0)) @@ -754,17 +1144,52 @@ } } } - else - { - if (xftg->bitmap) - free (xftg->bitmap); - } + else if (xftg->bitmap) + free (xftg->bitmap); font->glyph_memory -= xftg->glyph_memory; if (info) info->glyph_memory -= xftg->glyph_memory; } + + if (font->track_mem_usage) { + XftGlyphUsage *xuse = (XftGlyphUsage *) xftg; + XftGlyphUsage *xtmp; + + if (XftDebug() & XFT_DBG_USAGE) + printf("free %p -> %p USE %d.%d\n", + (void *) font, (void *) xuse, xuse->older, xuse->newer); + + if (xuse->older != FT_UINT_MAX) { + xtmp = (XftGlyphUsage *) font->glyphsxuse->older; + if (xtmp != NULL) { + /* update link around to oldest glyph */ + xtmp->newer = xuse->newer; + } + if (font->newest == glyphindex) { + if (font->newest == xuse->older) + font->newest = FT_UINT_MAX; + else + font->newest = xuse->older; + } + } + if (xuse->newer != FT_UINT_MAX) { + xtmp = (XftGlyphUsage *) font->glyphsxuse->newer; + if (xtmp != NULL) { + /* update link around to newest glyph */ + xtmp->older = xuse->older; + } + } + if (font->total_inuse) { + font->total_inuse--; + } else { + fprintf (stderr, "Xft: glyph count error\n"); + } + if (XftDebug() & XFT_DBG_USAGE) + _XftValidateGlyphUsage(font); + } + free (xftg); - XftMemFree (XFT_MEM_GLYPH, sizeof (XftGlyph)); + XftMemFree (XFT_MEM_GLYPH, font->sizeof_glyph); font->glyphsglyphindex = NULL; } if (font->glyphset && nused) @@ -790,13 +1215,21 @@ { if (!xftg) { - xftg = (XftGlyph *) malloc (sizeof (XftGlyph)); + xftg = malloc (font->sizeof_glyph); if (!xftg) return FcFalse; - XftMemAlloc (XFT_MEM_GLYPH, sizeof (XftGlyph)); + XftMemAlloc (XFT_MEM_GLYPH, font->sizeof_glyph); + xftg->bitmap = NULL; xftg->glyph_memory = 0; + xftg->picture = 0; font->glyphsglyph = xftg; + + if (font->track_mem_usage) { + XftGlyphUsage *xuse = (XftGlyphUsage *) xftg; + xuse->older = FT_UINT_MAX; + xuse->newer = FT_UINT_MAX; + } } n = *nmissing; missingn++ = glyph; @@ -808,14 +1241,46 @@ *nmissing = n; return FcTrue; } - else - return FcFalse; + + /* + * Make unloading faster by moving newly-referenced glyphs to the front + * of the list, leaving the less-used glyphs on the end. + */ + if (font->track_mem_usage + && font->total_inuse > 10 + && font->newest != FT_UINT_MAX + && font->newest != glyph) + { + XftGlyphUsage *xuse = (XftGlyphUsage *) xftg; + XftGlyphUsage *xtmp = (XftGlyphUsage *) font->glyphsfont->newest; + XftGlyphUsage *xold; + XftGlyphUsage *xnew; + + /* delink */ + xold = (XftGlyphUsage *) font->glyphsxuse->older; + xnew = (XftGlyphUsage *) font->glyphsxuse->newer; + assert(xold != NULL); + assert(xnew != NULL); + xold->newer = xuse->newer; + xnew->older = xuse->older; + + /* relink */ + xnew = (XftGlyphUsage *) font->glyphsxtmp->newer; + assert(xnew != NULL); + xnew->older = glyph; + xuse->older = font->newest; + xuse->newer = xtmp->newer; + xtmp->newer = glyph; + + font->newest = glyph; + } + return FcFalse; } _X_EXPORT FcBool -XftCharExists (Display *dpy, +XftCharExists (Display *dpy _X_UNUSED, XftFont *pub, - FcChar32 ucs4) + FcChar32 ucs4) { if (pub->charset) return FcCharSetHasChar (pub->charset, ucs4); @@ -859,14 +1324,14 @@ offset = 1; } ent = ent + offset; - if (ent >= font->hash_value) + if (ent >= (FcChar32)font->hash_value) ent -= (FcChar32)font->hash_value; } return font->hash_tableent.glyph; } /* - * Pick a random glyph from the font and remove it from the cache + * Remove glyph(s) from the font to reduce memory-usage. */ _X_HIDDEN void _XftFontUncacheGlyph (Display *dpy, XftFont *pub) @@ -878,40 +1343,64 @@ if (!font->glyph_memory) return; - if (font->use_free_glyphs) + + if (XftDebug() & XFT_DBG_CACHE) + _XftFontValidateMemory (dpy, pub); + + if (font->track_mem_usage) { + /* + * Remove the oldest glyph from the font. + */ + if (font->newest != FT_UINT_MAX) { + XftGlyphUsage *xuse = (XftGlyphUsage *) font->glyphsfont->newest; + if ((glyphindex = xuse->newer) != FT_UINT_MAX) + XftFontUnloadGlyphs (dpy, pub, &glyphindex, 1); + } + } + else if (font->use_free_glyphs) + { + /* + * Pick a random glyph from the font and remove it from the cache + */ glyph_memory = ((unsigned long)rand() % font->glyph_memory); + for (glyphindex = 0; glyphindex < font->num_glyphs; glyphindex++) + { + xftg = font->glyphsglyphindex; + if (xftg) + { + if (xftg->glyph_memory > glyph_memory) + { + XftFontUnloadGlyphs (dpy, pub, &glyphindex, 1); + break; + } + glyph_memory -= xftg->glyph_memory; + } + } } else { + /* + * Free all glyphs, since they are part of a set. + */ if (font->glyphset) { XRenderFreeGlyphSet (dpy, font->glyphset); font->glyphset = 0; } - glyph_memory = 0; - } - - if (XftDebug() & XFT_DBG_CACHE) - _XftFontValidateMemory (dpy, pub); - for (glyphindex = 0; glyphindex < font->num_glyphs; glyphindex++) - { - xftg = font->glyphsglyphindex; - if (xftg) + for (glyphindex = 0; glyphindex < font->num_glyphs; glyphindex++) { - if (xftg->glyph_memory > glyph_memory) + xftg = font->glyphsglyphindex; + if (xftg) { - if (XftDebug() & XFT_DBG_CACHEV) - printf ("Uncaching glyph 0x%x size %ld\n", - glyphindex, xftg->glyph_memory); - XftFontUnloadGlyphs (dpy, pub, &glyphindex, 1); - if (!font->use_free_glyphs) - continue; - break; + if (xftg->glyph_memory > 0) + { + XftFontUnloadGlyphs (dpy, pub, &glyphindex, 1); + } } - glyph_memory -= xftg->glyph_memory; } } + if (XftDebug() & XFT_DBG_CACHE) _XftFontValidateMemory (dpy, pub); } @@ -926,7 +1415,7 @@ if (XftDebug() & XFT_DBG_CACHE) { if (font->glyph_memory > font->max_glyph_memory) - printf ("Reduce memory for font 0x%lx from %ld to %ld\n", + printf ("Reduce memory for font 0x%lx from %lu to %lu\n", font->glyphset ? font->glyphset : (unsigned long) font, font->glyph_memory, font->max_glyph_memory); }
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/src/xftinit.c -> _service:tar_scm:libXft-2.3.7.tar.gz/src/xftinit.c
Changed
@@ -25,7 +25,7 @@ static Bool _XftConfigInitialized; _X_EXPORT Bool -XftInit (_Xconst char *config) +XftInit (_Xconst char *config _X_UNUSED) { if (_XftConfigInitialized) return True; @@ -44,45 +44,48 @@ static struct { const char *name; int alloc_count; - int alloc_mem; + size_t alloc_mem; int free_count; - int free_mem; + size_t free_mem; } XftInUseXFT_MEM_NUM = { - { "XftDraw", 0, 0 }, - { "XftFont", 0 ,0 }, - { "XftFtFile", 0, 0 }, - { "XftGlyph", 0, 0 }, + { "XftDraw", 0, 0, 0, 0 }, /* XFT_MEM_DRAW */ + { "XftFont", 0, 0, 0, 0 }, /* XFT_MEM_FONT */ + { "XftFtFile", 0, 0, 0, 0 }, /* XFT_MEM_FILE */ + { "XftGlyph", 0, 0, 0, 0 }, /* XFT_MEM_GLYPH */ }; -static int XftAllocCount, XftAllocMem; -static int XftFreeCount, XftFreeMem; +static int XftAllocCount; +static size_t XftAllocMem; -static const int XftMemNotice = 1*1024*1024; +static int XftFreeCount; +static size_t XftFreeMem; -static int XftAllocNotify, XftFreeNotify; +static const size_t XftMemNotice = 1*1024*1024; + +static size_t XftAllocNotify, XftFreeNotify; _X_HIDDEN void XftMemReport (void) { int i; printf ("Xft Memory Usage:\n"); - printf ("\t Which Alloc Free\n"); - printf ("\t count bytes count bytes\n"); + printf ("\t Which Alloc Free\n"); + printf ("\t count bytes count bytes\n"); for (i = 0; i < XFT_MEM_NUM; i++) - printf ("\t%8.8s%8d%8d%8d%8d\n", + printf ("\t%9.9s%8d%8lu%8d%8lu\n", XftInUsei.name, - XftInUsei.alloc_count, XftInUsei.alloc_mem, - XftInUsei.free_count, XftInUsei.free_mem); - printf ("\t%8.8s%8d%8d%8d%8d\n", + XftInUsei.alloc_count, (unsigned long) XftInUsei.alloc_mem, + XftInUsei.free_count, (unsigned long) XftInUsei.free_mem); + printf ("\t%9.9s%8d%8lu%8d%8lu\n", "Total", - XftAllocCount, XftAllocMem, - XftFreeCount, XftFreeMem); + XftAllocCount, (unsigned long) XftAllocMem, + XftFreeCount, (unsigned long) XftFreeMem); XftAllocNotify = 0; XftFreeNotify = 0; } _X_HIDDEN void -XftMemAlloc (int kind, int size) +XftMemAlloc (int kind, size_t size) { if (XftDebug() & XFT_DBG_MEMORY) { @@ -97,7 +100,7 @@ } _X_HIDDEN void -XftMemFree (int kind, int size) +XftMemFree (int kind, size_t size) { if (XftDebug() & XFT_DBG_MEMORY) {
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/src/xftint.h -> _service:tar_scm:libXft-2.3.7.tar.gz/src/xftint.h
Changed
@@ -1,23 +1,24 @@ /* + * Copyright © 2022 Thomas E. Dickey * Copyright © 2000 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the above copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The above copyright holders make no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. + * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF + * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* @@ -50,6 +51,7 @@ #endif #endif #include <ctype.h> +#include <assert.h> #include <X11/Xlib.h> #include <X11/Xutil.h> @@ -85,10 +87,21 @@ XGlyphInfo metrics; void *bitmap; unsigned long glyph_memory; + Picture picture; } XftGlyph; /* - * A hash table translates Unicode values into glyph indicies + * If the "trackmemusage" option is set, glyphs are managed via a doubly-linked + * list. To save space, the links are just array indices. + */ +typedef struct _XftGlyphUsage { + XftGlyph contents; + FT_UInt newer; + FT_UInt older; +} XftGlyphUsage; + +/* + * A hash table translates Unicode values into glyph indices */ typedef struct _XftUcsHash { FcChar32 ucs4; @@ -134,6 +147,7 @@ FT_F26Dot6 xsize, ysize; /* pixel size */ FcBool antialias; /* doing antialiasing */ FcBool embolden; /* force emboldening */ + FcBool color; /* contains color glyphs */ int rgba; /* subpixel order */ int lcd_filter; /* lcd filter */ FT_Matrix matrix; /* glyph transformation matrix */ @@ -163,7 +177,7 @@ * This array follows the font in memory */ XftGlyph **glyphs; - int num_glyphs; /* size of glyphs/bitmaps arrays */ + FT_UInt num_glyphs; /* size of glyphs/bitmaps arrays */ /* * Hash table to get from Unicode value to glyph ID * This array follows the glyphs in memory @@ -181,6 +195,10 @@ */ unsigned long glyph_memory; unsigned long max_glyph_memory; + unsigned sizeof_glyph; /* sizeof(XftGlyph) or XftGlyphUsage */ + FT_UInt newest; /* index, for tracking usage */ + FT_UInt total_inuse; /* total, for verifying usage */ + FcBool track_mem_usage; /* Use XftGlyphUsage */ FcBool use_free_glyphs; /* Use XRenderFreeGlyphs */ } XftFontInt; @@ -250,6 +268,7 @@ XRenderPictFormat *solidFormat; unsigned long glyph_memory; unsigned long max_glyph_memory; + FcBool track_mem_usage; FcBool use_free_glyphs; int num_unref_fonts; int max_unref_fonts; @@ -273,6 +292,9 @@ extern XftDisplayInfo *_XftDisplayInfo; +/* + * Bits in $XFT_DEBUG, which can be combined. + */ #define XFT_DBG_OPEN 1 #define XFT_DBG_OPENV 2 #define XFT_DBG_RENDER 4 @@ -283,47 +305,24 @@ #define XFT_DBG_CACHE 128 #define XFT_DBG_CACHEV 256 #define XFT_DBG_MEMORY 512 +#define XFT_DBG_USAGE 1024 -#define XFT_MEM_DRAW 0 -#define XFT_MEM_FONT 1 -#define XFT_MEM_FILE 2 -#define XFT_MEM_GLYPH 3 -#define XFT_MEM_NUM 4 - -/* xftcompat.c */ -void XftFontSetDestroy (FcFontSet *s); -FcBool XftMatrixEqual (_Xconst FcMatrix *mat1, _Xconst FcMatrix *mat2); -void XftMatrixMultiply (FcMatrix *result, FcMatrix *a, FcMatrix *b); -void XftMatrixRotate (FcMatrix *m, double c, double s); -void XftMatrixScale (FcMatrix *m, double sx, double sy); -void XftMatrixShear (FcMatrix *m, double sh, double sv); -FcPattern *XftPatternCreate (void); -void XftValueDestroy (FcValue v); -void XftPatternDestroy (FcPattern *p); -FcBool XftPatternAdd (FcPattern *p, _Xconst char *object, FcValue value, FcBool append); -FcBool XftPatternDel (FcPattern *p, _Xconst char *object); -FcBool XftPatternAddInteger (FcPattern *p, _Xconst char *object, int i); -FcBool XftPatternAddDouble (FcPattern *p, _Xconst char *object, double i); -FcBool XftPatternAddMatrix (FcPattern *p, _Xconst char *object, FcMatrix *i); -FcBool XftPatternAddString (FcPattern *p, _Xconst char *object, char *i); -FcBool XftPatternAddBool (FcPattern *p, _Xconst char *object, FcBool i); -FcResult XftPatternGet (FcPattern *p, _Xconst char *object, int id, FcValue *v); -FcResult XftPatternGetInteger (FcPattern *p, _Xconst char *object, int id, int *i); -FcResult XftPatternGetDouble (FcPattern *p, _Xconst char *object, int id, double *i); -FcResult XftPatternGetString (FcPattern *p, _Xconst char *object, int id, char **i); -FcResult XftPatternGetMatrix (FcPattern *p, _Xconst char *object, int id, FcMatrix **i); -FcResult XftPatternGetBool (FcPattern *p, _Xconst char *object, int id, FcBool *i); -FcPattern *XftPatternDuplicate (FcPattern *orig); -FcPattern *XftPatternVaBuild (FcPattern *orig, va_list va); -FcPattern *XftPatternBuild (FcPattern *orig, ...); -FcBool XftNameUnparse (FcPattern *pat, char *dest, int len); -FcBool XftGlyphExists (Display *dpy, XftFont *font, FcChar32 ucs4); -FcObjectSet *XftObjectSetCreate (void); -Bool XftObjectSetAdd (FcObjectSet *os, _Xconst char *object); -void XftObjectSetDestroy (FcObjectSet *os); -FcObjectSet *XftObjectSetVaBuild (_Xconst char *first, va_list va); -FcObjectSet *XftObjectSetBuild (_Xconst char *first, ...); -FcFontSet *XftListFontSets (FcFontSet **sets, int nsets, FcPattern *p, FcObjectSet *os); +/* + * Categories for memory allocation. + */ +typedef enum { + XFT_MEM_DRAW + , XFT_MEM_FONT + , XFT_MEM_FILE + , XFT_MEM_GLYPH + , XFT_MEM_NUM +} XFT_MEM_KIND; + +#define AllocTypedArray(n,type) malloc ((size_t)(n) * sizeof (type)) +#define AllocUIntArray(n) AllocTypedArray(n, FT_UInt) +#define AllocGlyphElt8Array(n) AllocTypedArray(n, XGlyphElt8) +#define AllocGlyphSpecArray(n) AllocTypedArray(n, XftGlyphSpec) +#define AllocGlyphFontSpecArray(n) AllocTypedArray(n, XftGlyphFontSpec) /* xftcore.c */ void @@ -415,10 +414,10 @@ XftMemReport (void); void -XftMemAlloc (int kind, int size); +XftMemAlloc (int kind, size_t size); void -XftMemFree (int kind, int size); +XftMemFree (int kind, size_t size); /* xftlist.c */ FcFontSet *
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/src/xftlist.c -> _service:tar_scm:libXft-2.3.7.tar.gz/src/xftlist.c
Changed
@@ -23,10 +23,10 @@ #include "xftint.h" _X_HIDDEN FcFontSet * -XftListFontsPatternObjects (Display *dpy, - int screen, +XftListFontsPatternObjects (Display *dpy _X_UNUSED, + int screen _X_UNUSED, FcPattern *pattern, - FcObjectSet *os) + FcObjectSet *os) { return FcFontList (NULL, pattern, os); }
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/src/xftname.c -> _service:tar_scm:libXft-2.3.7.tar.gz/src/xftname.c
Changed
@@ -25,7 +25,7 @@ _X_EXPORT FcPattern *XftNameParse (const char *name) { - return FcNameParse ((FcChar8 *) name); + return FcNameParse ((const FcChar8 *) name); } _X_EXPORT FcBool @@ -36,7 +36,7 @@ name = FcNameUnparse (pat); if (!name) return FcFalse; - if (strlen ((char *) name) + 1 > len) + if (strlen ((char *) name) + 1 > (size_t) len) { FcPattern *new = FcPatternDuplicate (pat); free (name); @@ -46,7 +46,7 @@ FcPatternDestroy (new); if (!name) return FcFalse; - if (strlen ((char *) name) + 1 > len) + if (strlen ((char *) name) + 1 > (size_t) len) { strncpy (dest, ((char *) name), (size_t) len - 1); destlen - 1 = '\0';
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/src/xftrender.c -> _service:tar_scm:libXft-2.3.7.tar.gz/src/xftrender.c
Changed
@@ -21,11 +21,53 @@ */ #include "xftint.h" +#include <stdint.h> #define NUM_LOCAL 1024 #define NUM_ELT_LOCAL 128 /* + * Dispatch glyph drawing to the correct XRenderCompositeString function + */ +static void +_XftCompositeString (Display *dpy, + int op, + Picture src, + Picture dst, + XRenderPictFormat *format, + GlyphSet glyphset, + int srcx, + int srcy, + int dstx, + int dsty, + int charwidth, + unsigned int *chars, + int nchars) +{ + if (nchars == 0) + return; + + switch (charwidth) { + case 1: + default: + XRenderCompositeString8 (dpy, op, + src, dst, format, glyphset, + srcx, srcy, dstx, dsty, (char*)chars, nchars); + break; + case 2: + XRenderCompositeString16(dpy, op, + src, dst, format, glyphset, + srcx, srcy, dstx, dsty, (unsigned short*)chars, nchars); + break; + case 4: + XRenderCompositeString32(dpy, op, + src, dst, format, glyphset, + srcx, srcy, dstx, dsty, (unsigned int*)chars, nchars); + break; + } +} + +/* * Use the Render extension to draw the glyphs */ @@ -43,18 +85,22 @@ int nglyphs) { XftFontInt *font = (XftFontInt *) pub; - int i; + int i, j; FT_UInt missingXFT_NMISSING; int nmissing; FT_UInt g, max; - int size, width; + int width; + int dstx, dsty; Glyph wire; + XftGlyph* glyph; char *char8; unsigned short *char16; unsigned int *char32; unsigned int char_localNUM_LOCAL; unsigned int *chars; FcBool glyphs_loaded; + size_t size; + size_t needed; if (!font->format) return; @@ -94,49 +140,100 @@ size = sizeof (unsigned int); } chars = char_local; - if (nglyphs * size > sizeof (char_local)) + if ((size_t)nglyphs > SIZE_MAX / size) + goto bail1; + needed = (size_t)nglyphs * size; + if (needed > sizeof (char_local)) { - chars = malloc ((size_t)(nglyphs * size)); + chars = malloc (needed); if (!chars) goto bail1; } + dstx = x; + dsty = y; char8 = (char *) chars; char16 = (unsigned short *) chars; char32 = (unsigned int *) chars; - for (i = 0; i < nglyphs; i++) + for (i = 0, j = 0; i < nglyphs; i++) { wire = (Glyph) glyphsi; - if (wire >= font->num_glyphs || !font->glyphswire) + if (wire >= (Glyph) font->num_glyphs || !font->glyphswire) wire = 0; - switch (width) { - case 1: char8i = (char) wire; break; - case 2: char16i = (unsigned short) wire; break; - case 4: char32i = (unsigned int) wire; break; + glyph = font->glyphswire; + if (glyph == NULL) + continue; + if (glyph->picture) + { + _XftCompositeString(dpy, op, src, dst, font->format, font->glyphset, srcx, srcy, x, y, width, chars, j); + XRenderComposite(dpy, PictOpOver, glyph->picture, None, dst, 0, 0, 0, 0, dstx - glyph->metrics.x, dsty - glyph->metrics.y, glyph->metrics.width, glyph->metrics.height); + dstx += glyph->metrics.xOff; + dsty += glyph->metrics.yOff; + x = dstx; + y = dsty; + j = 0; + } + else + { + switch (width) { + case 1: char8j = (char) wire; break; + case 2: char16j = (unsigned short) wire; break; + case 4: char32j = (unsigned int) wire; break; + } + dstx += glyph->metrics.xOff; + dsty += glyph->metrics.yOff; + ++j; } } - switch (width) { + _XftCompositeString(dpy, op, src, dst, font->format, font->glyphset, + srcx, srcy, x, y, width, chars, j); + if (chars != char_local) + free (chars); +bail1: + if (glyphs_loaded) + _XftFontManageMemory (dpy, pub); +} + +/* + * Dispatch glyph drawing to the correct XRenderCompositeText function + */ +static void +_XftCompositeText (Display *dpy, + int op, + Picture src, + Picture dst, + XRenderPictFormat *format, + int srcx, + int srcy, + int dstx, + int dsty, + int eltwidth, + XGlyphElt8 *elts, + int nelt) +{ + if (nelt == 0) + return; + + switch (eltwidth) { case 1: default: - XRenderCompositeString8 (dpy, op, - src, dst, font->format, font->glyphset, - srcx, srcy, x, y, char8, nglyphs); + XRenderCompositeText8 (dpy, op, + src, dst, format, + srcx, srcy, dstx, dsty, + (XGlyphElt8*)elts, nelt); break; case 2: - XRenderCompositeString16(dpy, op, - src, dst, font->format, font->glyphset, - srcx, srcy, x, y, char16, nglyphs); + XRenderCompositeText16(dpy, op, + src, dst, format, + srcx, srcy, dstx, dsty, + (XGlyphElt16*)elts, nelt); break; case 4: - XRenderCompositeString32(dpy, op, - src, dst, font->format, font->glyphset, - srcx, srcy, x, y, char32, nglyphs); + XRenderCompositeText32(dpy, op, + src, dst, format, + srcx, srcy, dstx, dsty, + (XGlyphElt32*)elts, nelt); break; } - if (chars != char_local) - free (chars); -bail1: - if (glyphs_loaded) - _XftFontManageMemory (dpy, pub); } _X_EXPORT void @@ -232,7 +329,7 @@ for (i = 0; i < nglyphs; i++) { g = glyphsi.glyph; - /* Substitute default for non-existant glyphs */ + /* Substitute default for non-existent glyphs */ if (g >= font->num_glyphs || !font->glyphsg) g = 0; if (font->glyphsg) @@ -246,14 +343,15 @@ while (++i < nglyphs) { g = glyphsi.glyph; - /* Substitute default for non-existant glyphs */ + /* Substitute default for non-existent glyphs */ if (g >= font->num_glyphs || !font->glyphsg) g = 0; /* * check to see if the glyph is placed where it would - * fall using the normal spacing + * fall using the normal spacing and if it would render + * as a XRender glyph */ - if ((glyph = font->glyphsg)) + if ((glyph = font->glyphsg) && !glyph->picture) { if (x != glyphsi.x || y != glyphsi.y) { @@ -269,13 +367,13 @@ elts = elts_local; if (nelt > NUM_ELT_LOCAL) { - elts = malloc ((size_t)nelt * sizeof (XGlyphElt8)); + elts = AllocGlyphElt8Array (nelt); if (!elts) goto bail2; } /* - * Generate the list of glyph elts + * Generate the list of glyph elts or render color glyphs */ nelt = 0; x = y = 0; @@ -284,11 +382,21 @@ for (i = 0; i < nglyphs; i++) { g = glyphsi.glyph; - /* Substitute default for non-existant glyphs */ + /* Substitute default for non-existent glyphs */ if (g >= font->num_glyphs || !font->glyphsg) g = 0; if ((glyph = font->glyphsg)) { + if (glyph->picture) + { + XRenderComposite(dpy, PictOpOver, glyph->picture, None, + dst, 0, 0, 0, 0, + glyphsi.x - glyph->metrics.x, + glyphsi.y - glyph->metrics.y, + glyph->metrics.width, + glyph->metrics.height); + continue; + } if (!i || x != glyphsi.x || y != glyphsi.y) { if (n) @@ -320,23 +428,9 @@ eltsnelt.nchars = n; nelt++; } - switch (width) { - case 1: - XRenderCompositeText8 (dpy, op, src, dst, font->format, - srcx, srcy, glyphs0.x, glyphs0.y, - elts, nelt); - break; - case 2: - XRenderCompositeText16 (dpy, op, src, dst, font->format, - srcx, srcy, glyphs0.x, glyphs0.y, - (XGlyphElt16 *) elts, nelt); - break; - case 4: - XRenderCompositeText32 (dpy, op, src, dst, font->format, - srcx, srcy, glyphs0.x, glyphs0.y, - (XGlyphElt32 *) elts, nelt); - break; - } + _XftCompositeText(dpy, op, src, dst, font->format, + srcx, srcy, glyphs0.x, glyphs0.y, + width, elts, nelt); if (elts != elts_local) free (elts); @@ -362,11 +456,14 @@ XftGlyphSpec *glyphs, glyphs_localNUM_LOCAL; int i; + if (len <= 0) + return; + if (len <= NUM_LOCAL) glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (XftGlyphSpec)); + glyphs = AllocGlyphSpecArray (len); if (!glyphs) return; } @@ -507,7 +604,7 @@ XftFont *pub = glyphsi.font; XftFontInt *font = (XftFontInt *) pub; g = glyphsi.glyph; - /* Substitute default for non-existant glyphs */ + /* Substitute default for non-existent glyphs */ if (g >= font->num_glyphs || !font->glyphsg) g = 0; if (font->glyphsg) @@ -528,14 +625,14 @@ XftFont *pub = glyphsi.font; XftFontInt *font = (XftFontInt *) pub; g = glyphsi.glyph; - /* Substitute default for non-existant glyphs */ + /* Substitute default for non-existent glyphs */ if (g >= font->num_glyphs || !font->glyphsg) g = 0; /* * check to see if the glyph is placed where it would * fall using the normal spacing */ - if ((glyph = font->glyphsg)) + if ((glyph = font->glyphsg) && !glyph->picture) { if (pub != prevPublic || x != glyphsi.x || y != glyphsi.y) { @@ -554,13 +651,13 @@ elts = elts_local; if (nelt > NUM_ELT_LOCAL) { - elts = malloc ((size_t)nelt * sizeof (XGlyphElt8)); + elts = AllocGlyphElt8Array (nelt); if (!elts) goto bail2; } /* - * Generate the list of glyph elts + * Generate the list of glyph elts and render color glyphs */ nelt = 0; x = y = 0; @@ -573,11 +670,21 @@ XftFontInt *font = (XftFontInt *) pub; g = glyphsi.glyph; - /* Substitute default for non-existant glyphs */ + /* Substitute default for non-existent glyphs */ if (g >= font->num_glyphs || !font->glyphsg) g = 0; if ((glyph = font->glyphsg)) { + if (glyph->picture) + { + XRenderComposite(dpy, PictOpOver, glyph->picture, None, + dst, 0, 0, 0, 0, + glyphsi.x - glyph->metrics.x, + glyphsi.y - glyph->metrics.y, + glyph->metrics.width, + glyph->metrics.height); + continue; + } if (!i || pub != prevPublic || x != glyphsi.x || y != glyphsi.y) { if (n) @@ -610,23 +717,9 @@ eltsnelt.nchars = n; nelt++; } - switch (width) { - case 1: - XRenderCompositeText8 (dpy, op, src, dst, format, - srcx, srcy, glyphs0.x, glyphs0.y, - elts, nelt); - break; - case 2: - XRenderCompositeText16 (dpy, op, src, dst, format, - srcx, srcy, glyphs0.x, glyphs0.y, - (XGlyphElt16 *) elts, nelt); - break; - case 4: - XRenderCompositeText32 (dpy, op, src, dst, format, - srcx, srcy, glyphs0.x, glyphs0.y, - (XGlyphElt32 *) elts, nelt); - break; - } + _XftCompositeText(dpy, op, src, dst, format, + srcx, srcy, glyphs0.x, glyphs0.y, + width, elts, nelt); if (elts != elts_local) free (elts); @@ -652,11 +745,14 @@ XftGlyphFontSpec *glyphs, glyphs_localNUM_LOCAL; int i; + if (len <= 0) + return; + if (len <= NUM_LOCAL) glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (XftGlyphFontSpec)); + glyphs = AllocGlyphFontSpecArray (len); if (!glyphs) return; } @@ -689,11 +785,14 @@ FT_UInt *glyphs, glyphs_localNUM_LOCAL; int i; + if (len <= 0) + return; + if (len <= NUM_LOCAL) glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (FT_UInt)); + glyphs = AllocUIntArray (len); if (!glyphs) return; } @@ -721,11 +820,14 @@ FT_UInt *glyphs, glyphs_localNUM_LOCAL; int i; + if (len <= 0) + return; + if (len <= NUM_LOCAL) glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (FT_UInt)); + glyphs = AllocUIntArray (len); if (!glyphs) return; } @@ -753,11 +855,14 @@ FT_UInt *glyphs, glyphs_localNUM_LOCAL; int i; + if (len <= 0) + return; + if (len <= NUM_LOCAL) glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (FT_UInt)); + glyphs = AllocUIntArray (len); if (!glyphs) return; } @@ -786,11 +891,14 @@ FT_UInt *glyphs, glyphs_localNUM_LOCAL; int i; + if (len <= 0) + return; + if (len <= NUM_LOCAL) glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (FT_UInt)); + glyphs = AllocUIntArray (len); if (!glyphs) return; } @@ -819,11 +927,14 @@ FT_UInt *glyphs, glyphs_localNUM_LOCAL; int i; + if (len <= 0) + return; + if (len <= NUM_LOCAL) glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (FT_UInt)); + glyphs = AllocUIntArray (len); if (!glyphs) return; } @@ -851,11 +962,14 @@ FT_UInt *glyphs, glyphs_localNUM_LOCAL; int i; + if (len <= 0) + return; + if (len <= NUM_LOCAL) glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (FT_UInt)); + glyphs = AllocUIntArray (len); if (!glyphs) return; } @@ -887,11 +1001,14 @@ FT_UInt *glyphs, glyphs_localNUM_LOCAL; int i; + if (len <= 0) + return; + if (len <= NUM_LOCAL) glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (FT_UInt)); + glyphs = AllocUIntArray (len); if (!glyphs) return; } @@ -926,6 +1043,9 @@ int l; int size; + if (len <= 0) + return; + i = 0; glyphs = glyphs_local; size = NUM_LOCAL; @@ -933,7 +1053,7 @@ { if (i == size) { - glyphs_new = malloc ((size_t)size * 2 * sizeof (FT_UInt)); + glyphs_new = AllocUIntArray (size * 2); if (!glyphs_new) { if (glyphs != glyphs_local) @@ -958,7 +1078,7 @@ _X_EXPORT void XftTextRenderUtf16 (Display *dpy, - int op, + int op _X_UNUSED, Picture src, XftFont *pub, Picture dst, @@ -976,6 +1096,9 @@ int l; int size; + if (len <= 0) + return; + i = 0; glyphs = glyphs_local; size = NUM_LOCAL; @@ -983,7 +1106,7 @@ { if (i == size) { - glyphs_new = malloc ((size_t)size * 2 * sizeof (FT_UInt)); + glyphs_new = AllocUIntArray (size * 2); if (!glyphs_new) { if (glyphs != glyphs_local)
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/src/xftstr.c -> _service:tar_scm:libXft-2.3.7.tar.gz/src/xftstr.c
Changed
@@ -27,7 +27,7 @@ { while (n--) { - if (!FcStrCmpIgnoreCase ((FcChar8 *) s->name, (FcChar8 *) name)) + if (!FcStrCmpIgnoreCase ((const FcChar8 *) s->name, (const FcChar8 *) name)) return s->value; s++; }
View file
_service:tar_scm:libXft-2.3.4.tar.bz2/src/xftxlfd.c -> _service:tar_scm:libXft-2.3.7.tar.gz/src/xftxlfd.c
Changed
@@ -81,7 +81,7 @@ } _X_EXPORT FcPattern * -XftXlfdParse (const char *xlfd_orig, FcBool ignore_scalable, FcBool complete) +XftXlfdParse (const char *xlfd_orig, FcBool ignore_scalable _X_UNUSED, FcBool complete _X_UNUSED) { FcPattern *pat; const char *xlfd = xlfd_orig; @@ -89,8 +89,6 @@ const char *family; const char *weight_name; const char *slant; - const char *registry; - const char *encoding; char *save; int pixel; int point; @@ -113,9 +111,9 @@ if (!(xlfd = XftGetInt (++xlfd, &resy))) return NULL; if (!(xlfd = strchr (/* spacing = */ ++xlfd, '-'))) return NULL; if (!(xlfd = strchr (/* average_width = */ ++xlfd, '-'))) return NULL; - if (!(xlfd = strchr (registry = ++xlfd, '-'))) return NULL; + if (!(xlfd = strchr (/* registry = */ ++xlfd, '-'))) return NULL; /* make sure no fields follow this one */ - if ((xlfd = strchr (encoding = ++xlfd, '-'))) return NULL; + if ((/* xlfd = */ strchr (/* encoding = */ ++xlfd, '-'))) return NULL; if (!pixel) return NULL; @@ -131,7 +129,7 @@ return NULL; } - if (!FcPatternAddString (pat, XFT_XLFD, (FcChar8 *) xlfd_orig)) goto bail; + if (!FcPatternAddString (pat, XFT_XLFD, (const FcChar8 *) xlfd_orig)) goto bail; XftSplitStr (foundry, save); if (save0 && strcmp (save, "*") != 0)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2