blob: 10633cbc9a9f1ce14e489f5f8ccb469024a466e3 [file] [log] [blame]
Guido van Rossum77c29a11996-07-22 21:50:43 +00001#! /bin/sh
2case `uname` in
doko@ubuntu.com55532312016-06-14 08:55:19 +02003Linux*|GNU*) ;;
Guido van Rossum77c29a11996-07-22 21:50:43 +00004*) echo Probably not on a Linux system 1>&2
5 exit 1;;
6esac
doko@ubuntu.com55532312016-06-14 08:55:19 +02007if [ -z "$CC" ]; then
8 echo >&2 "$(basename $0): CC is not set"
9 exit 1
10fi
11headers="sys/types.h netinet/in.h dlfcn.h"
12incdirs="$(echo $($CC -v -E - < /dev/null 2>&1|awk '/^#include/, /^End of search/' | grep '^ '))"
13if [ -z "$incdirs" ]; then
14 incdirs="/usr/include"
15fi
16for h in $headers; do
17 absh=
18 for d in $incdirs; do
19 if [ -f "$d/$h" ]; then
20 absh="$d/$h"
21 break
22 fi
23 done
24 if [ -n "$absh" ]; then
25 absheaders="$absheaders $absh"
26 else
27 echo >&2 "$(basename $0): header $h not found"
28 exit 1
29 fi
30done
31
32set -x
33${H2PY:-h2py} -i '(u_long)' $absheaders