[freetds] COMPILATION UNDER QNX 4.25

GUTIERREZ Pablo TESIS-TAMSA Tesgup at tamsa.com.mx
Sat Jul 19 20:06:44 EDT 2003


Hi James,
I think that "defined (__WATCOMC__)" is necessary because this patches are
targeted only to QNX 4 (WATCOM COMPILER is the only compiler available for
QNX4 - QNX4 and Watcom compiler are very linked). 

QNX 6 (the newest QNX) is completely different. Headers are different and it
comes with a non-watcom compiler (and it also supports gnu compilers).
(WATCOM stopped producing QNX compilers). If a QNX6 user tries to compile
freetds it will match __QNX__ and the compilation will fail when trying to
use a WATCOM function (such as _bprintf)

Unluckily QNX4 doesn't have autoconf, nor there is a port for it as far as I
know. QNX4 is not UNIX, is a microkernel OS, with some UNIX libraries (it
doesn't even have a bash shell, only a modified korn shell)
What's more for making the patch that I posted minutes ago, I had to port
gnu diff first, since QNX diff is very limited (no context information, and
no patch application)

I hope these long paragraphs didn't bore you. ;-)
For those reasons I wont be able to generate a configure script.

Regards,
pablo
-----Original Message-----
From: James K. Lowden [mailto:jklowden at schemamania.org] 
Sent: Saturday, July 19, 2003 5:35 PM
To: FreeTDS Development Group
Subject: Re: [freetds] COMPILATION UNDER QNX 4.25

On Sat, 19 Jul 2003 16:18:00 -0500, GUTIERREZ Pablo TESIS-TAMSA
<Tesgup at tamsa.com.mx> wrote:
> 
> 1) I'll send you a patch for to include <select.h> if appropriated.

Got it, thanks! 

> 2) The problem is that even when I already made 
> 
> #if defined (__QNX__) && defined (__WATCOMC__)
> # define vsnprintf _vbprintf
> # define  snprintf  _bprintf
> #endif /* QNX */

You don't need "&& defined (__WATCOMC__)" if QNX is providing the
functions.  

> ./configure says that the function vsnprintf() is not present, so
> ./include/config.h doesn't define HAVE_VSNPRINTF => All the code that
> use vsnprintf is not compiled.
> What can I do?

Ah, that makes sense, and makes the test more complex.  First, we need
./configure to look for _bprintf and _vbprintf.  I added that to
configure.in.  Can you generate your own configure script?  You need:

$ (autoconf --version; automake --version; libtool --version) |grep GNU
autoconf (GNU Autoconf) 2.57
automake (GNU automake) 1.7.3
ltmain.sh (GNU libtool) 1.4a (1.641.2.255 2001/05/22 10:39:30)

Our test becomes something like:

#if defined (__QNX__) 
# if !HAVE_VSNPRINTF && HAVE__VBPRINTF
#  define vsnprintf _vbprintf
# endif /* vsnprintf */
# if !HAVE_SNPRINTF && HAVE__BPRINTF
#  define  snprintf  _bprintf
# endif /* snprintf */
#endif /* QNX */

That's a little pedantic, but it is what we're testing.  If someone
else is using QNX with another libc, the above won't interfere.  

--jkl
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds


More information about the FreeTDS mailing list