The build of sqlite-3.7.13 fails to build with gcc2-.95.3 on a recent
Haiku nightly build, near line 2650 of shell.c probably from this
change:
http://www.sqlite.org/cgi/src/info/93a0f452a7

Here's the error:
libtool: link: gcc -shared  .libs/sqlite3.o    -O2   -Wl,-soname
-Wl,libsqlite3.so.0 -o .libs/libsqlite3.so.0.8.6
libtool: link: (cd ".libs" && rm -f "libsqlite3.so.0" && ln -s
"libsqlite3.so.0.8.6" "libsqlite3.so.0")
libtool: link: (cd ".libs" && rm -f "libsqlite3.so" && ln -s
"libsqlite3.so.0.8.6" "libsqlite3.so")
libtool: link: ar cru .libs/libsqlite3.a  sqlite3.o
libtool: link: ranlib .libs/libsqlite3.a
libtool: link: ( cd ".libs" && rm -f "libsqlite3.la" && ln -s
"../libsqlite3.la" "libsqlite3.la" )
source='shell.c' object='shell.o' libtool=no \
DEPDIR=.deps depmode=gcc /bin/sh ./depcomp \
gcc -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\"
-DPACKAGE_VERSION=\"3.7.13\" -DPACKAGE_STRING=\"sqlite\ 3.7.13\"
-DPACKAGE_BUGREPORT=\"http://www.sqlite.org\"; -DPACKAGE_URL=\"\"
-DPACKAGE=\"sqlite\" -DVERSION=\"3.7.13\" -DSTDC_HEADERS=1
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1
-DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1
-DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_USLEEP=1
-DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1
-DHAVE_STRERROR_R=1 -DHAVE_READLINE=1 -I.    -D_REENTRANT=1
-DSQLITE_THREADSAFE=1  -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g
-O2 -c shell.c
/boot/common/develop/haikuports/dev-db/sqlite/work/sqlite-autoconf-3071300/shell.c:
In function `find_home_dir':
/boot/common/develop/haikuports/dev-db/sqlite/work/sqlite-autoconf-3071300/shell.c:2700:
parse error before `struct'
/boot/common/develop/haikuports/dev-db/sqlite/work/sqlite-autoconf-3071300/shell.c:2702:
`pwent' undeclared (first use in this function)
/boot/common/develop/haikuports/dev-db/sqlite/work/sqlite-autoconf-3071300/shell.c:2702:
(Each undeclared identifier is reported only once
/boot/common/develop/haikuports/dev-db/sqlite/work/sqlite-autoconf-3071300/shell.c:2702:
for each function it appears in.)
/boot/common/develop/haikuports/dev-db/sqlite/work/sqlite-autoconf-3071300/shell.c:2702:
`uid' undeclared (first use in this function)
make: *** [shell.o] Error 1

Moving the line:

  if( home_dir ) return home_dir;

past this line:

 struct passwd *pwent;

fixes the build.  Gcc2 seems to like all variable definitions to
happen at the top of a block, so it's not happy when the if statement
comes before passwd is defined.

sqlite-3.7.13 builds just fine without any patches on a Gcc4 Haiku.  I
have added this patch to haikuports to allow for building
sqlite-3.7.13 on Haiku:

http://ports.haiku-files.org/browser//haikuports/trunk/dev-db/sqlite/patches/sqlite-3.7.13.patch

Please consider this change, or something similar for applying to
sqlite's code, as this would probably affect any others who try to
build with gcc2.95.3 or earlier.
-scottmc

Scott McCreary
(with Haikuports and Haiku)
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to