]> git.ipfire.org Git - thirdparty/coreutils.git/commit
stdbuf: support compilers other than __GNUC__
authorPádraig Brady <P@draigBrady.com>
Sat, 10 May 2014 03:53:29 +0000 (04:53 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 21 May 2014 17:29:38 +0000 (18:29 +0100)
commit1ab31d1ec1635ae0764604a8bf61e11851a63a45
tree54b5f8dccbde4e512a394ff8b42e6635209ea573
parent7a63d6395ac117b753a18468a9b3f5ed95d176d4
stdbuf: support compilers other than __GNUC__

__SUNPRO_C >= 0x590 /*12.0*/ supports __attribute((constructor))
required by stdbuf, so use a more direct check for this.

Note ensure that --libexecdir is set to the appropriate
install location for libstdbuf.so so that stdbuf works
when installed on the system like it does when running
tests in the build directory.

* configure.ac (stdbuf_supported): Use a test prog to determine support.
* src/libstdbuf.c (stdbuf): Define appropriately for non GCC compilers,
and provide early feedback (compilation warning) if trying to compile
libstdbuf without the necessary support.
* src/stdbuf.c (set_LD_PRELOAD): Add a note on having stdbuf
look for libstdbuf.so in the default lib search path.
* cfg.mk (sc_prohibit-gl-attributes): Adjust so we can exclude
libstdbuf.so from prohibiting '__attribute', since we want
this form to avoid silently eliding this required attribute on non GCC.

Reported and tested by Rich Burridge.
cfg.mk
configure.ac
src/libstdbuf.c
src/stdbuf.c