6
6
# Set VERSION so we only need to edit in one place (i.e., here)
7
7
m4_define(PYTHON_VERSION, 2.6)
9
AC_REVISION($Revision: 75132 $)
9
AC_REVISION($Revision: 78820 $)
11
11
AC_INIT(python, PYTHON_VERSION, http://www.python.org/python-bugs)
12
12
AC_CONFIG_SRCDIR([Include/object.h])
69
69
AC_SUBST(CONFIG_ARGS)
70
70
CONFIG_ARGS="$ac_configure_args"
72
AC_MSG_CHECKING([for --enable-universalsdk])
72
73
AC_ARG_ENABLE(universalsdk,
73
74
AC_HELP_STRING(--enable-universalsdk@<:@=SDKDIR@:>@, Build against Mac OS X 10.4u SDK (ppc/i386)),
77
78
enableval=/Developer/SDKs/MacOSX10.4u.sdk
79
if test ! -d "${enableval}"
86
91
UNIVERSALSDK=$enableval
92
if test ! -d "${UNIVERSALSDK}"
94
AC_MSG_ERROR([--enable-universalsdk specifies non-existing SDK: ${UNIVERSALSDK}])
91
101
enable_universalsdk=
103
if test -n "${UNIVERSALSDK}"
105
AC_MSG_RESULT(${UNIVERSALSDK})
93
109
AC_SUBST(UNIVERSALSDK)
95
111
AC_SUBST(ARCH_RUN_32BIT)
97
113
UNIVERSAL_ARCHS="32-bit"
114
AC_SUBST(LIPO_32BIT_FLAGS)
115
AC_SUBST(LIPO_64BIT_FLAGS)
116
AC_SUBST(UNIVERSAL_ARCH32_FLAGS)
117
AC_SUBST(UNIVERSAL_ARCH64_FLAGS)
98
118
AC_MSG_CHECKING(for --with-universal-archs)
99
119
AC_ARG_WITH(universal-archs,
100
120
AC_HELP_STRING(--with-universal-archs=ARCH, select architectures for universal build ("32-bit", "64-bit", "3-way", "intel" or "all")),
160
180
PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
161
181
FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
162
182
FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure bininstall maninstall"
163
if test "$UNIVERSAL_ARCHS" = "all"
183
case "${UNIVERSAL_ARCHS}" in
165
185
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkinstallunixtools4way"
166
186
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkaltinstallunixtools4way"
168
189
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
169
190
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
172
194
if test "x${prefix}" = "xNONE" ; then
173
195
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
262
284
# On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
263
285
# even though select is a POSIX function. Reported by J. Ribbens.
264
286
# Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
265
OpenBSD/2.* | OpenBSD/3.@<:@0123456789@:>@ | OpenBSD/4.@<:@0123@:>@)
287
# In addition, Stefan Krah confirms that issue #1244610 exists through
288
# OpenBSD 4.6, but is fixed in 4.7.
289
OpenBSD/2.* | OpenBSD/3.@<:@0123456789@:>@ | OpenBSD/4.@<:@0123456@:>@)
266
290
define_xopen_source=no
267
291
# OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
268
292
# also defined. This can be overridden by defining _BSD_SOURCE
269
293
# As this has a different meaning on Linux, only define it on OpenBSD
270
294
AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features])
296
OpenBSD/4.@<:@789@:>@)
297
# OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
298
# also defined. This can be overridden by defining _BSD_SOURCE
299
# As this has a different meaning on Linux, only define it on OpenBSD
300
AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features])
272
302
# Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of
273
303
# _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by
300
330
# has no effect, don't bother defining them
301
331
Darwin/@<:@6789@:>@.*)
302
332
define_xopen_source=no;;
333
Darwin/1@<:@0-9@:>@.*)
334
define_xopen_source=no;;
303
335
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
304
336
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
305
337
# or has another value. By not (re)defining it, the defaults come in place.
921
953
# -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
922
954
# used to be here, but non-Apple gcc doesn't accept them.
925
956
if test "${enable_universalsdk}"; then
926
957
UNIVERSAL_ARCH_FLAGS=""
927
958
if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
928
960
UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
931
962
elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
963
ARCH_RUN_32BIT="true"
932
964
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
933
ARCH_RUN_32BIT="true"
935
966
elif test "$UNIVERSAL_ARCHS" = "all" ; then
967
ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
936
968
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
937
ARCH_RUN_32BIT="arch -i386 -ppc"
969
UNIVERSAL_ARCH32_FLAGS="-arch i386 -arch ppc"
970
UNIVERSAL_ARCH64_FLAGS="-arch x86_64 -arch ppc64"
971
LIPO_32BIT_FLAGS="-extract i386 -extract ppc7400"
972
LIPO_64BIT_FLAGS="-extract x86_64 -extract ppc64"
939
974
elif test "$UNIVERSAL_ARCHS" = "intel" ; then
975
ARCH_RUN_32BIT="/usr/bin/arch -i386"
940
976
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
941
ARCH_RUN_32BIT="arch -i386"
977
UNIVERSAL_ARCH32_FLAGS="-arch i386"
978
UNIVERSAL_ARCH64_FLAGS="-arch x86_64"
979
LIPO_32BIT_FLAGS="-extract i386"
980
LIPO_64BIT_FLAGS="-extract x86_64"
943
982
elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
983
ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
944
984
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
945
ARCH_RUN_32BIT="arch -i386 -ppc"
985
UNIVERSAL_ARCH32_FLAGS="-arch i386 -arch ppc"
986
UNIVERSAL_ARCH64_FLAGS="-arch x86_64"
987
LIPO_32BIT_FLAGS="-extract i386 -extract ppc7400"
988
LIPO_64BIT_FLAGS="-extract x86_64"
948
991
AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way])
980
1023
cur_target='10.5'
983
if test `arch` = "i386"; then
1026
if test `/usr/bin/arch` = "i386"; then
984
1027
# On Intel macs default to a deployment
985
1028
# target of 10.4, that's the first OSX
986
1029
# release with Intel support.
1448
1491
[The number of bytes in an off_t.])
1450
1493
AC_MSG_CHECKING(whether to enable large file support)
1451
if test "$have_long_long" = yes -a \
1452
"$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
1494
if test "$have_long_long" = yes
1496
if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
1453
1497
"$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
1454
1498
AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
1455
1499
[Defined to enable large file support when an off_t is bigger than a long
1565
1612
if test "${enable_universalsdk}"; then
1568
LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `arch`"
1615
LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `/usr/bin/arch`"
1570
1617
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1571
1618
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
1573
gcc_version=`gcc -v 2>&1 | grep version | cut -d\ -f3`
1620
gcc_version=`gcc -dumpversion`
1574
1621
if test ${gcc_version} '<' 4.0
1576
1623
LIBTOOL_CRUFT="-lcc_dynamic"
2653
2700
# On Tru64, chflags seems to be present, but calling it will
2655
AC_MSG_CHECKING(for chflags)
2702
AC_CACHE_CHECK([for chflags], [ac_cv_have_chflags], [dnl
2657
2704
#include <sys/stat.h>
2658
2705
#include <unistd.h>
2659
2706
int main(int argc, char*argv[])
2665
],AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
2712
]], ac_cv_have_chflags=yes,
2713
ac_cv_have_chflags=no,
2714
ac_cv_have_chflags=cross)
2716
if test "$ac_cv_have_chflags" = cross ; then
2717
AC_CHECK_FUNC([chflags], [ac_cv_have_chflags="yes"], [ac_cv_have_chflags="no"])
2719
if test "$ac_cv_have_chflags" = yes ; then
2720
AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
2670
AC_MSG_CHECKING(for lchflags)
2723
AC_CACHE_CHECK([for lchflags], [ac_cv_have_lchflags], [dnl
2672
2725
#include <sys/stat.h>
2673
2726
#include <unistd.h>
2674
2727
int main(int argc, char*argv[])
2680
],AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
2733
]], ac_cv_have_lchflags=yes,
2734
ac_cv_have_lchflags=no,
2735
ac_cv_have_lchflags=cross)
2737
if test "$ac_cv_have_lchflags" = cross ; then
2738
AC_CHECK_FUNC([lchflags], [ac_cv_have_lchflags="yes"], [ac_cv_have_lchflags="no"])
2740
if test "$ac_cv_have_lchflags" = yes ; then
2741
AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
2685
2744
dnl Check if system zlib has *Copy() functions
3499
3559
[readline/readline.h],
3500
3560
AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1,
3501
3561
[Define if you have readline 2.2]), )
3562
AC_EGREP_HEADER([extern int rl_completion_suppress_append;],
3563
[readline/readline.h],
3564
AC_DEFINE(HAVE_RL_COMPLETION_SUPPRESS_APPEND, 1,
3565
[Define if you have rl_completion_suppress_append]), )
3504
3568
# check for readline 4.0
3837
3901
THREADHEADERS="$THREADHEADERS \$(srcdir)/$h"
3904
if test $ac_sys_system = Darwin
3906
LIBS="$LIBS -framework CoreFoundation"
3840
3911
AC_SUBST(SRCDIRS)
3841
3912
SRCDIRS="Parser Grammar Objects Python Modules Mac"
3842
3913
AC_MSG_CHECKING(for build directories)