summaryrefslogtreecommitdiffstats
path: root/Modules/_ctypes
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2006-04-26 19:20:26 (GMT)
committerHye-Shik Chang <hyeshik@gmail.com>2006-04-26 19:20:26 (GMT)
commitf4795c82df655d421f851cc3700538e04fe1a3f4 (patch)
tree38a4aa0ae80d680f34566469df4eacf777c3e2df /Modules/_ctypes
parentb5ccd1416e19773f541256480a014a847bfc53f9 (diff)
downloadcpython-f4795c82df655d421f851cc3700538e04fe1a3f4.zip
cpython-f4795c82df655d421f851cc3700538e04fe1a3f4.tar.gz
cpython-f4795c82df655d421f851cc3700538e04fe1a3f4.tar.bz2
Fix build on MIPS for libffi. I haven't tested this yet because I
don't have an access on MIPS machines. Will be tested by buildbot. :)
Diffstat (limited to 'Modules/_ctypes')
-rwxr-xr-xModules/_ctypes/libffi/configure6
-rw-r--r--Modules/_ctypes/libffi/configure.ac7
-rw-r--r--Modules/_ctypes/libffi/fficonfig.py.in2
3 files changed, 13 insertions, 2 deletions
diff --git a/Modules/_ctypes/libffi/configure b/Modules/_ctypes/libffi/configure
index c1e5cd4..27abbec 100755
--- a/Modules/_ctypes/libffi/configure
+++ b/Modules/_ctypes/libffi/configure
@@ -310,7 +310,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC ac_ct_CC EXEEXT OBJEXT CFLAGS CPP CPPFLAGS EGREP ALLOCA HAVE_LONG_DOUBLE TARGET TARGETDIR LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC ac_ct_CC EXEEXT OBJEXT CFLAGS CPP CPPFLAGS EGREP ALLOCA HAVE_LONG_DOUBLE TARGET TARGETDIR MKTARGET LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -3534,6 +3534,8 @@ echo "$as_me: error: \"libffi has not been ported to $host.\"" >&2;}
{ (exit 1); exit 1; }; }
fi
+MKTARGET=$TARGET
+
case x$TARGET in
xMIPS*) TARGET=MIPS ;;
*) ;;
@@ -5457,6 +5459,7 @@ fi
+
cat >>confdefs.h <<\_ACEOF
#define FFI_NO_RAW_API 1
_ACEOF
@@ -6129,6 +6132,7 @@ s,@ALLOCA@,$ALLOCA,;t t
s,@HAVE_LONG_DOUBLE@,$HAVE_LONG_DOUBLE,;t t
s,@TARGET@,$TARGET,;t t
s,@TARGETDIR@,$TARGETDIR,;t t
+s,@MKTARGET@,$MKTARGET,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
diff --git a/Modules/_ctypes/libffi/configure.ac b/Modules/_ctypes/libffi/configure.ac
index c7f05d6..6dafe35 100644
--- a/Modules/_ctypes/libffi/configure.ac
+++ b/Modules/_ctypes/libffi/configure.ac
@@ -70,6 +70,12 @@ if test $TARGETDIR = unknown; then
AC_MSG_ERROR(["libffi has not been ported to $host."])
fi
+dnl libffi changes TARGET for MIPS to define a such macro in the header
+dnl while MIPS_IRIX or MIPS_LINUX is separatedly used to decide which
+dnl files will be compiled. So, we need to keep the original decision
+dnl of TARGET to use in fficonfig.py.in.
+MKTARGET=$TARGET
+
case x$TARGET in
xMIPS*) TARGET=MIPS ;;
*) ;;
@@ -183,6 +189,7 @@ AH_BOTTOM([
AC_SUBST(TARGET)
AC_SUBST(TARGETDIR)
+AC_SUBST(MKTARGET)
AC_SUBST(SHELL)
diff --git a/Modules/_ctypes/libffi/fficonfig.py.in b/Modules/_ctypes/libffi/fficonfig.py.in
index 5e53c6d..89f7969 100644
--- a/Modules/_ctypes/libffi/fficonfig.py.in
+++ b/Modules/_ctypes/libffi/fficonfig.py.in
@@ -27,7 +27,7 @@ ffi_platforms = {
}
ffi_srcdir = '@srcdir@'
-ffi_sources += ffi_platforms['@TARGET@']
+ffi_sources += ffi_platforms['@MKTARGET@']
ffi_sources = [os.path.join('@srcdir@', f) for f in ffi_sources]
ffi_cflags = '@CFLAGS@'