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

Delta Between Two Patch Sets: configure.ac

Issue 16235: Add python-config.sh for use during cross compilation.
Left Patch Set: Created 7 years ago
Right Patch Set: Created 6 years, 8 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 | « configure ('k') | Makefile.pre.in » ('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.4) 6 m4_define(PYTHON_VERSION, 3.3)
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/)
11
12 AC_SUBST(BASECPPFLAGS)
13 if test "$abs_srcdir" != "$abs_builddir"; then
14 # If we're building out-of-tree, we need to make sure the following
15 # resources get picked up before their $srcdir counterparts.
16 # Objects/ -> typeslots.inc
17 # Include/ -> Python-ast.h, graminit.h
18 # Python/ -> importlib.h
19 # (A side effect of this is that these resources will automatically be
20 # regenerated when building out-of-tree, regardless of whether or not
21 # the $srcdir counterpart is up-to-date. This is an acceptable trade
22 # off.)
23 BASECPPFLAGS="-IObjects -IInclude -IPython"
24 else
25 BASECPPFLAGS=""
26 fi
11 27
12 AC_SUBST(HGVERSION) 28 AC_SUBST(HGVERSION)
13 AC_SUBST(HGTAG) 29 AC_SUBST(HGTAG)
14 AC_SUBST(HGBRANCH) 30 AC_SUBST(HGBRANCH)
15 31
16 if test -e $srcdir/.hg/dirstate 32 if test -e $srcdir/.hg/dirstate
17 then 33 then
18 AC_CHECK_PROG(HAS_HG, hg, found, not-found) 34 AC_CHECK_PROG(HAS_HG, hg, found, not-found)
19 else 35 else
20 HAS_HG=no-repository 36 HAS_HG=no-repository
21 fi 37 fi
22 if test $HAS_HG = found 38 if test $HAS_HG = found
23 then 39 then
24 HGVERSION="hg id -i \$(srcdir)" 40 HGVERSION="hg id -i \$(srcdir)"
25 HGTAG="hg id -t \$(srcdir)" 41 HGTAG="hg id -t \$(srcdir)"
26 HGBRANCH="hg id -b \$(srcdir)" 42 HGBRANCH="hg id -b \$(srcdir)"
27 else 43 else
28 HGVERSION="" 44 HGVERSION=""
29 HGTAG="" 45 HGTAG=""
30 HGBRANCH="" 46 HGBRANCH=""
31 fi 47 fi
32 48
33 AC_CONFIG_SRCDIR([Include/object.h]) 49 AC_CONFIG_SRCDIR([Include/object.h])
34 AC_CONFIG_HEADER(pyconfig.h) 50 AC_CONFIG_HEADER(pyconfig.h)
35 51
36 AC_CANONICAL_HOST 52 AC_CANONICAL_HOST
53 AC_SUBST(build)
54 AC_SUBST(host)
37 55
38 if test "$cross_compiling" = yes; then 56 if test "$cross_compiling" = yes; then
39 AC_MSG_CHECKING([for python interpreter for cross build]) 57 AC_MSG_CHECKING([for python interpreter for cross build])
40 if test -z "$PYTHON_FOR_BUILD"; then 58 if test -z "$PYTHON_FOR_BUILD"; then
41 for interp in python$PACKAGE_VERSION python3 python; do 59 for interp in python$PACKAGE_VERSION python3 python; do
42 which $interp >/dev/null 2>&1 || continue 60 which $interp >/dev/null 2>&1 || continue
43 if $interp -c 'import sys;sys.exit(not sys.version_info@<:@:2@:>@ >= (3,3))'; then 61 if $interp -c 'import sys;sys.exit(not sys.version_info@<:@:2@:>@ >= (3,3))'; then
44 break 62 break
45 fi 63 fi
46 interp= 64 interp=
47 done 65 done
48 if test x$interp = x; then 66 if test x$interp = x; then
49 AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found]) 67 AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
50 fi 68 fi
51 AC_MSG_RESULT($interp) 69 AC_MSG_RESULT($interp)
52 » PYTHON_FOR_BUILD="_PYTHON_PROJECT_BASE=$srcdir"' _PYTHON_HOST_PLATFORM=$ (_PYTHON_HOST_PLATFORM) PYTHONPATH=$(srcdir)/Lib:$(srcdir)/Lib/plat-$(MACHDEP) ' $interp 70 » PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLAT FORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/plat-$(MACHDEP ) '$interp
53 fi 71 fi
72 elif test "$cross_compiling" = maybe; then
73 AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
54 else 74 else
55 PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E' 75 PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
56 fi 76 fi
57 AC_SUBST(PYTHON_FOR_BUILD) 77 AC_SUBST(PYTHON_FOR_BUILD)
58 78
59 dnl Ensure that if prefix is specified, it does not end in a slash. If 79 dnl Ensure that if prefix is specified, it does not end in a slash. If
60 dnl it does, we get path names containing '//' which is both ugly and 80 dnl it does, we get path names containing '//' which is both ugly and
61 dnl can cause trouble. 81 dnl can cause trouble.
62 82
63 dnl Last slash shouldn't be stripped if prefix=/ 83 dnl Last slash shouldn't be stripped if prefix=/
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 ## AS_HELP_STRING([--with-dyld], 347 ## AS_HELP_STRING([--with-dyld],
328 ## [Use (OpenStep|Rhapsody) dynamic linker])) 348 ## [Use (OpenStep|Rhapsody) dynamic linker]))
329 ## 349 ##
330 # Set name for machine-dependent library files 350 # Set name for machine-dependent library files
331 AC_SUBST(MACHDEP) 351 AC_SUBST(MACHDEP)
332 AC_MSG_CHECKING(MACHDEP) 352 AC_MSG_CHECKING(MACHDEP)
333 if test -z "$MACHDEP" 353 if test -z "$MACHDEP"
334 then 354 then
335 # avoid using uname for cross builds 355 # avoid using uname for cross builds
336 if test "$cross_compiling" = yes; then 356 if test "$cross_compiling" = yes; then
337 # ac_sys_system and ac_sys_release are only used for setting 357 # ac_sys_system and ac_sys_release are used for setting
338 # `define_xopen_source' in the case statement below. For the 358 # a lot of different things including 'define_xopen_source'
339 # current supported cross builds, this macro is not adjusted. 359 # in the case statement below.
340 case "$host" in 360 case "$host" in
341 *-*-linux*) 361 *-*-linux*)
342 ac_sys_system=Linux 362 ac_sys_system=Linux
343 ;; 363 ;;
344 *-*-cygwin*) 364 *-*-cygwin*)
345 ac_sys_system=Cygwin 365 ac_sys_system=Cygwin
346 ;; 366 ;;
347 *) 367 *)
348 # for now, limit cross builds to known configurations 368 # for now, limit cross builds to known configurations
349 MACHDEP="unknown" 369 MACHDEP="unknown"
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 esac;; 759 esac;;
740 esac 760 esac
741 761
742 case $ac_sys_system in 762 case $ac_sys_system in
743 hp*|HP*) 763 hp*|HP*)
744 case $CC in 764 case $CC in
745 cc|*/cc) CC="$CC -Ae";; 765 cc|*/cc) CC="$CC -Ae";;
746 esac;; 766 esac;;
747 esac 767 esac
748 768
769 MULTIARCH=$($CC --print-multiarch 2>/dev/null)
770 AC_SUBST(MULTIARCH)
771
749 772
750 AC_SUBST(LIBRARY) 773 AC_SUBST(LIBRARY)
751 AC_MSG_CHECKING(LIBRARY) 774 AC_MSG_CHECKING(LIBRARY)
752 if test -z "$LIBRARY" 775 if test -z "$LIBRARY"
753 then 776 then
754 LIBRARY='libpython$(VERSION)$(ABIFLAGS).a' 777 LIBRARY='libpython$(VERSION)$(ABIFLAGS).a'
755 fi 778 fi
756 AC_MSG_RESULT($LIBRARY) 779 AC_MSG_RESULT($LIBRARY)
757 780
758 # LDLIBRARY is the name of the library to link against (as opposed to the 781 # LDLIBRARY is the name of the library to link against (as opposed to the
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 esac 974 esac
952 else # shared is disabled 975 else # shared is disabled
953 PY_ENABLE_SHARED=0 976 PY_ENABLE_SHARED=0
954 case $ac_sys_system in 977 case $ac_sys_system in
955 CYGWIN*) 978 CYGWIN*)
956 BLDLIBRARY='$(LIBRARY)' 979 BLDLIBRARY='$(LIBRARY)'
957 LDLIBRARY='libpython$(LDVERSION).dll.a' 980 LDLIBRARY='libpython$(LDVERSION).dll.a'
958 ;; 981 ;;
959 esac 982 esac
960 fi 983 fi
961 AC_SUBST(PY_ENABLE_SHARED)
962 984
963 if test "$cross_compiling" = yes; then 985 if test "$cross_compiling" = yes; then
964 RUNSHARED= 986 RUNSHARED=
965 fi 987 fi
966 988
967 AC_MSG_RESULT($LDLIBRARY) 989 AC_MSG_RESULT($LDLIBRARY)
968 990
969 AC_PROG_RANLIB 991 AC_PROG_RANLIB
970 AC_SUBST(AR) 992 AC_SUBST(AR)
971 AC_CHECK_TOOLS(AR, ar aal, ar) 993 AC_CHECK_TOOLS(AR, ar aal, ar)
972 994
973 # tweak ARFLAGS only if the user didn't set it on the command line 995 # tweak ARFLAGS only if the user didn't set it on the command line
974 AC_SUBST(ARFLAGS) 996 AC_SUBST(ARFLAGS)
975 if test -z "$ARFLAGS" 997 if test -z "$ARFLAGS"
976 then 998 then
977 ARFLAGS="rc" 999 ARFLAGS="rc"
978 fi 1000 fi
979 1001
980 AC_CHECK_TOOLS([READELF], [readelf], [:]) 1002 AC_CHECK_TOOLS([READELF], [readelf], [:])
981 if test "$cross_compiling" = yes; then 1003 if test "$cross_compiling" = yes; then
982 case "$READELF" in 1004 case "$READELF" in
983 readelf|:) 1005 readelf|:)
984 AC_MSG_ERROR([readelf for the host is required for cross builds]) 1006 AC_MSG_ERROR([readelf for the host is required for cross builds])
985 ;; 1007 ;;
986 esac 1008 esac
987 fi 1009 fi
988 AC_SUBST(READELF) 1010 AC_SUBST(READELF)
989 1011
990 AC_SUBST(DISABLE_ASDLGEN) 1012 AC_SUBST(ASDLGEN)
991 DISABLE_ASDLGEN="" 1013 AC_CHECK_PROGS(PYTHON, python$PACKAGE_VERSION python3 python, not-found)
992 AC_CHECK_PROG(HAS_PYTHON, python, found, not-found) 1014 if test "$PYTHON" = not-found; then
993 if test $HAS_HG != found -o $HAS_PYTHON != found 1015 ASDLGEN="@echo python: $PYTHON! cannot run \$(srcdir)/Parser/asdl_c.py #"
994 then 1016 else
995 DISABLE_ASDLGEN="@echo hg: $HAS_HG, python: $HAS_PYTHON! cannot run \$(srcdi r)/Parser/asdl_c.py #" 1017 ASDLGEN="$PYTHON"
996 fi 1018 fi
997 1019
998 1020
999 case $MACHDEP in 1021 case $MACHDEP in
1000 bsdos*|hp*|HP*) 1022 bsdos*|hp*|HP*)
1001 # install -d does not work on BSDI or HP-UX 1023 # install -d does not work on BSDI or HP-UX
1002 if test -z "$INSTALL" 1024 if test -z "$INSTALL"
1003 then 1025 then
1004 INSTALL="${srcdir}/install-sh -c" 1026 INSTALL="${srcdir}/install-sh -c"
1005 fi 1027 fi
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 fi 1347 fi
1326 1348
1327 # On some compilers, pthreads are available without further options 1349 # On some compilers, pthreads are available without further options
1328 # (e.g. MacOS X). On some of these systems, the compiler will not 1350 # (e.g. MacOS X). On some of these systems, the compiler will not
1329 # complain if unaccepted options are passed (e.g. gcc on Mac OS X). 1351 # complain if unaccepted options are passed (e.g. gcc on Mac OS X).
1330 # So we have to see first whether pthreads are available without 1352 # So we have to see first whether pthreads are available without
1331 # options before we can check whether -Kpthread improves anything. 1353 # options before we can check whether -Kpthread improves anything.
1332 AC_MSG_CHECKING(whether pthreads are available without options) 1354 AC_MSG_CHECKING(whether pthreads are available without options)
1333 AC_CACHE_VAL(ac_cv_pthread_is_default, 1355 AC_CACHE_VAL(ac_cv_pthread_is_default,
1334 [AC_RUN_IFELSE([AC_LANG_SOURCE([[ 1356 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
1357 #include <stdio.h>
1335 #include <pthread.h> 1358 #include <pthread.h>
1336 1359
1337 void* routine(void* p){return NULL;} 1360 void* routine(void* p){return NULL;}
1338 1361
1339 int main(){ 1362 int main(){
1340 pthread_t p; 1363 pthread_t p;
1341 if(pthread_create(&p,NULL,routine,NULL)!=0) 1364 if(pthread_create(&p,NULL,routine,NULL)!=0)
1342 return 1; 1365 return 1;
1343 (void)pthread_detach(p); 1366 (void)pthread_detach(p);
1344 return 0; 1367 return 0;
(...skipping 14 matching lines...) Expand all
1359 # -Kpthread, if available, provides the right #defines 1382 # -Kpthread, if available, provides the right #defines
1360 # and linker options to make pthread_create available 1383 # and linker options to make pthread_create available
1361 # Some compilers won't report that they do not support -Kpthread, 1384 # Some compilers won't report that they do not support -Kpthread,
1362 # so we need to run a program to see whether it really made the 1385 # so we need to run a program to see whether it really made the
1363 # function available. 1386 # function available.
1364 AC_MSG_CHECKING(whether $CC accepts -Kpthread) 1387 AC_MSG_CHECKING(whether $CC accepts -Kpthread)
1365 AC_CACHE_VAL(ac_cv_kpthread, 1388 AC_CACHE_VAL(ac_cv_kpthread,
1366 [ac_save_cc="$CC" 1389 [ac_save_cc="$CC"
1367 CC="$CC -Kpthread" 1390 CC="$CC -Kpthread"
1368 AC_RUN_IFELSE([AC_LANG_SOURCE([[ 1391 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1392 #include <stdio.h>
1369 #include <pthread.h> 1393 #include <pthread.h>
1370 1394
1371 void* routine(void* p){return NULL;} 1395 void* routine(void* p){return NULL;}
1372 1396
1373 int main(){ 1397 int main(){
1374 pthread_t p; 1398 pthread_t p;
1375 if(pthread_create(&p,NULL,routine,NULL)!=0) 1399 if(pthread_create(&p,NULL,routine,NULL)!=0)
1376 return 1; 1400 return 1;
1377 (void)pthread_detach(p); 1401 (void)pthread_detach(p);
1378 return 0; 1402 return 0;
1379 } 1403 }
1380 ]])],[ac_cv_kpthread=yes],[ac_cv_kpthread=no],[ac_cv_kpthread=no]) 1404 ]])],[ac_cv_kpthread=yes],[ac_cv_kpthread=no],[ac_cv_kpthread=no])
1381 CC="$ac_save_cc"]) 1405 CC="$ac_save_cc"])
1382 AC_MSG_RESULT($ac_cv_kpthread) 1406 AC_MSG_RESULT($ac_cv_kpthread)
1383 fi 1407 fi
1384 1408
1385 if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no 1409 if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no
1386 then 1410 then
1387 # -Kthread, if available, provides the right #defines 1411 # -Kthread, if available, provides the right #defines
1388 # and linker options to make pthread_create available 1412 # and linker options to make pthread_create available
1389 # Some compilers won't report that they do not support -Kthread, 1413 # Some compilers won't report that they do not support -Kthread,
1390 # so we need to run a program to see whether it really made the 1414 # so we need to run a program to see whether it really made the
1391 # function available. 1415 # function available.
1392 AC_MSG_CHECKING(whether $CC accepts -Kthread) 1416 AC_MSG_CHECKING(whether $CC accepts -Kthread)
1393 AC_CACHE_VAL(ac_cv_kthread, 1417 AC_CACHE_VAL(ac_cv_kthread,
1394 [ac_save_cc="$CC" 1418 [ac_save_cc="$CC"
1395 CC="$CC -Kthread" 1419 CC="$CC -Kthread"
1396 AC_RUN_IFELSE([AC_LANG_SOURCE([[ 1420 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1421 #include <stdio.h>
1397 #include <pthread.h> 1422 #include <pthread.h>
1398 1423
1399 void* routine(void* p){return NULL;} 1424 void* routine(void* p){return NULL;}
1400 1425
1401 int main(){ 1426 int main(){
1402 pthread_t p; 1427 pthread_t p;
1403 if(pthread_create(&p,NULL,routine,NULL)!=0) 1428 if(pthread_create(&p,NULL,routine,NULL)!=0)
1404 return 1; 1429 return 1;
1405 (void)pthread_detach(p); 1430 (void)pthread_detach(p);
1406 return 0; 1431 return 0;
1407 } 1432 }
1408 ]])],[ac_cv_kthread=yes],[ac_cv_kthread=no],[ac_cv_kthread=no]) 1433 ]])],[ac_cv_kthread=yes],[ac_cv_kthread=no],[ac_cv_kthread=no])
1409 CC="$ac_save_cc"]) 1434 CC="$ac_save_cc"])
1410 AC_MSG_RESULT($ac_cv_kthread) 1435 AC_MSG_RESULT($ac_cv_kthread)
1411 fi 1436 fi
1412 1437
1413 if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no 1438 if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no
1414 then 1439 then
1415 # -pthread, if available, provides the right #defines 1440 # -pthread, if available, provides the right #defines
1416 # and linker options to make pthread_create available 1441 # and linker options to make pthread_create available
1417 # Some compilers won't report that they do not support -pthread, 1442 # Some compilers won't report that they do not support -pthread,
1418 # so we need to run a program to see whether it really made the 1443 # so we need to run a program to see whether it really made the
1419 # function available. 1444 # function available.
1420 AC_MSG_CHECKING(whether $CC accepts -pthread) 1445 AC_MSG_CHECKING(whether $CC accepts -pthread)
1421 AC_CACHE_VAL(ac_cv_thread, 1446 AC_CACHE_VAL(ac_cv_pthread,
1422 [ac_save_cc="$CC" 1447 [ac_save_cc="$CC"
1423 CC="$CC -pthread" 1448 CC="$CC -pthread"
1424 AC_RUN_IFELSE([AC_LANG_SOURCE([[ 1449 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1450 #include <stdio.h>
1425 #include <pthread.h> 1451 #include <pthread.h>
1426 1452
1427 void* routine(void* p){return NULL;} 1453 void* routine(void* p){return NULL;}
1428 1454
1429 int main(){ 1455 int main(){
1430 pthread_t p; 1456 pthread_t p;
1431 if(pthread_create(&p,NULL,routine,NULL)!=0) 1457 if(pthread_create(&p,NULL,routine,NULL)!=0)
1432 return 1; 1458 return 1;
1433 (void)pthread_detach(p); 1459 (void)pthread_detach(p);
1434 return 0; 1460 return 0;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 #endif 1640 #endif
1615 EOF 1641 EOF
1616 1642
1617 # Type availability checks 1643 # Type availability checks
1618 AC_TYPE_MODE_T 1644 AC_TYPE_MODE_T
1619 AC_TYPE_OFF_T 1645 AC_TYPE_OFF_T
1620 AC_TYPE_PID_T 1646 AC_TYPE_PID_T
1621 AC_DEFINE_UNQUOTED([RETSIGTYPE],[void],[assume C89 semantics that RETSIGTYPE is always void]) 1647 AC_DEFINE_UNQUOTED([RETSIGTYPE],[void],[assume C89 semantics that RETSIGTYPE is always void])
1622 AC_TYPE_SIZE_T 1648 AC_TYPE_SIZE_T
1623 AC_TYPE_UID_T 1649 AC_TYPE_UID_T
1650
1651 # There are two separate checks for each of the exact-width integer types we
1652 # need. First we check whether the type is available using the usual
1653 # AC_CHECK_TYPE macro with the default includes (which includes <inttypes.h>
1654 # and <stdint.h> where available). We then also use the special type checks of
1655 # the form AC_TYPE_UINT32_T, which in the case that uint32_t is not available
1656 # directly, #define's uint32_t to be a suitable type.
1657
1658 AC_CHECK_TYPE(uint32_t,
1659 AC_DEFINE(HAVE_UINT32_T, 1, [Define if your compiler provides uint32_t.]),,)
1624 AC_TYPE_UINT32_T 1660 AC_TYPE_UINT32_T
1661
1662 AC_CHECK_TYPE(uint64_t,
1663 AC_DEFINE(HAVE_UINT64_T, 1, [Define if your compiler provides uint64_t.]),,)
1625 AC_TYPE_UINT64_T 1664 AC_TYPE_UINT64_T
1665
1666 AC_CHECK_TYPE(int32_t,
1667 AC_DEFINE(HAVE_INT32_T, 1, [Define if your compiler provides int32_t.]),,)
1626 AC_TYPE_INT32_T 1668 AC_TYPE_INT32_T
1669
1670 AC_CHECK_TYPE(int64_t,
1671 AC_DEFINE(HAVE_INT64_T, 1, [Define if your compiler provides int64_t.]),,)
1627 AC_TYPE_INT64_T 1672 AC_TYPE_INT64_T
1673
1628 AC_CHECK_TYPE(ssize_t, 1674 AC_CHECK_TYPE(ssize_t,
1629 AC_DEFINE(HAVE_SSIZE_T, 1, [Define if your compiler provides ssize_t]),,) 1675 AC_DEFINE(HAVE_SSIZE_T, 1, [Define if your compiler provides ssize_t]),,)
1630 AC_CHECK_TYPE(__uint128_t, 1676 AC_CHECK_TYPE(__uint128_t,
1631 AC_DEFINE(HAVE_GCC_UINT128_T, 1, [Define if your compiler provides __uint128_t ]),,) 1677 AC_DEFINE(HAVE_GCC_UINT128_T, 1, [Define if your compiler provides __uint128_t ]),,)
1632 1678
1633 # Sizes of various common basic types 1679 # Sizes of various common basic types
1634 # ANSI C requires sizeof(char) == 1, so no need to check it 1680 # ANSI C requires sizeof(char) == 1, so no need to check it
1635 AC_CHECK_SIZEOF(int, 4) 1681 AC_CHECK_SIZEOF(int, 4)
1636 AC_CHECK_SIZEOF(long, 4) 1682 AC_CHECK_SIZEOF(long, 4)
1637 AC_CHECK_SIZEOF(void *, 4) 1683 AC_CHECK_SIZEOF(void *, 4)
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1852 esac 1898 esac
1853 1899
1854 # Set info about shared libraries. 1900 # Set info about shared libraries.
1855 AC_SUBST(SO) 1901 AC_SUBST(SO)
1856 AC_SUBST(LDSHARED) 1902 AC_SUBST(LDSHARED)
1857 AC_SUBST(LDCXXSHARED) 1903 AC_SUBST(LDCXXSHARED)
1858 AC_SUBST(BLDSHARED) 1904 AC_SUBST(BLDSHARED)
1859 AC_SUBST(CCSHARED) 1905 AC_SUBST(CCSHARED)
1860 AC_SUBST(LINKFORSHARED) 1906 AC_SUBST(LINKFORSHARED)
1861 1907
1862 AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libr aries (including the dot!).])
1863 # LDSHARED is the ld *command* used to create shared library 1908 # LDSHARED is the ld *command* used to create shared library
1864 # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 1909 # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5
1865 # (Shared libraries in this instance are shared modules to be loaded into 1910 # (Shared libraries in this instance are shared modules to be loaded into
1866 # Python, as opposed to building Python itself as a shared library.) 1911 # Python, as opposed to building Python itself as a shared library.)
1867 AC_MSG_CHECKING(LDSHARED) 1912 AC_MSG_CHECKING(LDSHARED)
1868 if test -z "$LDSHARED" 1913 if test -z "$LDSHARED"
1869 then 1914 then
1870 case $ac_sys_system/$ac_sys_release in 1915 case $ac_sys_system/$ac_sys_release in
1871 AIX*) 1916 AIX*)
1872 BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Mo dules/python.exp" 1917 BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Mo dules/python.exp"
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
2336 ], unistd_defines_pthreads=yes, unistd_defines_pthreads=no) 2381 ], unistd_defines_pthreads=yes, unistd_defines_pthreads=no)
2337 AC_MSG_RESULT($unistd_defines_pthreads) 2382 AC_MSG_RESULT($unistd_defines_pthreads)
2338 2383
2339 AC_DEFINE(_REENTRANT) 2384 AC_DEFINE(_REENTRANT)
2340 # Just looking for pthread_create in libpthread is not enough: 2385 # Just looking for pthread_create in libpthread is not enough:
2341 # on HP/UX, pthread.h renames pthread_create to a different symbol name. 2386 # on HP/UX, pthread.h renames pthread_create to a different symbol name.
2342 # So we really have to include pthread.h, and then link. 2387 # So we really have to include pthread.h, and then link.
2343 _libs=$LIBS 2388 _libs=$LIBS
2344 LIBS="$LIBS -lpthread" 2389 LIBS="$LIBS -lpthread"
2345 AC_MSG_CHECKING([for pthread_create in -lpthread]) 2390 AC_MSG_CHECKING([for pthread_create in -lpthread])
2346 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h> 2391 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2392 #include <stdio.h>
2393 #include <pthread.h>
2347 2394
2348 void * start_routine (void *arg) { exit (0); }]], [[ 2395 void * start_routine (void *arg) { exit (0); }]], [[
2349 pthread_create (NULL, NULL, start_routine, NULL)]])],[ 2396 pthread_create (NULL, NULL, start_routine, NULL)]])],[
2350 AC_MSG_RESULT(yes) 2397 AC_MSG_RESULT(yes)
2351 AC_DEFINE(WITH_THREAD) 2398 AC_DEFINE(WITH_THREAD)
2352 posix_threads=yes 2399 posix_threads=yes
2353 THREADOBJ="Python/thread.o"],[ 2400 THREADOBJ="Python/thread.o"],[
2354 LIBS=$_libs 2401 LIBS=$_libs
2355 AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD) 2402 AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD)
2356 posix_threads=yes 2403 posix_threads=yes
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
2402 SunOS/5.8) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1, 2449 SunOS/5.8) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
2403 [Define if the Posix semaphores do not work on your syste m]) 2450 [Define if the Posix semaphores do not work on your syste m])
2404 ;; 2451 ;;
2405 AIX/*) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1, 2452 AIX/*) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
2406 [Define if the Posix semaphores do not work on your syste m]) 2453 [Define if the Posix semaphores do not work on your syste m])
2407 ;; 2454 ;;
2408 esac 2455 esac
2409 2456
2410 AC_MSG_CHECKING(if PTHREAD_SCOPE_SYSTEM is supported) 2457 AC_MSG_CHECKING(if PTHREAD_SCOPE_SYSTEM is supported)
2411 AC_CACHE_VAL(ac_cv_pthread_system_supported, 2458 AC_CACHE_VAL(ac_cv_pthread_system_supported,
2412 [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <pthread.h> 2459 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
2460 #include <stdio.h>
2461 #include <pthread.h>
2413 void *foo(void *parm) { 2462 void *foo(void *parm) {
2414 return NULL; 2463 return NULL;
2415 } 2464 }
2416 main() { 2465 main() {
2417 pthread_attr_t attr; 2466 pthread_attr_t attr;
2418 pthread_t id; 2467 pthread_t id;
2419 if (pthread_attr_init(&attr)) exit(-1); 2468 if (pthread_attr_init(&attr)) exit(-1);
2420 if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1); 2469 if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1);
2421 if (pthread_create(&id, &attr, foo, NULL)) exit(-1); 2470 if (pthread_create(&id, &attr, foo, NULL)) exit(-1);
2422 exit(0); 2471 exit(0);
(...skipping 28 matching lines...) Expand all
2451 ipv6=no 2500 ipv6=no
2452 ;; 2501 ;;
2453 *) AC_MSG_RESULT(yes) 2502 *) AC_MSG_RESULT(yes)
2454 AC_DEFINE(ENABLE_IPV6) 2503 AC_DEFINE(ENABLE_IPV6)
2455 ipv6=yes 2504 ipv6=yes
2456 ;; 2505 ;;
2457 esac ], 2506 esac ],
2458 2507
2459 [ 2508 [
2460 dnl the check does not work on cross compilation case... 2509 dnl the check does not work on cross compilation case...
2461 AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* AF_INET6 available check */ 2510 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ /* AF_INET6 available check */
2462 #include <sys/types.h> 2511 #include <sys/types.h>
2463 #include <sys/socket.h> 2512 #include <sys/socket.h>]],
2464 main() 2513 [[int domain = AF_INET6;]])],[
2465 {
2466 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
2467 exit(1);
2468 else
2469 exit(0);
2470 }
2471 ]])],[
2472 AC_MSG_RESULT(yes) 2514 AC_MSG_RESULT(yes)
2473 ipv6=yes 2515 ipv6=yes
2474 ],[
2475 AC_MSG_RESULT(no)
2476 ipv6=no
2477 ],[ 2516 ],[
2478 AC_MSG_RESULT(no) 2517 AC_MSG_RESULT(no)
2479 ipv6=no 2518 ipv6=no
2480 ]) 2519 ])
2481 2520
2482 if test "$ipv6" = "yes"; then 2521 if test "$ipv6" = "yes"; then
2483 AC_MSG_CHECKING(if RFC2553 API is available) 2522 AC_MSG_CHECKING(if RFC2553 API is available)
2484 AC_COMPILE_IFELSE([ 2523 AC_COMPILE_IFELSE([
2485 AC_LANG_PROGRAM([[#include <sys/types.h> 2524 AC_LANG_PROGRAM([[#include <sys/types.h>
2486 #include <netinet/in.h>]], 2525 #include <netinet/in.h>]],
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
3091 #include <stdio.h> 3130 #include <stdio.h>
3092 ]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])], 3131 ]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])],
3093 [have_getaddrinfo=yes], 3132 [have_getaddrinfo=yes],
3094 [have_getaddrinfo=no]) 3133 [have_getaddrinfo=no])
3095 AC_MSG_RESULT($have_getaddrinfo) 3134 AC_MSG_RESULT($have_getaddrinfo)
3096 if test $have_getaddrinfo = yes 3135 if test $have_getaddrinfo = yes
3097 then 3136 then
3098 AC_MSG_CHECKING(getaddrinfo bug) 3137 AC_MSG_CHECKING(getaddrinfo bug)
3099 AC_CACHE_VAL(ac_cv_buggy_getaddrinfo, 3138 AC_CACHE_VAL(ac_cv_buggy_getaddrinfo,
3100 AC_RUN_IFELSE([AC_LANG_SOURCE([[[ 3139 AC_RUN_IFELSE([AC_LANG_SOURCE([[[
3140 #include <stdio.h>
3101 #include <sys/types.h> 3141 #include <sys/types.h>
3102 #include <netdb.h> 3142 #include <netdb.h>
3103 #include <string.h> 3143 #include <string.h>
3104 #include <sys/socket.h> 3144 #include <sys/socket.h>
3105 #include <netinet/in.h> 3145 #include <netinet/in.h>
3106 3146
3107 int main() 3147 int main()
3108 { 3148 {
3109 int passive, gaierr, inet4 = 0, inet6 = 0; 3149 int passive, gaierr, inet4 = 0, inet6 = 0;
3110 struct addrinfo hints, *ai, *aitop; 3150 struct addrinfo hints, *ai, *aitop;
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
3884 AC_MSG_CHECKING(ABIFLAGS) 3924 AC_MSG_CHECKING(ABIFLAGS)
3885 AC_MSG_RESULT($ABIFLAGS) 3925 AC_MSG_RESULT($ABIFLAGS)
3886 AC_MSG_CHECKING(SOABI) 3926 AC_MSG_CHECKING(SOABI)
3887 SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS} 3927 SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}
3888 AC_MSG_RESULT($SOABI) 3928 AC_MSG_RESULT($SOABI)
3889 3929
3890 AC_MSG_CHECKING(LDVERSION) 3930 AC_MSG_CHECKING(LDVERSION)
3891 LDVERSION='$(VERSION)$(ABIFLAGS)' 3931 LDVERSION='$(VERSION)$(ABIFLAGS)'
3892 AC_MSG_RESULT($LDVERSION) 3932 AC_MSG_RESULT($LDVERSION)
3893 3933
3934 dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
3935 AC_SUBST(PY_ENABLE_SHARED)
3936 LIBPL="${prefix}/lib/python${VERSION}/config-${LDVERSION}"
3937 AC_SUBST(LIBPL)
3938
3894 # SO is the extension of shared libraries `(including the dot!) 3939 # SO is the extension of shared libraries `(including the dot!)
3895 # -- usually .so, .sl on HP-UX, .dll on Cygwin 3940 # -- usually .so, .sl on HP-UX, .dll on Cygwin
3896 AC_MSG_CHECKING(SO) 3941 AC_MSG_CHECKING(SO)
3897 if test -z "$SO" 3942 if test -z "$SO"
3898 then 3943 then
3899 case $ac_sys_system in 3944 case $ac_sys_system in
3900 hp*|HP*) 3945 hp*|HP*)
3901 case `uname -m` in 3946 case `uname -m` in
3902 ia64) SO=.so;; 3947 ia64) SO=.so;;
3903 *) SO=.sl;; 3948 *) SO=.sl;;
(...skipping 10 matching lines...) Expand all
3914 echo '================================================================== ===' 3959 echo '================================================================== ==='
3915 echo '+ +' 3960 echo '+ +'
3916 echo '+ WARNING: You have set SO in your environment. +' 3961 echo '+ WARNING: You have set SO in your environment. +'
3917 echo '+ Do you really mean to change the extension for shared libraries? +' 3962 echo '+ Do you really mean to change the extension for shared libraries? +'
3918 echo '+ Continuing in 10 seconds to let you to ponder. +' 3963 echo '+ Continuing in 10 seconds to let you to ponder. +'
3919 echo '+ +' 3964 echo '+ +'
3920 echo '================================================================== ===' 3965 echo '================================================================== ==='
3921 sleep 10 3966 sleep 10
3922 fi 3967 fi
3923 AC_MSG_RESULT($SO) 3968 AC_MSG_RESULT($SO)
3969
3970 AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libr aries (including the dot!).])
3924 3971
3925 # Check whether right shifting a negative integer extends the sign bit 3972 # Check whether right shifting a negative integer extends the sign bit
3926 # or fills with zeros (like the Cray J90, according to Tim Peters). 3973 # or fills with zeros (like the Cray J90, according to Tim Peters).
3927 AC_MSG_CHECKING(whether right shift extends the sign bit) 3974 AC_MSG_CHECKING(whether right shift extends the sign bit)
3928 AC_CACHE_VAL(ac_cv_rshift_extends_sign, [ 3975 AC_CACHE_VAL(ac_cv_rshift_extends_sign, [
3929 AC_RUN_IFELSE([AC_LANG_SOURCE([[ 3976 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3930 int main() 3977 int main()
3931 { 3978 {
3932 exit(((-1)>>3 == -1) ? 0 : 1); 3979 exit(((-1)>>3 == -1) ? 0 : 1);
3933 } 3980 }
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
4419 #include <sys/types.h> 4466 #include <sys/types.h>
4420 #endif 4467 #endif
4421 #ifdef HAVE_SYS_SOCKET_H 4468 #ifdef HAVE_SYS_SOCKET_H
4422 #include <sys/socket.h> 4469 #include <sys/socket.h>
4423 #endif 4470 #endif
4424 ]) 4471 ])
4425 4472
4426 AC_MSG_CHECKING(for broken mbstowcs) 4473 AC_MSG_CHECKING(for broken mbstowcs)
4427 AC_CACHE_VAL(ac_cv_broken_mbstowcs, 4474 AC_CACHE_VAL(ac_cv_broken_mbstowcs,
4428 AC_RUN_IFELSE([AC_LANG_SOURCE([[ 4475 AC_RUN_IFELSE([AC_LANG_SOURCE([[
4476 #include <stdio.h>
4429 #include<stdlib.h> 4477 #include<stdlib.h>
4430 int main() { 4478 int main() {
4431 size_t len = -1; 4479 size_t len = -1;
4432 const char *str = "text"; 4480 const char *str = "text";
4433 len = mbstowcs(NULL, str, 0); 4481 len = mbstowcs(NULL, str, 0);
4434 return (len != 4); 4482 return (len != 4);
4435 } 4483 }
4436 ]])], 4484 ]])],
4437 [ac_cv_broken_mbstowcs=no], 4485 [ac_cv_broken_mbstowcs=no],
4438 [ac_cv_broken_mbstowcs=yes], 4486 [ac_cv_broken_mbstowcs=yes],
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
4614 if test ! -f Modules/Setup.local 4662 if test ! -f Modules/Setup.local
4615 then 4663 then
4616 echo "# Edit this file for local setup changes" >Modules/Setup.local 4664 echo "# Edit this file for local setup changes" >Modules/Setup.local
4617 fi 4665 fi
4618 4666
4619 echo "creating Makefile" 4667 echo "creating Makefile"
4620 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ 4668 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
4621 -s Modules Modules/Setup.config \ 4669 -s Modules Modules/Setup.config \
4622 Modules/Setup.local Modules/Setup 4670 Modules/Setup.local Modules/Setup
4623 mv config.c Modules 4671 mv config.c Modules
LEFTRIGHT

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