Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(23397)

Delta Between Two Patch Sets: configure.ac

Issue 22980: C extension naming doesn't take bitness into account
Left Patch Set: Created 4 years, 7 months ago
Right Patch Set: Created 4 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | Lib/test/test_sysconfig.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 dnl *********************************************** 1 dnl ***********************************************
2 dnl * Please run autoreconf to test your changes! * 2 dnl * Please run autoreconf to test your changes! *
3 dnl *********************************************** 3 dnl ***********************************************
4 4
5 # Set VERSION so we only need to edit in one place (i.e., here) 5 # Set VERSION so we only need to edit in one place (i.e., here)
6 m4_define(PYTHON_VERSION, 3.5) 6 m4_define(PYTHON_VERSION, 3.5)
7 7
8 AC_PREREQ(2.65) 8 AC_PREREQ(2.65)
9 9
10 AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/) 10 AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/)
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 *-*-cygwin*) 418 *-*-cygwin*)
419 _host_cpu= 419 _host_cpu=
420 ;; 420 ;;
421 *) 421 *)
422 # for now, limit cross builds to known configurations 422 # for now, limit cross builds to known configurations
423 MACHDEP="unknown" 423 MACHDEP="unknown"
424 AC_MSG_ERROR([cross build not supported for $host]) 424 AC_MSG_ERROR([cross build not supported for $host])
425 esac 425 esac
426 _PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}" 426 _PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}"
427 fi 427 fi
428 » 428
429 # Some systems cannot stand _XOPEN_SOURCE being defined at all; they 429 # Some systems cannot stand _XOPEN_SOURCE being defined at all; they
430 # disable features if it is defined, without any means to access these 430 # disable features if it is defined, without any means to access these
431 # features as extensions. For these systems, we skip the definition of 431 # features as extensions. For these systems, we skip the definition of
432 # _XOPEN_SOURCE. Before adding a system to the list to gain access to 432 # _XOPEN_SOURCE. Before adding a system to the list to gain access to
433 # some feature, make sure there is no alternative way to access this 433 # some feature, make sure there is no alternative way to access this
434 # feature. Also, when using wildcards, make sure you have verified the 434 # feature. Also, when using wildcards, make sure you have verified the
435 # need for not defining _XOPEN_SOURCE on all systems matching the 435 # need for not defining _XOPEN_SOURCE on all systems matching the
436 # wildcard, and that the wildcard does not include future systems 436 # wildcard, and that the wildcard does not include future systems
437 # (which may remove their limitations). 437 # (which may remove their limitations).
438 dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output 438 dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 # 549 #
550 AC_SUBST(SGI_ABI) 550 AC_SUBST(SGI_ABI)
551 if test ! -z "$SGI_ABI" 551 if test ! -z "$SGI_ABI"
552 then 552 then
553 CC="cc $SGI_ABI" 553 CC="cc $SGI_ABI"
554 LDFLAGS="$SGI_ABI $LDFLAGS" 554 LDFLAGS="$SGI_ABI $LDFLAGS"
555 MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'` 555 MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'`
556 fi 556 fi
557 AC_MSG_RESULT($MACHDEP) 557 AC_MSG_RESULT($MACHDEP)
558 558
559 AC_SUBST(PLATDIR)
560 PLATDIR=plat-$MACHDEP
561
559 # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET, 562 # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
560 # it may influence the way we can build extensions, so distutils 563 # it may influence the way we can build extensions, so distutils
561 # needs to check it 564 # needs to check it
562 AC_SUBST(CONFIGURE_MACOSX_DEPLOYMENT_TARGET) 565 AC_SUBST(CONFIGURE_MACOSX_DEPLOYMENT_TARGET)
563 AC_SUBST(EXPORT_MACOSX_DEPLOYMENT_TARGET) 566 AC_SUBST(EXPORT_MACOSX_DEPLOYMENT_TARGET)
564 CONFIGURE_MACOSX_DEPLOYMENT_TARGET= 567 CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
565 EXPORT_MACOSX_DEPLOYMENT_TARGET='#' 568 EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
566 569
567 # checks for alternative programs 570 # checks for alternative programs
568 571
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 AC_MSG_NOTICE([Using clang from Xcode.app]) 660 AC_MSG_NOTICE([Using clang from Xcode.app])
658 CC="${found_clang}" 661 CC="${found_clang}"
659 CXX="`/usr/bin/xcrun -find clang++`" 662 CXX="`/usr/bin/xcrun -find clang++`"
660 663
661 # else: use default behaviour 664 # else: use default behaviour
662 fi 665 fi
663 fi 666 fi
664 fi 667 fi
665 fi 668 fi
666 AC_PROG_CC 669 AC_PROG_CC
670 AC_PROG_CPP
671 AC_PROG_GREP
667 672
668 AC_SUBST(CXX) 673 AC_SUBST(CXX)
669 AC_SUBST(MAINCC) 674 AC_SUBST(MAINCC)
670 AC_MSG_CHECKING(for --with-cxx-main=<compiler>) 675 AC_MSG_CHECKING(for --with-cxx-main=<compiler>)
671 AC_ARG_WITH(cxx_main, 676 AC_ARG_WITH(cxx_main,
672 AS_HELP_STRING([--with-cxx-main=<compiler>], 677 AS_HELP_STRING([--with-cxx-main=<compiler>],
673 [compile main() and link python executable with C++ c ompiler]), 678 [compile main() and link python executable with C++ c ompiler]),
674 [ 679 [
675 680
676 case $withval in 681 case $withval in
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 if test "$preset_cxx" != "$CXX" 719 if test "$preset_cxx" != "$CXX"
715 then 720 then
716 AC_MSG_NOTICE([ 721 AC_MSG_NOTICE([
717 722
718 By default, distutils will build C++ extension modules with "$CXX". 723 By default, distutils will build C++ extension modules with "$CXX".
719 If this is not intended, then set CXX on the configure command line. 724 If this is not intended, then set CXX on the configure command line.
720 ]) 725 ])
721 fi 726 fi
722 727
723 728
729 MULTIARCH=$($CC --print-multiarch 2>/dev/null)
730 AC_SUBST(MULTIARCH)
731
732 AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
733 cat >> conftest.c <<EOF
734 #undef linux
735 #undef i386
736 #undef unix
737 #if defined(__linux__)
738 # if defined(__x86_64__) && defined(__LP64__)
739 x86_64-linux-gnu
740 # elif defined(__x86_64__) && defined(__ILP32__)
741 x86_64-linux-gnux32
742 # elif defined(__i386__)
743 i386-linux-gnu
744 # elif defined(__aarch64__) && defined(__AARCH64EL__)
745 # if defined(__ILP32__)
746 aarch64_ilp32-linux-gnu
747 # else
748 aarch64-linux-gnu
749 # endif
750 # elif defined(__aarch64__) && defined(__AARCH64EB__)
751 # if defined(__ILP32__)
752 aarch64_be_ilp32-linux-gnu
753 # else
754 aarch64_be-linux-gnu
755 # endif
756 # elif defined(__alpha__)
757 alpha-linux-gnu
758 # elif defined(__ARM_EABI__) && defined(__ARM_PCS_VFP)
759 # if defined(__ARMEL__)
760 arm-linux-gnueabihf
761 # else
762 armeb-linux-gnueabihf
763 # endif
764 # elif defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP)
765 # if defined(__ARMEL__)
766 arm-linux-gnueabi
767 # else
768 armeb-linux-gnueabi
769 # endif
770 # elif defined(__hppa__)
771 hppa-linux-gnu
772 # elif defined(__ia64__)
773 ia64-linux-gnu
774 # elif defined(__m68k__) && !defined(__mcoldfire__)
775 m68k-linux-gnu
776 # elif defined(__mips_hard_float) && defined(_MIPSEL)
777 # if _MIPS_SIM == _ABIO32
778 mipsel-linux-gnu
779 # elif _MIPS_SIM == _ABIN32
780 mips64el-linux-gnuabin32
781 # elif _MIPS_SIM == _ABI64
782 mips64el-linux-gnuabi64
783 # else
784 # error unknown platform triplet
785 # endif
786 # elif defined(__mips_hard_float)
787 # if _MIPS_SIM == _ABIO32
788 mips-linux-gnu
789 # elif _MIPS_SIM == _ABIN32
790 mips64-linux-gnuabin32
791 # elif _MIPS_SIM == _ABI64
792 mips64-linux-gnuabi64
793 # else
794 # error unknown platform triplet
795 # endif
796 # elif defined(__or1k__)
797 or1k-linux-gnu
798 # elif defined(__powerpc__) && defined(__SPE__)
799 powerpc-linux-gnuspe
800 # elif defined(__powerpc64__)
801 # if defined(__LITTLE_ENDIAN__)
802 powerpc64le-linux-gnu
803 # else
804 powerpc64-linux-gnu
805 # endif
806 # elif defined(__powerpc__)
807 powerpc-linux-gnu
808 # elif defined(__s390x__)
809 s390x-linux-gnu
810 # elif defined(__s390__)
811 s390-linux-gnu
812 # elif defined(__sh__) && defined(__LITTLE_ENDIAN__)
813 sh4-linux-gnu
814 # elif defined(__sparc__) && defined(__arch64__)
815 sparc64-linux-gnu
816 # elif defined(__sparc__)
817 sparc-linux-gnu
818 # else
819 # error unknown platform triplet
820 # endif
821 #elif defined(__FreeBSD_kernel__)
822 # if defined(__LP64__)
823 x86_64-kfreebsd-gnu
824 # elif defined(__i386__)
825 i386-kfreebsd-gnu
826 # else
827 # error unknown platform triplet
828 # endif
829 #elif defined(__gnu_hurd__)
830 i386-gnu
831 #else
832 # error unknown platform triplet
833 #endif
834
835 EOF
836
837 if $CPP conftest.c >conftest.out 2>/dev/null; then
838 PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
839 AC_MSG_RESULT([$PLATFORM_TRIPLET])
840 else
841 AC_MSG_RESULT([none])
842 fi
843 rm -f conftest.c conftest.out
844
845 if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
846 if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
847 AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
848 fi
849 fi
850 PLATDIR=plat-$MACHDEP
851 AC_SUBST(PLATDIR)
852 AC_SUBST(PLATFORM_TRIPLET)
853
854
724 AC_MSG_CHECKING([for -Wl,--no-as-needed]) 855 AC_MSG_CHECKING([for -Wl,--no-as-needed])
725 save_LDFLAGS="$LDFLAGS" 856 save_LDFLAGS="$LDFLAGS"
726 LDFLAGS="$LDFLAGS -Wl,--no-as-needed" 857 LDFLAGS="$LDFLAGS -Wl,--no-as-needed"
727 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], 858 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
728 [NO_AS_NEEDED="-Wl,--no-as-needed" 859 [NO_AS_NEEDED="-Wl,--no-as-needed"
729 AC_MSG_RESULT([yes])], 860 AC_MSG_RESULT([yes])],
730 [NO_AS_NEEDED="" 861 [NO_AS_NEEDED=""
731 AC_MSG_RESULT([no])]) 862 AC_MSG_RESULT([no])])
732 LDFLAGS="$save_LDFLAGS" 863 LDFLAGS="$save_LDFLAGS"
733 AC_SUBST(NO_AS_NEEDED) 864 AC_SUBST(NO_AS_NEEDED)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 gcc) CC="$CC -D_HAVE_BSDI";; 911 gcc) CC="$CC -D_HAVE_BSDI";;
781 esac;; 912 esac;;
782 esac 913 esac
783 914
784 case $ac_sys_system in 915 case $ac_sys_system in
785 hp*|HP*) 916 hp*|HP*)
786 case $CC in 917 case $CC in
787 cc|*/cc) CC="$CC -Ae";; 918 cc|*/cc) CC="$CC -Ae";;
788 esac;; 919 esac;;
789 esac 920 esac
790
791 MULTIARCH=$($CC --print-multiarch 2>/dev/null)
792 AC_SUBST(MULTIARCH)
793
794 921
795 AC_SUBST(LIBRARY) 922 AC_SUBST(LIBRARY)
796 AC_MSG_CHECKING(LIBRARY) 923 AC_MSG_CHECKING(LIBRARY)
797 if test -z "$LIBRARY" 924 if test -z "$LIBRARY"
798 then 925 then
799 LIBRARY='libpython$(VERSION)$(ABIFLAGS).a' 926 LIBRARY='libpython$(VERSION)$(ABIFLAGS).a'
800 fi 927 fi
801 AC_MSG_RESULT($LIBRARY) 928 AC_MSG_RESULT($LIBRARY)
802 929
803 # LDLIBRARY is the name of the library to link against (as opposed to the 930 # LDLIBRARY is the name of the library to link against (as opposed to the
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 INSTSONAME="$LDLIBRARY".$SOVERSION 1080 INSTSONAME="$LDLIBRARY".$SOVERSION
954 if test "$with_pydebug" != yes 1081 if test "$with_pydebug" != yes
955 then 1082 then
956 PY3LIBRARY=libpython3.so 1083 PY3LIBRARY=libpython3.so
957 fi 1084 fi
958 ;; 1085 ;;
959 Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) 1086 Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
960 LDLIBRARY='libpython$(LDVERSION).so' 1087 LDLIBRARY='libpython$(LDVERSION).so'
961 BLDLIBRARY='-L. -lpython$(LDVERSION)' 1088 BLDLIBRARY='-L. -lpython$(LDVERSION)'
962 RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} 1089 RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
963 case $ac_sys_system in
964 FreeBSD*)
965 SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
966 ;;
967 esac
968 INSTSONAME="$LDLIBRARY".$SOVERSION 1090 INSTSONAME="$LDLIBRARY".$SOVERSION
969 if test "$with_pydebug" != yes 1091 if test "$with_pydebug" != yes
970 then 1092 then
971 PY3LIBRARY=libpython3.so 1093 PY3LIBRARY=libpython3.so
972 fi 1094 fi
973 ;; 1095 ;;
974 hp*|HP*) 1096 hp*|HP*)
975 case `uname -m` in 1097 case `uname -m` in
976 ia64) 1098 ia64)
977 LDLIBRARY='libpython$(LDVERSION).so' 1099 LDLIBRARY='libpython$(LDVERSION).so'
(...skipping 3190 matching lines...) Expand 10 before | Expand all | Expand 10 after
4168 # * --with-pymalloc (adds a 'm') 4290 # * --with-pymalloc (adds a 'm')
4169 # * --with-wide-unicode (adds a 'u') 4291 # * --with-wide-unicode (adds a 'u')
4170 # 4292 #
4171 # Thus for example, Python 3.2 built with wide unicode, pydebug, and pymalloc, 4293 # Thus for example, Python 3.2 built with wide unicode, pydebug, and pymalloc,
4172 # would get a shared library ABI version tag of 'cpython-32dmu' and shared 4294 # would get a shared library ABI version tag of 'cpython-32dmu' and shared
4173 # libraries would be named 'foo.cpython-32dmu.so'. 4295 # libraries would be named 'foo.cpython-32dmu.so'.
4174 AC_SUBST(SOABI) 4296 AC_SUBST(SOABI)
4175 AC_MSG_CHECKING(ABIFLAGS) 4297 AC_MSG_CHECKING(ABIFLAGS)
4176 AC_MSG_RESULT($ABIFLAGS) 4298 AC_MSG_RESULT($ABIFLAGS)
4177 AC_MSG_CHECKING(SOABI) 4299 AC_MSG_CHECKING(SOABI)
4178 4300 SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFO RM_TRIPLET}
4179 case $ac_sys_system in
4180 Linux*|GNU*)
4181 BITNESS_SUFFIX=-$(($ac_cv_sizeof_void_p * 8))b;;
4182 *)
4183 BITNESS_SUFFIX=;;
4184 esac
4185 SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${BITNESS_SUFFIX}
4186
4187 AC_MSG_RESULT($SOABI) 4301 AC_MSG_RESULT($SOABI)
4188 4302
4189 AC_SUBST(EXT_SUFFIX) 4303 AC_SUBST(EXT_SUFFIX)
4190 case $ac_sys_system in 4304 case $ac_sys_system in
4191 Linux*|GNU*) 4305 Linux*|GNU*)
4192 EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX};; 4306 EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX};;
4193 *) 4307 *)
4194 EXT_SUFFIX=${SHLIB_SUFFIX};; 4308 EXT_SUFFIX=${SHLIB_SUFFIX};;
4195 esac 4309 esac
4196 4310
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
4945 [], 5059 [],
4946 [with_ensurepip=upgrade]) 5060 [with_ensurepip=upgrade])
4947 AS_CASE($with_ensurepip, 5061 AS_CASE($with_ensurepip,
4948 [yes|upgrade],[ENSUREPIP=upgrade], 5062 [yes|upgrade],[ENSUREPIP=upgrade],
4949 [install],[ENSUREPIP=install], 5063 [install],[ENSUREPIP=install],
4950 [no],[ENSUREPIP=no], 5064 [no],[ENSUREPIP=no],
4951 [AC_MSG_ERROR([--with-ensurepip=upgrade|install|no])]) 5065 [AC_MSG_ERROR([--with-ensurepip=upgrade|install|no])])
4952 AC_MSG_RESULT($ENSUREPIP) 5066 AC_MSG_RESULT($ENSUREPIP)
4953 AC_SUBST(ENSUREPIP) 5067 AC_SUBST(ENSUREPIP)
4954 5068
5069 # check if the dirent structure of a d_type field and DT_UNKNOWN is defined
5070 AC_MSG_CHECKING(if the dirent structure of a d_type field)
5071 AC_LINK_IFELSE(
5072 [
5073 AC_LANG_SOURCE([[
5074 #include <dirent.h>
5075
5076 int main() {
5077 struct dirent entry;
5078 return entry.d_type == DT_UNKNOWN;
5079 }
5080 ]])
5081 ],[have_dirent_d_type=yes],[have_dirent_d_type=no])
5082 AC_MSG_RESULT($have_dirent_d_type)
5083
5084 if test "$have_dirent_d_type" = yes; then
5085 AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
5086 [Define to 1 if the dirent structure has a d_type field])
5087 fi
5088
5089 # check if the Linux getrandom() syscall is available
5090 AC_MSG_CHECKING(for the Linux getrandom() syscall)
5091 AC_LINK_IFELSE(
5092 [
5093 AC_LANG_SOURCE([[
5094 #include <sys/syscall.h>
5095
5096 int main() {
5097 const int flags = 0;
5098 char buffer[1];
5099 int n;
5100 /* ignore the result, Python checks for ENOSYS at runtime */
5101 (void)syscall(SYS_getrandom, buffer, sizeof(buffer), flags);
5102 return 0;
5103 }
5104 ]])
5105 ],[have_getrandom_syscall=yes],[have_getrandom_syscall=no])
5106 AC_MSG_RESULT($have_getrandom_syscall)
5107
5108 if test "$have_getrandom_syscall" = yes; then
5109 AC_DEFINE(HAVE_GETRANDOM_SYSCALL, 1,
5110 [Define to 1 if the Linux getrandom() syscall is available])
5111 fi
5112
4955 # generate output files 5113 # generate output files
4956 AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-con fig.sh) 5114 AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-con fig.sh)
4957 AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix]) 5115 AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
4958 AC_OUTPUT 5116 AC_OUTPUT
4959 5117
4960 echo "creating Modules/Setup" >&AS_MESSAGE_FD 5118 echo "creating Modules/Setup" >&AS_MESSAGE_FD
4961 if test ! -f Modules/Setup 5119 if test ! -f Modules/Setup
4962 then 5120 then
4963 cp $srcdir/Modules/Setup.dist Modules/Setup 5121 cp $srcdir/Modules/Setup.dist Modules/Setup
4964 fi 5122 fi
4965 5123
4966 echo "creating Modules/Setup.local" >&AS_MESSAGE_FD 5124 echo "creating Modules/Setup.local" >&AS_MESSAGE_FD
4967 if test ! -f Modules/Setup.local 5125 if test ! -f Modules/Setup.local
4968 then 5126 then
4969 echo "# Edit this file for local setup changes" >Modules/Setup.local 5127 echo "# Edit this file for local setup changes" >Modules/Setup.local
4970 fi 5128 fi
4971 5129
4972 echo "creating Makefile" >&AS_MESSAGE_FD 5130 echo "creating Makefile" >&AS_MESSAGE_FD
4973 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ 5131 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
4974 -s Modules Modules/Setup.config \ 5132 -s Modules Modules/Setup.config \
4975 Modules/Setup.local Modules/Setup 5133 Modules/Setup.local Modules/Setup
4976 mv config.c Modules 5134 mv config.c Modules
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+