diff options
author | Pádraig Brady <P@draigBrady.com> | 2014-05-10 04:53:29 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2014-05-21 18:29:38 +0100 |
commit | 1ab31d1ec1635ae0764604a8bf61e11851a63a45 (patch) | |
tree | 54b5f8dccbde4e512a394ff8b42e6635209ea573 /cfg.mk | |
parent | 7a63d6395ac117b753a18468a9b3f5ed95d176d4 (diff) | |
download | coreutils-1ab31d1ec1635ae0764604a8bf61e11851a63a45.tar.xz |
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.
Diffstat (limited to 'cfg.mk')
-rw-r--r-- | cfg.mk | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -229,10 +229,10 @@ sc_prohibit-j-printf-format: # directly use attributes already defined by gnulib. # TODO: move the check for _GL... attributes to gnulib. sc_prohibit-gl-attributes: - @cd $(srcdir) && GIT_PAGER= git grep -En \ - "__attribute |__(unused|pure|const)__" src gl/lib/*.[ch] \ - && { echo '$(ME): Use _GL... attribute macros' 1>&2; exit 1; } \ - || : + @prohibit='__attribute |__(unused|pure|const)__' \ + in_vc_files='\.[ch]$$' \ + halt='Use _GL... attribute macros' \ + $(_sc_search_regexp) # Look for lines longer than 80 characters, except omit: # - program-generated long lines in diff headers, @@ -647,6 +647,9 @@ exclude_file_name_regexp--sc_prohibit_operator_at_end_of_line = \ exclude_file_name_regexp--sc_error_message_uppercase = ^src/factor\.c$$ exclude_file_name_regexp--sc_prohibit_atoi_atof = ^src/make-prime-list\.c$$ +# Exception here as we don't want __attribute elided on non GCC +exclude_file_name_regexp--sc_prohibit-gl-attributes = ^src/libstdbuf\.c$$ + # Augment AM_CFLAGS to include our per-directory options: AM_CFLAGS += $($(@D)_CFLAGS) |