diff --git a/.gitignore b/.gitignore index 215d7f526f465c..2743e2468752a0 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,7 @@ Modules/Setup.config Modules/Setup.local Modules/config.c Modules/ld_so_aix +Modules/expat/expat_config.h Programs/_freeze_importlib Programs/_freeze_importlib.exe Programs/_testembed diff --git a/Misc/NEWS.d/next/Build/2017-09-14-11-34-13.bpo-31374.VFnngi.rst b/Misc/NEWS.d/next/Build/2017-09-14-11-34-13.bpo-31374.VFnngi.rst new file mode 100644 index 00000000000000..82a78bb7dc69d6 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2017-09-14-11-34-13.bpo-31374.VFnngi.rst @@ -0,0 +1,2 @@ +Generate expat_config.h with autoconf. This fixes a build warning in Python's +copy of expat library. diff --git a/Modules/expat/expat_config.h b/Modules/expat/expat_config.h.in similarity index 71% rename from Modules/expat/expat_config.h rename to Modules/expat/expat_config.h.in index afbedd011f660f..58e3080a4717d9 100644 --- a/Modules/expat/expat_config.h +++ b/Modules/expat/expat_config.h.in @@ -5,12 +5,8 @@ #ifndef EXPAT_CONFIG_H #define EXPAT_CONFIG_H -#include -#ifdef WORDS_BIGENDIAN -#define BYTEORDER 4321 -#else -#define BYTEORDER 1234 -#endif +#define BYTEORDER @BYTEORDER@ +@DEFINE_HAVE_MEMMOVE@ #define HAVE_MEMMOVE 1 diff --git a/configure b/configure index 8d3336387c34ba..a87683d1260f24 100755 --- a/configure +++ b/configure @@ -633,6 +633,8 @@ LIBPL PY_ENABLE_SHARED EXT_SUFFIX SOABI +DEFINE_HAVE_MEMMOVE +BYTEORDER LIBC LIBM HAVE_GETHOSTBYNAME @@ -782,7 +784,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -894,7 +895,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1147,15 +1147,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1293,7 +1284,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1446,7 +1437,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -14905,6 +14895,37 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h esac +# Stuff for expat. +case "$ac_cv_c_bigendian" in + yes) + BYTEORDER=4321 + ;; + no) + BYTEORDER=1234 + ;; + *) + as_fn_error $? "unknown endianness $ac_cv_c_bigendian" "$LINENO" 5 + ;; +esac + + +for ac_func in memmove +do : + ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove" +if test "x$ac_cv_func_memmove" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MEMMOVE 1 +_ACEOF + DEFINE_HAVE_MEMMOVE='#define HAVE_MEMMOVE 1' +else + DEFINE_HAVE_MEMMOVE='#undef HAVE_MEMMOVE' +fi +done + + +ac_config_files="$ac_config_files Modules/expat/expat_config.h" + + # ABI version string for Python extension modules. This appears between the # periods in shared library file names, e.g. foo..so. It is calculated # from the following attributes which affect the ABI of this Python build (in @@ -17719,6 +17740,7 @@ do "Mac/PythonLauncher/Makefile") CONFIG_FILES="$CONFIG_FILES Mac/PythonLauncher/Makefile" ;; "Mac/Resources/framework/Info.plist") CONFIG_FILES="$CONFIG_FILES Mac/Resources/framework/Info.plist" ;; "Mac/Resources/app/Info.plist") CONFIG_FILES="$CONFIG_FILES Mac/Resources/app/Info.plist" ;; + "Modules/expat/expat_config.h") CONFIG_FILES="$CONFIG_FILES Modules/expat/expat_config.h" ;; "Makefile.pre") CONFIG_FILES="$CONFIG_FILES Makefile.pre" ;; "Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc" ;; "Misc/python-config.sh") CONFIG_FILES="$CONFIG_FILES Misc/python-config.sh" ;; diff --git a/configure.ac b/configure.ac index 5c1c0219208737..83061609e5a67b 100644 --- a/configure.ac +++ b/configure.ac @@ -4536,6 +4536,27 @@ fi # check for endianness AC_C_BIGENDIAN +# Stuff for expat. +case "$ac_cv_c_bigendian" in + yes) + BYTEORDER=4321 + ;; + no) + BYTEORDER=1234 + ;; + *) + AC_MSG_ERROR([unknown endianness $ac_cv_c_bigendian]) + ;; +esac +AC_SUBST([BYTEORDER]) + +AC_CHECK_FUNCS(memmove, + [DEFINE_HAVE_MEMMOVE='#define HAVE_MEMMOVE 1'], + [DEFINE_HAVE_MEMMOVE='#undef HAVE_MEMMOVE'], +) +AC_SUBST([DEFINE_HAVE_MEMMOVE]) +AC_CONFIG_FILES([Modules/expat/expat_config.h]) + # ABI version string for Python extension modules. This appears between the # periods in shared library file names, e.g. foo..so. It is calculated # from the following attributes which affect the ABI of this Python build (in @@ -5502,7 +5523,7 @@ AC_DEFINE(PY_SSL_DEFAULT_CIPHERS, 1) # generate output files -AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-config.sh) +AC_CONFIG_FILES([Makefile.pre Misc/python.pc Misc/python-config.sh]) AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix]) AC_OUTPUT