X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=top%2Fmaint.mk;h=159fe8310e7443ddcaff6765963c7ef9e4cb2143;hb=e98ea566d814c4e7df9f8988a01e4f970a427745;hp=33803f325bd2b8b1904115b92c93e1cbe532a9ab;hpb=8ca073ee3bf9c2ecd10dbfbf39d67b3a25a2a3fd;p=gnulib.git diff --git a/top/maint.mk b/top/maint.mk index 33803f325..159fe8310 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -645,6 +645,28 @@ sc_useless_cpp_parens: halt='found useless parentheses in cpp directive' \ $(_sc_search_regexp) +# List headers for which HAVE_HEADER_H is always true, assuming you are +# using the appropriate gnulib module. CAUTION: for each "unnecessary" +# #if HAVE_HEADER_H that you remove, be sure that your project explicitly +# requires the gnulib module that guarantees the usability of that header. +gl_assured_headers_ := \ + $(shell cd $(gnulib_dir)/lib && ls -1 *.in.h|sed 's/\.in\.h$$/ \\/') + +# Convert the list of names to upper case, and replace each space with "|". +az_ = abcdefghijklmnopqrstuvwxyz +AZ_ = ABCDEFGHIJKLMNOPQRSTUVWXYZ +gl_header_upper_case_or_ := \ + $(shell echo $(gl_assured_headers_) \ + | tr $(az_)/.- $(AZ_)___ \ + | tr -s ' ' '|' \ + ) +gl_have_header_regex_ = HAVE_($(gl_header_upper_case_or_))_H +sc_prohibit_always_true_header_tests: + @prohibit='\<$(gl_have_header_regex_)\>' \ + halt='do not test the above HAVE_
_H symbol(s);\n'\ +' with the corresponding gnulib module, they are always true' \ + $(_sc_search_regexp) + # Prohibit checked in backup files. sc_prohibit_backup_files: @$(VC_LIST) | grep '~$$' && \