Anonymous avatar Anonymous committed 7c222ce

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. :)

Comments (0)

Files changed (4)

 
 - Patch #1429775: Link extension modules with the shared libpython.
 
+- Fixed a libffi build problem on MIPS systems.
+
 C API
 -----
 

Modules/_ctypes/libffi/configure

 # 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.
    { (exit 1); exit 1; }; }
 fi
 
+MKTARGET=$TARGET
+
 case x$TARGET in
   xMIPS*) TARGET=MIPS ;;
   *) ;;
 
 
 
+
 cat >>confdefs.h <<\_ACEOF
 #define FFI_NO_RAW_API 1
 _ACEOF
 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

Modules/_ctypes/libffi/configure.ac

   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 ;;
   *) ;;
 
 AC_SUBST(TARGET)
 AC_SUBST(TARGETDIR)
+AC_SUBST(MKTARGET)
 
 AC_SUBST(SHELL)
 

Modules/_ctypes/libffi/fficonfig.py.in

 }
 
 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@'
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.