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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
#! /bin/sh -e
# DP: Always build the dl module. Failure in case of
# DP: sizeof(int)!=sizeof(long)!=sizeof(void*)
# DP: is delayed until dl.open is called.
dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
pdir="-d $3"
dir="$3/"
elif [ $# -ne 1 ]; then
echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
exit 1
fi
case "$1" in
-patch)
patch $pdir -f --no-backup-if-mismatch -p0 < $0
#cd ${dir}gcc && autoconf
;;
-unpatch)
patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
#rm ${dir}gcc/configure
;;
*)
echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
exit 1
esac
exit 0
--- setup.py~ Mon Apr 1 16:05:12 2002
+++ setup.py Mon Apr 1 16:27:02 2002
@@ -223,6 +223,10 @@
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
+ try:
+ exts.append( Extension('dl', ['dlmodule.c']) )
+ except SystemError:
+ pass
#
# The following modules are all pretty straightforward, and compile
diff -u -r2.18 -r2.19
--- Modules/dlmodule.c 2001/12/08 18:02:56 2.18
+++ Modules/dlmodule.c 2002/01/01 20:18:30 2.19
@@ -158,6 +158,13 @@
char *name;
int mode;
PyUnivPtr *handle;
+ if (sizeof(int) != sizeof(long) ||
+ sizeof(long) != sizeof(char *)) {
+ PyErr_SetString(PyExc_SystemError,
+ "module dl requires sizeof(int) == sizeof(long) == sizeof(char*)");
+ return NULL;
+ }
+
if (PyArg_Parse(args, "z", &name))
mode = RTLD_LAZY;
else {
@@ -203,13 +210,6 @@
initdl(void)
{
PyObject *m, *d, *x;
-
- if (sizeof(int) != sizeof(long) ||
- sizeof(long) != sizeof(char *)) {
- PyErr_SetString(PyExc_SystemError,
- "module dl requires sizeof(int) == sizeof(long) == sizeof(char*)");
- return;
- }
/* Initialize object type */
Dltype.ob_type = &PyType_Type;
|