summaryrefslogtreecommitdiffstats
path: root/Lib/plat-linux
diff options
context:
space:
mode:
authordoko@ubuntu.com <doko@ubuntu.com>2016-06-14 06:55:19 (GMT)
committerdoko@ubuntu.com <doko@ubuntu.com>2016-06-14 06:55:19 (GMT)
commit5553231b91e05cf93827b33a79aebe62c4370a09 (patch)
tree954bd7ebb02bc705d1df336f616aedea979ea1b3 /Lib/plat-linux
parentc09087680eb908406d7331323e92a657182c7b89 (diff)
downloadcpython-5553231b91e05cf93827b33a79aebe62c4370a09.zip
cpython-5553231b91e05cf93827b33a79aebe62c4370a09.tar.gz
cpython-5553231b91e05cf93827b33a79aebe62c4370a09.tar.bz2
- Issue #23968: Rename the platform directory from plat-$(MACHDEP) to
plat-$(PLATFORM_TRIPLET). Rename the config directory (LIBPL) from config-$(LDVERSION) to config-$(LDVERSION)-$(PLATFORM_TRIPLET). Install the platform specifc _sysconfigdata module into the platform directory and rename it to include the ABIFLAGS.
Diffstat (limited to 'Lib/plat-linux')
-rwxr-xr-xLib/plat-linux/regen31
1 files changed, 28 insertions, 3 deletions
diff --git a/Lib/plat-linux/regen b/Lib/plat-linux/regen
index c76950e..10633cb 100755
--- a/Lib/plat-linux/regen
+++ b/Lib/plat-linux/regen
@@ -1,8 +1,33 @@
#! /bin/sh
case `uname` in
-Linux*) ;;
+Linux*|GNU*) ;;
*) echo Probably not on a Linux system 1>&2
exit 1;;
esac
-set -v
-h2py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/dlfcn.h
+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