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

Delta Between Two Patch Sets: configure.ac

Issue 22980: C extension naming doesn't take bitness into account
Left Patch Set: Created 4 years, 9 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:
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
(no file at all)
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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 AC_MSG_NOTICE([Using clang from Xcode.app]) 660 AC_MSG_NOTICE([Using clang from Xcode.app])
661 CC="${found_clang}" 661 CC="${found_clang}"
662 CXX="`/usr/bin/xcrun -find clang++`" 662 CXX="`/usr/bin/xcrun -find clang++`"
663 663
664 # else: use default behaviour 664 # else: use default behaviour
665 fi 665 fi
666 fi 666 fi
667 fi 667 fi
668 fi 668 fi
669 AC_PROG_CC 669 AC_PROG_CC
670 AC_PROG_CPP
671 AC_PROG_GREP
670 672
671 AC_SUBST(CXX) 673 AC_SUBST(CXX)
672 AC_SUBST(MAINCC) 674 AC_SUBST(MAINCC)
673 AC_MSG_CHECKING(for --with-cxx-main=<compiler>) 675 AC_MSG_CHECKING(for --with-cxx-main=<compiler>)
674 AC_ARG_WITH(cxx_main, 676 AC_ARG_WITH(cxx_main,
675 AS_HELP_STRING([--with-cxx-main=<compiler>], 677 AS_HELP_STRING([--with-cxx-main=<compiler>],
676 [compile main() and link python executable with C++ c ompiler]), 678 [compile main() and link python executable with C++ c ompiler]),
677 [ 679 [
678 680
679 case $withval in 681 case $withval in
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 if test "$preset_cxx" != "$CXX" 719 if test "$preset_cxx" != "$CXX"
718 then 720 then
719 AC_MSG_NOTICE([ 721 AC_MSG_NOTICE([
720 722
721 By default, distutils will build C++ extension modules with "$CXX". 723 By default, distutils will build C++ extension modules with "$CXX".
722 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.
723 ]) 725 ])
724 fi 726 fi
725 727
726 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
727 AC_MSG_CHECKING([for -Wl,--no-as-needed]) 855 AC_MSG_CHECKING([for -Wl,--no-as-needed])
728 save_LDFLAGS="$LDFLAGS" 856 save_LDFLAGS="$LDFLAGS"
729 LDFLAGS="$LDFLAGS -Wl,--no-as-needed" 857 LDFLAGS="$LDFLAGS -Wl,--no-as-needed"
730 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], 858 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
731 [NO_AS_NEEDED="-Wl,--no-as-needed" 859 [NO_AS_NEEDED="-Wl,--no-as-needed"
732 AC_MSG_RESULT([yes])], 860 AC_MSG_RESULT([yes])],
733 [NO_AS_NEEDED="" 861 [NO_AS_NEEDED=""
734 AC_MSG_RESULT([no])]) 862 AC_MSG_RESULT([no])])
735 LDFLAGS="$save_LDFLAGS" 863 LDFLAGS="$save_LDFLAGS"
736 AC_SUBST(NO_AS_NEEDED) 864 AC_SUBST(NO_AS_NEEDED)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 gcc) CC="$CC -D_HAVE_BSDI";; 911 gcc) CC="$CC -D_HAVE_BSDI";;
784 esac;; 912 esac;;
785 esac 913 esac
786 914
787 case $ac_sys_system in 915 case $ac_sys_system in
788 hp*|HP*) 916 hp*|HP*)
789 case $CC in 917 case $CC in
790 cc|*/cc) CC="$CC -Ae";; 918 cc|*/cc) CC="$CC -Ae";;
791 esac;; 919 esac;;
792 esac 920 esac
793
794 MULTIARCH=$($CC --print-multiarch 2>/dev/null)
795 AC_SUBST(MULTIARCH)
796
797 921
798 AC_SUBST(LIBRARY) 922 AC_SUBST(LIBRARY)
799 AC_MSG_CHECKING(LIBRARY) 923 AC_MSG_CHECKING(LIBRARY)
800 if test -z "$LIBRARY" 924 if test -z "$LIBRARY"
801 then 925 then
802 LIBRARY='libpython$(VERSION)$(ABIFLAGS).a' 926 LIBRARY='libpython$(VERSION)$(ABIFLAGS).a'
803 fi 927 fi
804 AC_MSG_RESULT($LIBRARY) 928 AC_MSG_RESULT($LIBRARY)
805 929
806 # 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 3359 matching lines...) Expand 10 before | Expand all | Expand 10 after
4166 # * --with-pymalloc (adds a 'm') 4290 # * --with-pymalloc (adds a 'm')
4167 # * --with-wide-unicode (adds a 'u') 4291 # * --with-wide-unicode (adds a 'u')
4168 # 4292 #
4169 # 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,
4170 # 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
4171 # libraries would be named 'foo.cpython-32dmu.so'. 4295 # libraries would be named 'foo.cpython-32dmu.so'.
4172 AC_SUBST(SOABI) 4296 AC_SUBST(SOABI)
4173 AC_MSG_CHECKING(ABIFLAGS) 4297 AC_MSG_CHECKING(ABIFLAGS)
4174 AC_MSG_RESULT($ABIFLAGS) 4298 AC_MSG_RESULT($ABIFLAGS)
4175 AC_MSG_CHECKING(SOABI) 4299 AC_MSG_CHECKING(SOABI)
4176 4300 SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFO RM_TRIPLET}
4177 case $ac_sys_system in
4178 Linux*|GNU*)
4179 BITNESS_SUFFIX=-$(($ac_cv_sizeof_void_p * 8))b;;
4180 *)
4181 BITNESS_SUFFIX=;;
4182 esac
4183 SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${BITNESS_SUFFIX}
4184
4185 AC_MSG_RESULT($SOABI) 4301 AC_MSG_RESULT($SOABI)
4186 4302
4187 AC_SUBST(EXT_SUFFIX) 4303 AC_SUBST(EXT_SUFFIX)
4188 case $ac_sys_system in 4304 case $ac_sys_system in
4189 Linux*|GNU*) 4305 Linux*|GNU*)
4190 EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX};; 4306 EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX};;
4191 *) 4307 *)
4192 EXT_SUFFIX=${SHLIB_SUFFIX};; 4308 EXT_SUFFIX=${SHLIB_SUFFIX};;
4193 esac 4309 esac
4194 4310
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
5009 if test ! -f Modules/Setup.local 5125 if test ! -f Modules/Setup.local
5010 then 5126 then
5011 echo "# Edit this file for local setup changes" >Modules/Setup.local 5127 echo "# Edit this file for local setup changes" >Modules/Setup.local
5012 fi 5128 fi
5013 5129
5014 echo "creating Makefile" >&AS_MESSAGE_FD 5130 echo "creating Makefile" >&AS_MESSAGE_FD
5015 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ 5131 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
5016 -s Modules Modules/Setup.config \ 5132 -s Modules Modules/Setup.config \
5017 Modules/Setup.local Modules/Setup 5133 Modules/Setup.local Modules/Setup
5018 mv config.c Modules 5134 mv config.c Modules
LEFTRIGHT

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