]> git.ipfire.org Git - thirdparty/util-linux.git/blame - tools/checkdecl.sh
build-sys: release++ (v2.29.2)
[thirdparty/util-linux.git] / tools / checkdecl.sh
CommitLineData
b5c6f486
KZ
1#!/bin/sh
2
3#
4# This script checkd for #ifdef HAVE_DECL_SYMBOL in code.
5#
6# Autoconf docs:
7#
8# Unlike the other autoconf ‘AC_CHECK_*S’ macros, when a symbol is not
9# declared, HAVE_DECL_symbol is defined to ‘0’ instead of leaving
10# HAVE_DECL_symbol undeclared. When you are sure that the check was performed,
11# use HAVE_DECL_symbol in #if.
12#
13
14if [ ! -f ./configure ]; then
15 echo "Not found configure script"
16 exit 1
17fi
18
19for decl in $(awk '/HAVE_DECL_.*ac_have_decl/ { print $2 }' configure); do
20 git grep -nE '[[:blank:]]*#[[:blank:]]*if(ndef|def)[[:blank:]]*'$decl;
21done | sort -u