Skip to contentSkip to conversation

Build Python with tzset support

PATCH Superseded Henry Margies 2 participants 7 messages Jul 8, 2014 – Jul 15, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Build Python with tzset support

This patch adds support for time.tzset() in Python 2.7.

The Python configure script sets ac_cv_working_tzset to 'no' when cross compiling, although it should be available and work with all toolchains supported by Buildroot (?).
The patch below pre-sets the variable so that time.tzset() works.

---
 package/python/python.mk |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
package/python/python.mk +2 -1
index cb54e3e..b237848 100644
@@ -121,7 +121,8 @@ endif
 PYTHON_CONF_ENV += \
 	ac_cv_have_long_long_format=yes \
 	ac_cv_file__dev_ptmx=yes \
-	ac_cv_file__dev_ptc=yes
+	ac_cv_file__dev_ptc=yes \
+	ac_cv_working_tzset=yes
 
 PYTHON_CONF_OPT += \
 	--without-cxx-main 	\
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH 1/1 Build Python with tzset support

Dear Henry Margies,

Quoted 11 lines · Henry Margies

This patch adds support for time.tzset() in Python 2.7.

The Python configure script sets ac_cv_working_tzset to 'no' when cross compiling, although it should be available and work with all toolchains supported by Buildroot (?).
The patch below pre-sets the variable so that time.tzset() works.

---
 package/python/python.mk |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Looks good to me:

However, it would be nice to also submit a similar patch for the python3 package. Also, we should really audit all the AC_RUN_IFELSE() invocation from Python configure.ac script to see which cache variables should be prefilled from the pyhon{3,}.mk.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 Build Python with tzset support

Hi Thomas,

thanks for the review.

Quoted 4 lines · Thomas Petazzoni

However, it would be nice to also submit a similar patch for the python3 package. Also, we should really audit all the AC_RUN_IFELSE() invocation from Python configure.ac script to see which cache variables should be prefilled from the pyhon{3,}.mk.

I will create and send a separate patch for Python3 tomorrow. I just tried it on my test system and it works ok. The tzset-check is actually the same in Python 2.7 and 3.

And I also agree that it would be nice to check the configure script, pity it is such a long one :) I?ll have a look tomorrow to see if I can spot anything obvious.

Best regards,

Henry

#3 lore raw

PATCH 1/1 Build Python with tzset support

I?ve sent a new version of my patch for Python 2.7 and 3, instead of a separate one just for Python3. Hope that?s easier.

Quoted 1 line

And I also agree that it would be nice to check the configure script, pity it is such a long one :) I?ll have a look tomorrow to see if I can spot anything obvious.

On the topic of AC_RUN_IFELSE, the configure script sets the following variables to these defaults when cross-compiling:

ac_cv_pthread_is_default=no
ac_cv_kpthread=no
ac_cv_kthread=no
ac_cv_pthread=no
ac_cv_pthread_system_supported=no
ac_cv_little_endian_double=no
ac_cv_big_endian_double=no
ac_cv_mixed_endian_double=no
ac_cv_x87_double_rounding=no
ac_cv_log1p_drops_zero_sign=no
ac_cv_posix_semaphores_enabled=yes
ac_cv_broken_sem_getvalue=yes
ac_cv_wchar_t_signed=yes
ac_cv_rshift_extends_sign=yes
ac_cv_broken_nice=no
ac_cv_broken_poll=no
ac_cv_working_tzset=no
ac_cv_have_long_long_format="cross -- assumming no? (set to yes by buildroot) ac_cv_have_size_t_format="cross -- assuming yes" ac_cv_broken_mbstowcs=no
have_glibc_memmove_bug=undefined have_ipa_pure_const_bug=undefined
ac_cv_buggy_getaddrinfo=yes unless configured with --(en|dis)able-ipv6

I suppose the pthread detection may not matter so much as the appropriate flags are probably set in environment variables?

Anyway, I thought I post it here so people can see and comment.

Best regards,
Henry

#4 lore raw

PATCH v2 1/1 Build Python with tzset support

In reply to Henry Margies

This patch adds support for time.tzset() in Python2.7 and Python3.

The Python configure script sets ac_cv_working_tzset to 'no' when cross compiling, although it should be available and work with all toolchains supported by Buildroot (?).
The patch below pre-sets the variable so that time.tzset() works.

---
Changes v1 -> v2:
- added similar patch for Python3

 package/python/python.mk   |    3 ++-
 package/python3/python3.mk |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)
package/python/python.mk +2 -1
index cb54e3e..b237848 100644
@@ -121,7 +121,8 @@ endif
 PYTHON_CONF_ENV += \
 	ac_cv_have_long_long_format=yes \
 	ac_cv_file__dev_ptmx=yes \
-	ac_cv_file__dev_ptc=yes
+	ac_cv_file__dev_ptc=yes \
+	ac_cv_working_tzset=yes
 
 PYTHON_CONF_OPT += \
 	--without-cxx-main 	\
package/python3/python3.mk +1 -0
index 98fc31b..1591ac9 100644
@@ -96,6 +96,7 @@ PYTHON3_CONF_ENV += \
 	ac_cv_have_long_long_format=yes \
 	ac_cv_file__dev_ptmx=yes \
 	ac_cv_file__dev_ptc=yes \
+	ac_cv_working_tzset=yes
 
 PYTHON3_CONF_OPT += \
 	--without-ensurepip	\
Signature · 1 line
1.7.2.5
#5 lore raw

PATCH v2 1/1 Build Python with tzset support

Hi all,

any comments on my patch? Please let me know if there is something wrong with it or whether I sent it the wrong way?

Best regards & a nice weekend,

Henry

Quoted 46 lines · Henry Margies

This patch adds support for time.tzset() in Python2.7 and Python3.

The Python configure script sets ac_cv_working_tzset to 'no' when cross compiling, although it should be available and work with all toolchains supported by Buildroot (?).
The patch below pre-sets the variable so that time.tzset() works.

---
Changes v1 -> v2:
- added similar patch for Python3

package/python/python.mk   |    3 ++-
package/python3/python3.mk |    1 +
2 files changed, 3 insertions(+), 1 deletions(-)
package/python/python.mk +2 -1
index cb54e3e..b237848 100644
@@ -121,7 +121,8 @@ endif
 PYTHON_CONF_ENV += \
 	ac_cv_have_long_long_format=yes \
 	ac_cv_file__dev_ptmx=yes \
-	ac_cv_file__dev_ptc=yes
+	ac_cv_file__dev_ptc=yes \
+	ac_cv_working_tzset=yes
 
 PYTHON_CONF_OPT += \
 	--without-cxx-main 	\
package/python3/python3.mk +1 -0
index 98fc31b..1591ac9 100644
@@ -96,6 +96,7 @@ PYTHON3_CONF_ENV += \
 	ac_cv_have_long_long_format=yes \
 	ac_cv_file__dev_ptmx=yes \
 	ac_cv_file__dev_ptc=yes \
+	ac_cv_working_tzset=yes
 
 PYTHON3_CONF_OPT += \
 	--without-ensurepip	\
Signature · 1 line
1.7.2.5
#6 lore raw

PATCH v2 1/1 Build Python with tzset support

In reply to Henry Margies

Dear Henry Margies,

Quoted 8 lines · Henry Margies

This patch adds support for time.tzset() in Python2.7 and Python3.

The Python configure script sets ac_cv_working_tzset to 'no' when cross compiling, although it should be available and work with all toolchains supported by Buildroot (?).
The patch below pre-sets the variable so that time.tzset() works.

Quoted 4 lines

---
Changes v1 -> v2:
- added similar patch for Python3

Applied, thanks. I've adjusted a bit the commit title, as the normal format is:

<package>: <what's happening>

Ideally, two separate patches, one for Python 2 and one for Python 3 would have been better, but ok for this time.

Thanks for your contribution!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com