diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2006-10-19 10:58:46 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2006-10-19 10:58:46 (GMT) |
commit | aac1316222c7e4a073af1634f2eef0a872a3dafb (patch) | |
tree | f200e0b491ba8b0bccc490a116b48763633e0c48 /configure | |
parent | b03c35bac3a17aad776a1ef8e81706cf56412143 (diff) | |
download | cpython-aac1316222c7e4a073af1634f2eef0a872a3dafb.zip cpython-aac1316222c7e4a073af1634f2eef0a872a3dafb.tar.gz cpython-aac1316222c7e4a073af1634f2eef0a872a3dafb.tar.bz2 |
Add check for the PyArg_ParseTuple format, and declare
it if it is supported.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 66 |
1 files changed, 65 insertions, 1 deletions
@@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 52089 . +# From configure.in Revision: 52363 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for python 2.6. # @@ -4036,6 +4036,70 @@ echo "${ECHO_T}$ac_cv_olimit_ok" >&6 fi fi +# Check whether GCC supports PyArg_ParseTuple format +if test "$GCC" = "yes" +then + echo "$as_me:$LINENO: checking whether gcc supports ParseTuple __format__" >&5 +echo $ECHO_N "checking whether gcc supports ParseTuple __format__... $ECHO_C" >&6 + save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Werror" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2))); + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ATTRIBUTE_FORMAT_PARSETUPLE 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + # On some compilers, pthreads are available without further options # (e.g. MacOS X). On some of these systems, the compiler will not # complain if unaccepted options are passed (e.g. gcc on Mac OS X). |