package/unixodbc: new package
PATCH v3 1/1 package/unixodbc: new package
---
v3: fixes thread detection on non-threaded toolchains (Gustavo)
v2: various changes suggested by Thomas
- added license stuff
- added --disable- options, removed indentions
- removed UNIXODBC_REMOVE_TARGET_BINS_FROM_STAGING originally needed by apr-util because its configure script tries to call bin/odbc_config from staging dir which fails because this file is compiled for target. A fix was added to the apr-util package.
package/Config.in | 1 + package/unixodbc/0001-fix-nopthread.patch | 39 +++++++++++++++++++++++++++++ package/unixodbc/Config.in | 7 ++++++ package/unixodbc/unixodbc.hash | 2 ++ package/unixodbc/unixodbc.mk | 30 ++++++++++++++++++++++ 5 files changed, 79 insertions(+) create mode 100644 package/unixodbc/0001-fix-nopthread.patch create mode 100644 package/unixodbc/Config.in create mode 100644 package/unixodbc/unixodbc.hash create mode 100644 package/unixodbc/unixodbc.mk
package/Config.in +1 -0
@@ -674,6 +674,7 @@ menu "Database" source "package/redis/Config.in" source "package/sqlcipher/Config.in" source "package/sqlite/Config.in" + source "package/unixodbc/Config.in" endmenu menu "Filesystem"
package/unixodbc/0001-fix-nopthread.patch new file +39 -0
@@ -0,0 +1,39 @@ +Fix pthread detection + +configure.in always calls AC_CHECK_COMP_OPT(pthread) which succeeds with the +toolchain used although it does not contain thread support: + +checking for mutex_lock in -lthread ... no +checking for pthread_mutex_lock in -lpthread... no +checking for pthread_mutex_lock in -lc... no +checking if compiler accepts -pthread... yes +checking for pthread_mutex_lock in -lc... no +checking for pthread_mutex_lock in -lpthread... no + +This positive configure check leads to + + CFLAGS="$CFLAGS -pthread" + +in ./configure, line 15757 which causes a compilation bug +/home/br/br4/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.8.3/../../../../arm-buildroot-linux-uclibcgnueab + +using this defconfig +http://autobuild.buildroot.net/results/e86/e86e97ff7887f1bdc6bf913498392ff50f56ea88/defconfig + +This patch disables the freebsd-only code path. Patching configure directly +prevents the need for autoreconf. + +Signed-off-by: Bernd Kuhls <[email protected]> + +diff -uNr unixODBC-2.3.2.org/configure unixODBC-2.3.2/configure +--- unixODBC-2.3.2.org/configure 2013-10-08 10:56:03.000000000 +0200 ++++ unixODBC-2.3.2/configure 2015-03-13 21:19:59.210429211 +0100 +@@ -15746,7 +15746,7 @@ + + fi + +- if test "x$gotthread" = "xno"; then ++ if test "x$gotthread" = "xnot_needed_for_buildroot"; then + if test "x$ac_cv_c_compiler_gnu" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -pthread" >&5 + $as_echo_n "checking if compiler accepts -pthread... " >&6; }
package/unixodbc/Config.in new file +7 -0
@@ -0,0 +1,7 @@ +config BR2_PACKAGE_UNIXODBC + bool "unixodbc" + help + The unixODBC Project goals are to develop and promote unixODBC + to be the definitive standard for ODBC on non MS Windows platforms. + + http://www.unixodbc.org
package/unixodbc/unixodbc.hash new file +2 -0
@@ -0,0 +1,2 @@ +# From ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.2.tar.gz.md5 +md5 5e4528851eda5d3d4aed249b669bd05b unixODBC-2.3.2.tar.gz
package/unixodbc/unixodbc.mk new file +30 -0
@@ -0,0 +1,30 @@ +################################################################################ +# +# unixodbc +# +################################################################################ + +UNIXODBC_VERSION = 2.3.2 +UNIXODBC_SOURCE = unixODBC-$(UNIXODBC_VERSION).tar.gz +UNIXODBC_SITE = ftp://ftp.unixodbc.org/pub/unixODBC +UNIXODBC_INSTALL_STAGING = YES +UNIXODBC_LICENSE = LGPLv2.1+ (library), GPLv2+ (programs) +UNIXODBC_LICENSE_FILES = COPYING exe/COPYING + +UNIXODBC_CONF_OPTS = --enable-drivers --enable-driver-conf + +ifeq ($(BR2_PACKAGE_LIBICONV),y) +UNIXODBC_CONF_OPTS += --enable-iconv +UNIXODBC_DEPENDENCIES += libiconv +else +UNIXODBC_CONF_OPTS += --disable-iconv +endif + +ifeq ($(BR2_PACKAGE_READLINE),y) +UNIXODBC_CONF_OPTS += --enable-readline +UNIXODBC_DEPENDENCIES += readline +else +UNIXODBC_CONF_OPTS += --disable-readline +endif + +$(eval $(autotools-package))
Signature · 1 line
1.7.10.4
PATCH v3 1/1 package/unixodbc: new package
Dear Bernd Kuhls,
Quoted 22 lines · Bernd Kuhls
package/unixodbc/0001-fix-nopthread.patch new file +16
-0@@ -0,0 +1,39 @@ +Fix pthread detection + +configure.in always calls AC_CHECK_COMP_OPT(pthread) which succeeds with the +toolchain used although it does not contain thread support: + +checking for mutex_lock in -lthread ... no +checking for pthread_mutex_lock in -lpthread... no +checking for pthread_mutex_lock in -lc... no +checking if compiler accepts -pthread... yes +checking for pthread_mutex_lock in -lc... no +checking for pthread_mutex_lock in -lpthread... no + +This positive configure check leads to + + CFLAGS="$CFLAGS -pthread" +
package/unixodbc/0001-fix-nopthread.patch line 26
Quoted 10 lines
package/unixodbc/0001-fix-nopthread.patch new file +10
-0+in ./configure, line 15757 which causes a compilation bug +/home/br/br4/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.8.3/../../../../arm-buildroot-linux-uclibcgnueab + +using this defconfig +http://autobuild.buildroot.net/results/e86/e86e97ff7887f1bdc6bf913498392ff50f56ea88/defconfig + +This patch disables the freebsd-only code path. Patching configure directly +prevents the need for autoreconf. + +Signed-off-by: Bernd Kuhls <[email protected]>
Hum, could we instead get a solution that could potentially be upstreamed? Like using AC_CACHE_CHECK(), or something like that.
Also, any reason to patch configure directly? We normally don't do that, and always prefer to patch configure.{in,ac}.
That being said, if you don't care about no-thread support in unixodbc, I would personally be fine if you decided to add 'depends on BR2_TOOLCHAIN_HAS_THREADS' in Config.in.
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v3 1/1 package/unixodbc: new package
Hi,
Thomas Petazzoni <thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8 @public.gmane.org> wrote in news:20150313220351.5dce9aa3 at free-electrons.com:
Quoted 2 lines
Hum, could we instead get a solution that could potentially be upstreamed? Like using
AC_CACHE_CHECK(), or something like that.
this is beyond my capabilities, but maybe it is not needed...
Quoted 2 lines
Also, any reason to patch configure directly? We normally don't do that, and always prefer to patch configure.{in,ac}.
Yes, autoreconf would need to patch Makefile.am so I chose not to go this way.
Quoted 3 lines
That being said, if you don't care about no-thread support in unixodbc, I would personally be fine if you decided to add 'depends on
BR2_TOOLCHAIN_HAS_THREADS' in Config.in.
Ok, will send a patch in the next days. I just wanted to include the package with as few dependencies as possible.
Regards, Bernd
PATCH v3 1/1 package/unixodbc: new package
Dear Bernd Kuhls,
Quoted 6 lines · Bernd Kuhls
Quoted 3 lines
That being said, if you don't care about no-thread support in unixodbc, I would personally be fine if you decided to add 'depends on
BR2_TOOLCHAIN_HAS_THREADS' in Config.in.Ok, will send a patch in the next days. I just wanted to include the package with as few dependencies as possible.
Well, in the end, I applied your patch by mistake. So now it's in. Lucky you :)
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com