Skip to contentSkip to conversation

package/php: Add -lpthread to detect unixodbc for static build

PATCH New Bernd Kuhls 2 participants 2 messages May 30, 2015 – May 31, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/php: Add -lpthread to detect unixodbc for static build

Fixes
http://autobuild.buildroot.net/results/157/157749f8b44bc02fbed0232a2b33137aba495134/
http://autobuild.buildroot.net/results/df4/df4e2ea098b0126867455af1891837c6d7d99a92/

---
 package/php/php.mk |    3 +++
 1 file changed, 3 insertions(+)
package/php/php.mk +3 -0
index 9be07d5..8e79c49 100644
@@ -225,6 +225,9 @@ endif
 ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_UNIXODBC),y)
 PHP_CONF_OPTS += --with-pdo-odbc=unixODBC,$(STAGING_DIR)/usr
 PHP_DEPENDENCIES += unixodbc
+ifeq ($(BR2_STATIC_LIBS),y)
+PHP_CONF_ENV += LIBS='-lpthread'
+endif
 endif
 endif
 
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 package/php: Add -lpthread to detect unixodbc for static build

Dear Bernd Kuhls,

Quoted 14 lines · Bernd Kuhls

Fixes
http://autobuild.buildroot.net/results/157/157749f8b44bc02fbed0232a2b33137aba495134/
http://autobuild.buildroot.net/results/df4/df4e2ea098b0126867455af1891837c6d7d99a92/

---
 package/php/php.mk |    3 +++
 1 file changed, 3 insertions(+)
package/php/php.mk +0 -0
index 9be07d5..8e79c49 100644

package/php/php.mk endif · line 229

Quoted 5 lines
package/php/php.mk +2 -0
@@ -225,6 +225,9 @@ endif
 ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_UNIXODBC),y)
 PHP_CONF_OPTS += --with-pdo-odbc=unixODBC,$(STAGING_DIR)/usr
 PHP_DEPENDENCIES += unixodbc
+ifeq ($(BR2_STATIC_LIBS),y)
+PHP_CONF_ENV += LIBS='-lpthread'

What happens if you have multiple of such occurrences? You will pass LIBS='-lfoo' LIBS='-lbar', etc.

Shouldn't we instead do:

PHP_LIBS += -lpthread

and then later, a single PHP_CONF_ENV += LIBS=$(PHP_LIBS)

Also, it's a shame unixodbc doesn't use pkg-config. It installs its own odbc-config, but I guess it's compiled for the target, and most likely returns results that are inappropriate for cross compilation.

Thomas

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