php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41870 PDO_ODBC module linking fails with iODBC
Submitted: 2007-07-02 09:43 UTC Modified: 2007-07-09 11:14 UTC
From: roman dot vanicek at gmail dot com Assigned:
Status: Closed Package: PDO related
PHP Version: 5.2.3 OS: Ubuntu Linux 6.06
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: roman dot vanicek at gmail dot com
New email:
PHP Version: OS:

 

 [2007-07-02 09:43 UTC] roman dot vanicek at gmail dot com
Description:
------------
I want to compile PHP with PDO_ODBC against iODBC.

Configure settings:
--with-pdo-odbc=generic,/usr,iodbc

Configure works fine, compilation too but during the linking phase, i am getting this error:

/bin/sh: -c: line 0: syntax error near unexpected token `('

The problem is in the Makfile generated by configure. The parantheses probably need to be quoted (or not used at all).

If I change these parameters (3 times in the Makefile)

-DPDO_ODBC_TYPE=\"generic (iodbc)\"

manually to 

-DPDO_ODBC_TYPE=\"generic-iodbc\"

then it works like a charm :-)

Probably it would be best to fix the code that generates the Makefile without parantheses ("generic","generic-iodbc" works, on the other hand "generic - iodbc","generic iodbc" does not work).


Reproduce code:
---------------
./configure --with-pdo-odbc=generic,/usr,iodbc
make


Expected result:
----------------
Build complete.

Actual result:
--------------
/bin/sh /root/build/php/php-5.2.3/libtool --silent --preserve-dup-deps --mode=compile gcc -I/root/build/php/php-5.2.3/ext  -I/usr/include -DPDO_ODBC_TYPE=\"generic (iodbc)\" -Iext/pdo_odbc/ -I/root/build/php/php-5.2.3/ext/pdo_odbc/ -DPHP_ATOM_INC -I/root/build/php/php-5.2.3/include -I/root/build/php/php-5.2.3/main -I/root/build/php/php-5.2.3 -I/usr/include/libxml2 -I/root/build/php/php-5.2.3/ext/date/lib -I/usr/include/freetype2 -I/root/build/php/php-5.2.3/ext/mbstring/oniguruma -I/root/build/php/php-5.2.3/ext/mbstring/libmbfl -I/root/build/php/php-5.2.3/ext/mbstring/libmbfl/mbfl -I/usr/local/lib/oracli/sdk/include -I/root/build/bin/freetds/include -I/root/build/php/php-5.2.3/TSRM -I/root/build/php/php-5.2.3/Zend    -I/usr/include -g -O2  -c /root/build/php/php-5.2.3/ext/pdo_odbc/pdo_odbc.c -o ext/pdo_odbc/pdo_odbc.lo
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `/bin/sh /root/build/php/php-5.2.3/libtool --silent --preserve-dup-deps --mode=compile gcc -I/root/build/php/php-5.2.3/ext  -I/usr/include -DPDO_ODBC_TYPE=\"generic (iodbc)\" -Iext/pdo_odbc/ -I/root/build/php/php-5.2.3/ext/pdo_odbc/ -DPHP_ATOM_INC -I/root/build/php/php-5.2.3/include -I/root/build/php/php-5.2.3/main -I/root/build/php/php-5.2.3 -I/usr/include/libxml2 -I/root/build/php/php-5.2.3/ext/date/lib -I/usr/include/freetype2 -I/root/build/php/php-5.2.3/ext/mbstring/oniguruma -I/root/build/php/php-5.2.3/ext/mbstring/libmbfl -I/root/build/php/php-5.2.3/ext/mbstring/libmbfl/mbfl -I/usr/local/lib/oracli/sdk/include -I/root/build/bin/freetds/include -I/root/build/php/php-5.2.3/TSRM -I/root/build/php/php-5.2.3/Zend    -I/usr/include -g -O2  -c /root/build/php/php-5.2.3/ext/pdo_odbc/pdo_odbc.c -o ext/pdo_odbc/pdo_odbc.lo '
make: *** [ext/pdo_odbc/pdo_odbc.lo] Error 2

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-02 11:10 UTC] roman dot vanicek at gmail dot com
Sorry for a small detail, the error appears during the compilation and not the linking - i was a bit confused seeing libtool at the beginning of the line. Apart from this, everything holds true.
 [2007-07-03 06:49 UTC] tony2001@php.net
Try this patch please: http://dev.daylessday.org/diff/bug41870.diff
(don't forget to run ./buildconf after applying it)
 [2007-07-03 09:41 UTC] roman dot vanicek at gmail dot com
Sorry, your patch does not work. It seems that comma is a problem for the constant PDO_ODBC_TYPE. The result is like this.

/bin/sh /root/build/php/php-5.2.3/libtool --silent --preserve-dup-deps --mode=compile gcc -I/root/build/php/php-5.2.3/ext  -I/usr/include -DPDO_ODBC_TYPE=\"generic, iodbc\" -Iext/pdo_odbc/ -I/root/build/php/php-5.2.3/ext/pdo_odbc/ -DPHP_ATOM_INC -I/root/build/php/php-5.2.3/include -I/root/build/php/php-5.2.3/main -I/root/build/php/php-5.2.3 -I/usr/include/libxml2 -I/root/build/php/php-5.2.3/ext/date/lib -I/root/build/php/php-5.2.3/TSRM -I/root/build/php/php-5.2.3/Zend    -I/usr/include -g -O2  -c /root/build/php/php-5.2.3/ext/pdo_odbc/pdo_odbc.c -o ext/pdo_odbc/pdo_odbc.lo
gcc: iodbc": No such file or directory
/root/build/php/php-5.2.3/ext/pdo_odbc/pdo_odbc.c: In function 'zm_info_pdo_odbc':
/root/build/php/php-5.2.3/ext/pdo_odbc/pdo_odbc.c:162: error: missing terminating " character
/root/build/php/php-5.2.3/ext/pdo_odbc/pdo_odbc.c:162: error: syntax error before string constant
make: *** [ext/pdo_odbc/pdo_odbc.lo] Error 1


I have tried various updates to ext/pdo_odbc/config.m4, but it seems that the file is cached somewhere and it is very difficult to get the changes appear in Makefile.

Any advice is appreciated. But as I have stated earlier, "generic-iodbc" works (no commas,spaces,parantheses).
 [2007-07-03 09:59 UTC] roman dot vanicek at gmail dot com
I propose this patch:

--- /bkp/config.m4     2007-07-03 09:31:27.000000000 +0200
+++ config.m4   2007-07-03 11:49:31.000000000 +0200
@@ -89,7 +89,7 @@
         pdo_odbc_def_lib="`echo $PHP_PDO_ODBC | cut -d, -f3`"
         pdo_odbc_def_ldflags="`echo $PHP_PDO_ODBC | cut -d, -f4`"
         pdo_odbc_def_cflags="`echo $PHP_PDO_ODBC | cut -d, -f5`"
-        pdo_odbc_flavour="$pdo_odbc_flavour ($pdo_odbc_def_lib)"
+        pdo_odbc_flavour="$pdo_odbc_flavour-$pdo_odbc_def_lib"
         ;;

       *)
 [2007-07-09 11:14 UTC] jani@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 08:01:29 2025 UTC