Mercurial > cpython-lru_cache-weakref
view Modules/_ctypes/libffi.diff @ 73323:dad02a080bbc
Improve byte-compilation in packaging to be independent of -O or -B.
The code I fixed to comply with PEP 3147 still had one bug: When run
under python -O, some paths for pyc files would be pyo, because I called
imp.cache_from_source without explicit debug_override argument in some
places, and under -O that would return .pyo (this is well explained in
the imp docs). Now all code (util.byte_compile, build_py, install_lib)
can create .pyo files according to options given by users,
without interference from the calling Python’s own optimize mode.
On a related topic, I also removed the code that prevented byte
compilation under python -B. The rationale is that packaging gives
control over the creation of pyc files to the user with its own explicit
option, and the behavior should not be changed if the calling Python
happens to run with -B for whatever reason. I will argue that this is a
bug fix and ask to be allowed to backport this change to distutils.
Finally, I moved one nugget of information about the --compile and
--optimize options from the source into the doc. It clears up a
misunderstanding that I (and maybe other people) had.
| author | Éric Araujo <merwok@netwok.org> |
|---|---|
| date | Thu, 03 Nov 2011 05:08:28 +0100 |
| parents | 2b1b0379718b |
| children | b10ec5083a53 25421e1c48bb |
line wrap: on
line source
diff -urN libffi.orig/configure libffi/configure --- libffi.orig/configure 2010-03-19 18:29:54.588499862 +0100 +++ libffi/configure 2010-03-19 18:32:09.113499479 +0100 @@ -11228,6 +11228,9 @@ i?86-*-solaris2.1[0-9]*) TARGET=X86_64; TARGETDIR=x86 ;; + i*86-*-nto-qnx*) + TARGET=X86; TARGETDIR=x86 + ;; i?86-*-*) TARGET=X86; TARGETDIR=x86 ;; @@ -11245,12 +11248,12 @@ ;; mips-sgi-irix5.* | mips-sgi-irix6.*) - TARGET=MIPS; TARGETDIR=mips + TARGET=MIPS_IRIX; TARGETDIR=mips ;; mips*-*-linux*) # Support 128-bit long double for NewABI. HAVE_LONG_DOUBLE='defined(__mips64)' - TARGET=MIPS; TARGETDIR=mips + TARGET=MIPS_IRIX; TARGETDIR=mips ;; powerpc*-*-linux* | powerpc-*-sysv*) @@ -11307,7 +11310,7 @@ as_fn_error "\"libffi has not been ported to $host.\"" "$LINENO" 5 fi - if test x$TARGET = xMIPS; then + if expr x$TARGET : 'xMIPS' > /dev/null; then MIPS_TRUE= MIPS_FALSE='#' else @@ -12422,6 +12425,12 @@ ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc" +ac_config_links="$ac_config_links include/ffi_common.h:include/ffi_common.h" + + +ac_config_files="$ac_config_files fficonfig.py" + + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -13521,6 +13530,8 @@ "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;; + "include/ffi_common.h") CONFIG_LINKS="$CONFIG_LINKS include/ffi_common.h:include/ffi_common.h" ;; + "fficonfig.py") CONFIG_FILES="$CONFIG_FILES fficonfig.py" ;; *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff -urN libffi.orig/configure.ac libffi/configure.ac --- libffi.orig/configure.ac 2010-03-19 18:27:44.988498585 +0100 +++ libffi/configure.ac 2010-03-19 18:31:29.252505178 +0100 @@ -1,4 +1,7 @@ dnl Process this with autoconf to create configure +# +# file from libffi - slightly patched for ctypes +# AC_PREREQ(2.63) @@ -91,6 +94,9 @@ i?86-*-solaris2.1[[0-9]]*) TARGET=X86_64; TARGETDIR=x86 ;; + i*86-*-nto-qnx*) + TARGET=X86; TARGETDIR=x86 + ;; i?86-*-*) TARGET=X86; TARGETDIR=x86 ;; @@ -108,12 +114,12 @@ ;; mips-sgi-irix5.* | mips-sgi-irix6.*) - TARGET=MIPS; TARGETDIR=mips + TARGET=MIPS_IRIX; TARGETDIR=mips ;; mips*-*-linux*) # Support 128-bit long double for NewABI. HAVE_LONG_DOUBLE='defined(__mips64)' - TARGET=MIPS; TARGETDIR=mips + TARGET=MIPS_IRIX; TARGETDIR=mips ;; powerpc*-*-linux* | powerpc-*-sysv*) @@ -170,7 +176,7 @@ AC_MSG_ERROR(["libffi has not been ported to $host."]) fi -AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS) +AM_CONDITIONAL(MIPS,[expr x$TARGET : 'xMIPS' > /dev/null]) AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC) AM_CONDITIONAL(X86, test x$TARGET = xX86) AM_CONDITIONAL(X86_FREEBSD, test x$TARGET = xX86_FREEBSD) @@ -401,4 +407,8 @@ AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc) +AC_CONFIG_LINKS(include/ffi_common.h:include/ffi_common.h) + +AC_CONFIG_FILES(fficonfig.py) + AC_OUTPUT
