X Tutup
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Generate expat_config.h with autoconf. This fixes a build warning in Python's
copy of expat library.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
#ifndef EXPAT_CONFIG_H
#define EXPAT_CONFIG_H

#include <pyconfig.h>
#ifdef WORDS_BIGENDIAN
#define BYTEORDER 4321
#else
#define BYTEORDER 1234
#endif
#define BYTEORDER @BYTEORDER@
@DEFINE_HAVE_MEMMOVE@

#define HAVE_MEMMOVE 1

Expand Down
48 changes: 35 additions & 13 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,8 @@ LIBPL
PY_ENABLE_SHARED
EXT_SUFFIX
SOABI
DEFINE_HAVE_MEMMOVE
BYTEORDER
LIBC
LIBM
HAVE_GETHOSTBYNAME
Expand Down Expand Up @@ -782,7 +784,6 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
Expand Down Expand Up @@ -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}'
Expand Down Expand Up @@ -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=* \
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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.<SOABI>.so. It is calculated
# from the following attributes which affect the ABI of this Python build (in
Expand Down Expand Up @@ -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" ;;
Expand Down
23 changes: 22 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may define AC_CONFIG_FILES([Modules/expat/expat_config.h]) here, to group things specific to Expat at the same place. It seems like AC_CONFIG_FILES() can be called multiple times.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to keep all output files in one place

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.<SOABI>.so. It is calculated
# from the following attributes which affect the ABI of this Python build (in
Expand Down Expand Up @@ -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

Expand Down
X Tutup