enable errno to work, even if gcc is not installed

This commit is contained in:
Dustin Kirkland 2010-08-10 12:02:20 -04:00
parent 6f4c4b031f
commit 05f268065b

8
errno
View File

@ -17,8 +17,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Header finding trick from Kees Cook <kees@ubuntu.com>
headers=$(echo "#include <asm/errno.h>" | gcc -E - | grep "\.h" | awk -F\" '{print $2}' | sort -u)
if $(which gcc >/dev/null); then
# Header finding trick from Kees Cook <kees@ubuntu.com>
headers=$(echo "#include <asm/errno.h>" | gcc -E - | grep "\.h" | awk -F\" '{print $2}' | sort -u)
else
headers="/usr/include/asm-generic/errno*.h"
fi
if echo "$code" | egrep -qs "^[0-9]+$"; then
# Input is a number, search for a particular matching code