summaryrefslogtreecommitdiff
path: root/xorg-macros.m4.in
AgeCommit message (Collapse)Author
2024-01-08Remove unnecessary escapeMatt Turner
Avoids warnings like: checking if /usr/bin/cpp requires -traditional... grep: warning: stray \ before " grep: warning: stray \ before "
2023-02-12Add XORG_DEFAULT_NOCODE_OPTIONS and bump version to 1.20.0util-macros-1.20.0Alan Coopersmith
Allows data, doc, & font modules that don't compile any code to avoid spending time running a bunch of compiler tests whose results they'll ignore and never use. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-09Call AC_PROG_CC instead of AC_PROG_CC_C99 if autoconf >= 2.70Alan Coopersmith
Clears up deprecation warnings: configure.ac:38: warning: The macro `AC_PROG_CC_C99' is obsolete. configure.ac:38: You should run autoupdate. ./lib/autoconf/c.m4:1659: AC_PROG_CC_C99 is expanded from... aclocal.m4:2959: XORG_COMPILER_BRAND is expanded from... aclocal.m4:3078: XORG_COMPILER_FLAGS is expanded from... aclocal.m4:3267: XORG_DEFAULT_OPTIONS is expanded from... configure.ac:38: the top level ./lib/autoconf/c.m4:1659: AC_PROG_CC_C99 is expanded from... aclocal.m4:2990: XORG_TESTSET_CFLAG is expanded from... aclocal.m4:3082: XORG_COMPILER_FLAGS is expanded from... aclocal.m4:3254: XORG_DEFAULT_OPTIONS is expanded from... configure.ac:28: the top level Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-15Fix spelling/wording issuesAlan Coopersmith
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-03-30XORG_PROG_RAWCPP: Use AC_PATH_TOOL to find preprocessorMarvin Schmidt
On some distributions tools like cpp are prefixed with the host-triple, to check for this prefixed version first AC_PATH_TOOL should be used. If no prefixed cpp, it will fallback to the unprefixed name. https://bugs.freedesktop.org/show_bug.cgi?id=96257 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-11-11Update check for manpage section numbers to not rely on Solaris versionAlan Coopersmith
Check for a specific file instead of a specific set of versions from uname, to cope with manpage section alignment coming to 11.4 instead of 12.0. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2017-02-20Rework INSTALL_CMD to touch/echo >&2 only as neededEmil Velikov
Analogous to previous commit. With this commit we no longer get the following erroneous messages during `make distcheck'. " failed to copy INSTALL from util-macros: installing possibly empty INSTALL. ... failed to copy INSTALL from util-macros: installing possibly empty INSTALL. " Cc: Gaetan Nadon <memsize@videotron.ca> Cc: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-14Fix XORG_WITH_XMLTO to work with xmlto >= 0.0.27Andreas Boll
Starting with xmlto version 0.0.27 the return code of xmlto --skip-validation txt conftest.xml is non-zero if conftest.xml is an empty file. As a consequence the macro XORG_WITH_XMLTO returns "xmlto cannot generate text format, this format skipped" and therefore libraries like libxi, libxdmcp and others won't convert docbook XML to text format. This changed behavior was introduced with the following change in xmlto: xmlto.in: use correctly exit code from xsltproc See also: https://fedorahosted.org/xmlto/changeset/77 This patch fixes this by additionally testing xmlto with a non-empty XML file. More details can be found at: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613674 Thanks to Peter Pearse, Helmut Grohne and Gaetan Nadon. v2: To maintain compatibility with older xorg tarballs don't replace the original test with the empty XML file but instead add a fallback to additionally test with a non-empty XML file if the original test fails. Use the alternate solution with <x></x> to skip compatibility issues with different docbook versions. Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Julien Cristau <jcristau@debian.org>
2015-10-28XORG_MANPAGE_SECTIONS: limit SysV man page sections to Solaris 2.0-11Alan Coopersmith
All others (including other SunOS/Solaris releases) use the traditional Bell Labs / BSD / Linux section numbering. (The [[01]] is an m4-quoted shell character set of "[01]" to make sure autoconf doesn't lose the [] when generating the configure script.) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-03-27XORG_PROG_RAWCPP: Add TRADITIONALCPPFLAGSHans de Goede
In some cases we may want to have -traditional for proper whitespace preserving without -undef, as we actually want the system definitions to be in place so we can #ifdef on them. IE in xinit various .cpp files contain things like #ifdef __APPLE__ and #ifdef __linux__ So this patch adds a TRADITIONALCPPFLAGS variable which contains just -traditional where applicable without the other RAWCPPFLAGS for unsetting the system definitions. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2014-02-08Add XORG_WITH_M4 macroArnaud Fontaine
Originally from XCB, this macro checks for the presence of m4 or gm4 which supports -I dir. The AC_PATH_PROGS_FEATURE_CHECK autoconf macro requires autoconf 2.62. Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2013-12-06XORG_COMPILER_FLAGS: Add -Wlogical-op to default warning setAlan Coopersmith
We've fixed several bugs it uncovered already, only one warning left that it adds in a default build. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2013-12-03XORG_TESTSET_CFLAG: add -fd which is the SUNCC -Wold-style-definitionGaetan Nadon
Seen in the XCB configuration and found missing in xorg. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2013-12-02XORG_WITH_DOXYGEN: check for the dot graphics utilityGaetan Nadon
It is part of the graphviz package and it may be used by doxygen if the HAVE_DOT is set to "yes" in the doxygen configuration file. The calling module handles if the tool is mandatory or not. Doxygen will work fine without it, but no fancy graphics. Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2013-12-02CWARNFLAGS: comment out -Wcast-qualGaetan Nadon
On a full X build, this warning accounts for the 5,888 warnings on a total of 12,042. The line is moved to the "noisy" section of warnings. There is a discussion about the pros and cons here: http://lists.x.org/archives/xorg-devel/2013-November/039069.html Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2013-10-12xorg-macros.m4.in: use the autoconf cache for XORG_CHECK_MALLOC_ZERORoss Burton
Improve configure speed by checking the autoconf cache before compiling and running the test. As this means cross-compilation environments can trivially seed this cache as appropriate, remove the cross-compiling value (which for embedded systems using uclibc is wrong). Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2013-09-12Revert "Interleaved C code and declarations is no longer a portability issue."Bart Massey
This reverts commit 689ea0ec5d8b7594ba2fa9e27b2458cea8a58724. Community consensus is that, while this style is no longer a portability issue, it's a style issue.
2013-09-11Interleaved C code and declarations is no longer a portability issue.Arnaud Fontaine
This was only supported from GCC 3.0 and OpenBSD was still using GCC 2.95 until recently. Signed-off-by: Arnaud Fontaine <arnau@debian.org>
2013-09-06Strip trailing whitespaceAlan Coopersmith
sed -i 's/[[:space:]]*$//' * Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-26Use the right variable names for the compiler flags in XORG_TESTSET_CFLAGChris Wilson
Whilst populating the xorg_cv_ cache entries, and the subsequent xorg_testset_, we always include the FLAG_PREFIX in the name, to distinguish between C and C++ iterations. However, in the body of the test function, we dropped the FLAG_PREFIX expansion and so always used the empty string and hence did not correctly detect incorrect flags. The bug was introduced with commit 51f69514e65637f575df901ef942515e70314f6a Author: Chase Douglas <chase.douglas@canonical.com> Date: Mon Mar 12 11:49:28 2012 -0700 Separate unknown warning options by language Reported-and-tested-by: Sedat Dilek <sedat.dilek@gmail.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Sedat Dilek <sedat.dilek@gmail.com> Cc: Chase Douglas <chase.douglas@canonical.com> Cc: Gaetan Nadon<memsize@videotron.ca> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-04-04Fix spacing in XORG_TESTSET_CFLAGYaakov Selkowitz
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2012-03-12Separate unknown warning options by languageChase Douglas
If XORG_COMPILER_FLAGS is called more than once with separate languages, the unknown warning options used internally for unknown warning checking will be set the first time and then the cached value will be used for subsequent languages. This is a problem if the compilers differ between the languages. This change ensures that the unknown warning options are namespaced so multiple XORG_COMPILER_FLAGS calls with different languages are checked separately. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Gaetan Nadon<memsize@videotron.ca>
2012-03-12Fix cflag test compiler message and cache idsChase Douglas
When the language is C++, the flag checking message references $CC instead of $CXX. The cache id is also xorg_cv_cc_* instead of xorg_cv_cxx_*. This change fixes both issues. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Gaetan Nadon<memsize@videotron.ca>
2012-03-12Don't use AS_ECHO in XORG_TESTSET_CFLAGJon TURNEY
Further to commit 52ef6f6, since AS_ECHO isn't supported in autoconf 2.61 either, rewrite use of cache variable in XORG_TESTSET_CFLAG so 'echo' isn't needed at all. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Gaetan Nadon<memsize@videotron.ca> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-03-12Add XORG_ENABLE_INTEGRATION_TESTSChase Douglas
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" Unit test support usually requires less dependencies and may be built and run under less stringent environments than integration tests. Thus, two separate options for unit and integration testing is desirable. Copied from XORG_ENABLE_UNIT_TESTS. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Gaetan Nadon<memsize@videotron.ca>
2012-03-01Define BASE_CXXFLAGS when C++ is the chosen languageChase Douglas
You can use this functionality by setting the language to C++ before calling XORG_DEFAULT_OPTIONS. This can accomplished with AC_LANG(C++). Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2012-03-01Make XORG_TESTSET_CFLAG work for multiple languagesChase Douglas
Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Gaetan Nadon<memsize@videotron.ca>
2012-02-19Use AS_ECHO rather than AS_ECHO_N in XORG_TESTSET_CFLAGJon TURNEY
The AS_ECHO_N macro was only introduced in autoconf 2.62. Backticks remove trailing newlines, so we don't need to use echo -n Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2012-01-22Cache the results of checking compiler flag support in XORG_TESTSET_CFLAGJon TURNEY
Since checking all those warning flags takes an amount of time I find irritating, here is an attempt at caching the results of checking compiler warning flag support A couple of aspects which need definitely need review or testing: * I've tried to get things right when not the first flag in the list of alternates is supported, but this really needs testing with a compiler other than gcc * The cache variable naming policy is a bit opaque me, so the names used may need corecting * I've tried to be careful, but who knows what portability sins I have committed :-) This change reduces the time to run the ./configure script produced from a configure.ac containing just AC_INIT([test], 1.0) XORG_COMPILER_FLAGS XORG_CWARNFLAGS XORG_STRICT_OPTION AC_OUTPUT() from ~60s to ~20s on my cygwin machine, and from ~15s to ~9s on a linux VM running on the same hardware v2: AS_TR_SH transforms characters which are invalid in shell variable names, so we don't have to use sed to transform spaces ourself Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-12-29Provide a configure option to turn off the selective -Werror=... CFLAGSJeremy Huddleston
Provide end users with a workaround if they find code doesn't build with the -Werror=... flags provided by BASE_CFLAGS. This can be useful if newer util-macros are used with older source code that had problems, or in the rare case when warnings are expanded to hit more cases (although this case should not happen too much in practice). Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-10Remove -Winline from BASE_CFLAGSJeremy Huddleston
This might be useful for performance tuning builds against specific compilers, but it is a bit too noisy to be used in general. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-01XORG_TESTSET_CFLAG: Try to both compile & link with the flagsAlan Coopersmith
Catches build problems caused by compilers that ignore unknown flags at compile time and pass them to the linker at link time, when the linker considers unknown flags to be fatal errors. Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-11-11XORG_TESTSET_CFLAG: Add support fot -Werror=unused-command-line-argumentJeremy Huddleston
This warning was was added to clang in r144365 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-07Add XORG_MEMORY_CHECK_FLAGS and require it in XORG_ENABLE_UNIT_TESTSAlan Coopersmith
Based on the checks already in libXt/configure.ac and proposed for xserver/configure.ac - makes a common implementation before we make more copies. Callers should be able to just add TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) If built with an older xorg-macros, then the tests will simply be less stringent, matching what happens on platforms without any simple malloc debugging facilities available. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-07Define __wrap_exit in test program source for XORG_LD_WRAPAlan Coopersmith
Otherwise the test fails on Solaris releases that actually have support for ld -wrap because the linker instead returns an error that __wrap_exit is an undefined symbol. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-07Add an optional argument to XORG_LD_WRAPAlan Coopersmith
Allows specifying if ld -wrap support is 'required' or 'optional' for unit tests, so that builds like the xserver which only need ld -wrap for some tests can allow users to enable the others when ld -wrap is not available. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-06Add additional flags to XORG_COMPILER_FLAGSJeremy Huddleston
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-06Update XORG_CWARNFLAGS to use XORG_COMPILER_FLAGSJeremy Huddleston
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-06Add XORG_COMPILER_FLAGS to replace XORG_CWARNFLAGSJeremy Huddleston
See: https://bugs.freedesktop.org/show_bug.cgi?id=31238 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-06Use XORG_TESTSET_CFLAG in XORG_STRICT_OPTIONJeremy Huddleston
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-06Add XORG_TESTSET_CFLAG which can be used to test what flags the compiler ↵Jeremy Huddleston
supports Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-11-06Fix the test for -Werror=attributesJeremy Huddleston
The current test was always failing to compile because 'return 0;' was global rather than in the body of a function. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-06-22XORG_WITH_XSLTPROC: warn at development time rather than config timeGaetan Nadon
Catching up unimplemented features should be done earlier by the developer during autoconf rather than during configure. Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-06-22Add XORG_WITH_PERL macroGaetan Nadon
Following the same pattern as XMLTO and friends. Allows all modules to use the same interface, variables and options to check for perl. Perl is used in libX11 and xserver. Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-06-22XORG_WITH_FOP: add minimum version checking supportGaetan Nadon
Adding this feature is motivated by a bug in fop 0.95 where fop crashes in the presence of some characters like the latin capital sharp s. Fop version 1.0 works correctly. This is the same feature found in XMLTO and the likes. In the macro public interface there is a shift in parameter position for the DEFAULT parameter. Doing development on older libraries (point releases on older versions) will still work the same way as the "no" value will be interpreted as the minimum version. It won't be found, so fop will be disabled anyway. Only libX11 has used XORG_WITH_FOP(no) and will be changed with a version bump on util-macros. Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-06-05XORG_PROG_RAWCPP: use AC_LANG_SOURCE to prevent warningsGaetan Nadon
The source for the AC_LANG_CONFTEST should be passed to AC_LANG_SOURCE to satisfy the more stringent testing done by autoconf 2.68. It is available in autoconf 2.60 where AC_LANG_DEFINES_PROVIDED is not. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-05-14Add AC_LANG_DEFINES_PROVIDED to XORG_RAW_CPP to silence autoconf warningsAlan Coopersmith
Since we're intentionally doing a special case to just check cpp output, and not a full program compilation, add the magic macro to silence: configure.ac:46: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body ../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from... aclocal.m4:1077: XORG_PROG_RAWCPP is expanded from... configure.ac:46: the top level Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-05-06XORG_STRICT_OPTION: add -Werror=attributes to STRICT_CFLAGS for gccAlan Coopersmith
Flags unknown attributes as errors, if -Werror=attributes is supported. (The -Werror=* option was first spotted in gcc 4.2.0 manuals.) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-02Make XORG_STRICT_OPTION always set STRICT_CFLAGSAlan Coopersmith
Still only adds it to CWARNFLAGS if --enable-strict-compilation is passed, but sets the variable with the right flags for the compiler so it's available for other checks in configure scripts. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-05-01Create XORG_COMPILER_BRAND macro to centralize compiler checksAlan Coopersmith
Check for gcc vs. intel vs. sun in one place, instead of continuing to grow more places the check is replicated. Add clang check here too, as it's now seeing a lot of use to build X. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>