Bug 697 - Get PY_MAJOR_VERSION failure at configure
Get PY_MAJOR_VERSION failure at configure
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
1.5.4
Sun other
: P5 normal
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-25 15:56 CEST by Kunitaka Namba
Modified: 2015-08-28 08:57 CEST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kunitaka Namba 2015-08-25 15:56:47 CEST
configure Error:

checking for pthread_spinlock_t... yes
checking for pthread_rwlock_t... yes
./configure: line 15901: syntax error at line 16104: `(' unexpected


configure:

  16099    if test ! -z "$PYTHON_VERSION"; then
  16100         if test `$PYTHON -c "print('$PYTHON_VERSION' >= '2.4.0')"` = "False"; then
  16101                 as_fn_error $? "Python version >= 2.4.0 is required" "$LINENO" 5
  16102         fi
  16103
  16104       PY_MAJOR_VERSION="`$PYTHON -c "import sys; print(sys.version_info.major)"`"
  16105
  16106       # Have Python

Python 2.4 to 2.6 can not use "sys.version_info.major",
Better it was changed to "sys.version_info[0]"

https://docs.python.org/2.7/library/sys.html#sys.version_info

Changed in version 2.7: Added named component attributes


$ diff configure configure.org
16104c16104
<       PY_MAJOR_VERSION="`$PYTHON -c \"import sys; print(sys.version_info[0])\"`"
---
>       PY_MAJOR_VERSION="`$PYTHON -c "import sys; print(sys.version_info.major)"`"
Comment 1 Wouter Wijngaards 2015-08-28 08:57:15 CEST
Hi Kunitaka,

Thank you for the fix!  I did not know the python version numbering had changed.
I have applied the change to the source.

Best regards, Wouter