D. Richard Hipp [Wed, Mar 03, 2004 at 09:44:47PM -0500]:
> The patches all seem to be to add '#include "os.h"' right before
> '#include "sqliteInt.h"' at the beginning of every source file.
> 
> (1) Wouldn't it be much easier to just put a single '#include "os.h"'
> at the beginning of sqliteInt.h and be done with it?

Yes, propably. That was my original concept:

        http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=23828
        
Obviously, Chris Pinnock <[EMAIL PROTECTED]> had a better idea. Perhaps you
should ask him, why did he choose this method.

> (2) What is the inclusing of os.h accomplishing?  What is there in
> os.h that the various files need?  I must understand the change
> before I put it in.

pkgsrc.org's configure is called with parameters:
../sqlite/configure --without-tcl --host=i386-pc-freebsd4.9 --prefix=/usr/pkg

and it includes in CFLAGS:
CFLAGS+=                -DUINT32_TYPE=u_int32_t -DUINT16_TYPE=u_int16_t \
                        -DUINT8_TYPE=u_int8_t -DINTPTR_TYPE=long
                        
You could argue if this is the right way to build sqlite or not. I have no
idea, but people, who maintain pkgsrc, claim portability among many other
platforms and machines (recently AMD64 and AIX), so this could make sqlite
build more portable.

Anyway, on FreeBSD-4-STABLE, it breaks in such way, when built like this:

[...]
gcc -O2 -DUINT32_TYPE=u_int32_t -DUINT16_TYPE=u_int16_t
-DUINT8_TYPE=u_int8_t -DINTPTR_TYPE=long -I/usr/include -DOS_UNIX=1
-DOS_WIN=0 -DHAVE_USLEEP=1 -I. -I../sqlite/src -Ino/generic -Ino/unix -c
../sqlite/src/attach.c  -fPIC -DPIC -o .libs/attach.lo
In file included from ../sqlite/src/attach.c:16:
../sqlite/src/sqliteInt.h:116: syntax error before u32'
../sqlite/src/sqliteInt.h:116: warning: data definition has no type or
storage class
../sqlite/src/sqliteInt.h:117: syntax error before u16'
../sqlite/src/sqliteInt.h:117: warning: data definition has no type or
storage class
../sqlite/src/sqliteInt.h:118: syntax error before u8'
../sqlite/src/sqliteInt.h:118: warning: data definition has no type or
storage class
../sqlite/src/sqliteInt.h:255: syntax error before u8'
../sqlite/src/sqliteInt.h:316: syntax error before u8'
../sqlite/src/sqliteInt.h:403: syntax error before u8'
../sqlite/src/sqliteInt.h:460: syntax error before u8'
../sqlite/src/sqliteInt.h:504: syntax error before u8'
../sqlite/src/sqliteInt.h:581: syntax error before u8'
../sqlite/src/sqliteInt.h:638: syntax error before u8'
../sqlite/src/sqliteInt.h:683: syntax error before u8'
../sqlite/src/sqliteInt.h:725: syntax error before u16'
../sqlite/src/sqliteInt.h:808: syntax error before u8'
../sqlite/src/sqliteInt.h:877: syntax error before u8'
../sqlite/src/sqliteInt.h:925: syntax error before u8'
../sqlite/src/attach.c: In function sqliteAttach':
../sqlite/src/attach.c:35: structure has no member named explain'
../sqlite/src/attach.c:37: structure has no member named file_format'
../sqlite/src/attach.c: In function sqliteDetach':
../sqlite/src/attach.c:127: structure has no member named explain'
../sqlite/src/attach.c: In function sqliteFixSrcList':
../sqlite/src/attach.c:208: structure has no member named nSrc'
gmake: *** [attach.lo] Błąd 1
*** Error code 2


Build run without pkgsrc (./congigure && gmake) doesn't break.

The point of those patches? Well, some Linux distributions (and other OS)
automatically #include needed files, some other (like FreeBSD) - don't, so
you should tell them explictly to. That's the whole idea.

-- 
Michal Pasternak :: http://pasternak.w.lub.pl :: http://winsrc.sf.net
"There's so much comedy on television. Does that cause comedy in the streets?" 
        -- Dick Cavett

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to