summaryrefslogtreecommitdiff
path: root/Lib/plat-linux/regen
blob: 10633cbc9a9f1ce14e489f5f8ccb469024a466e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /bin/sh
case `uname` in
Linux*|GNU*)	;;
*)	echo Probably not on a Linux system 1>&2
	exit 1;;
esac
if [ -z "$CC" ]; then
    echo >&2 "$(basename $0): CC is not set"
    exit 1
fi
headers="sys/types.h netinet/in.h dlfcn.h"
incdirs="$(echo $($CC -v -E - < /dev/null 2>&1|awk '/^#include/, /^End of search/' | grep '^ '))"
if [ -z "$incdirs" ]; then
    incdirs="/usr/include"
fi
for h in $headers; do
    absh=
    for d in $incdirs; do
	if [ -f "$d/$h" ]; then
	    absh="$d/$h"
	    break
	fi
    done
    if [ -n "$absh" ]; then
	absheaders="$absheaders $absh"
    else
	echo >&2 "$(basename $0): header $h not found"
	exit 1
    fi
done

set -x
${H2PY:-h2py} -i '(u_long)' $absheaders