Subject: | Build fails to link against libsqlite3.so when installed in "odd" places |
Building with perl Makefile.PL SQLITE_LOCATION=/opt/THUSsqlite
means that we call:
WriteMakefile (
# ...
LIBS => '-lsqlite3',
'dynamic_lib' => { OTHERLDFLAGS => "-L/opt/THUSsqlite/lib" },
# ...
)
This means that when MakeMaker is hunting the libraries you are asking it to link against, it doesn't look in /opt/THUSsqlite/lib for a libsqlite3.so, and so drops if from the list of things to link against.
This means you end up with a SQLite.so that isn't linked against libsqlite3.so, which obviously doesn't work all that well.
The attached patch works for:
OS sqlite installed in produced by
FreeBSD-4.8-i386 /usr/local us
solaris-8-sparc /opt/THUSsqlite us
solaris-9-sparc /opt/THUSsqlite us
solaris-9-i386 /opt/THUSsqlite us
solaris-10-i386 /opt/thus us
solaris-10-sparc /opt/thus us
redhat-fc4-i386 /usr RedHat
redhat-3as-ia32 /opt/thus us (some tests fail)
In all caseses, SQLITE_LOCATION was passed in.
This is the buildlog showing the problem:
----
Calling configure script for `THUSDBD-SQLite':
+ cd /var/opt/THUSpbuild/pmeta.9917/THUSDBD-SQLite/DBD-SQLite
+ umask 022
+ test -f Makefile.PL
+ /usr/bin/perl Makefile.PL CCFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 OPTIMIZE=-xO3 -xdepend SQLITE_LOCATION=/opt/THUSsqlite
Checking installed SQLite version...
Looks good
Checking if your kit is complete...
Looks good
Note (probably harmless): No library found for -lsqlite3
Using DBI 1.43 (for perl 5.006001 on sun4-solaris-64int) installed in /usr/perl5/site_perl/5.6.1/sun4-solaris-64int/auto/DBI
Writing Makefile for DBD::SQLite
Calling make script for `THUSDBD-SQLite':
+ cd /var/opt/THUSpbuild/pmeta.9917/THUSDBD-SQLite/DBD-SQLite
+ umask 022
+ test -f Makefile
+ /opt/THUSmake/bin/make
cp lib/DBD/SQLite.pm blib/lib/DBD/SQLite.pm
/usr/bin/perl -p -e "s/~DRIVER~/SQLite/g" /usr/perl5/site_perl/5.6.1/sun4-solaris-64int/auto/DBI/Driver.xst > SQLite.xsi
/usr/bin/perl -I/usr/perl5/5.6.1/lib/sun4-solaris-64int -I/usr/perl5/5.6.1/lib /usr/perl5/5.6.1/lib/ExtUtils/xsubpp -typemap /usr/perl5/5.6.1/lib/ExtUtils/typemap SQLite.xs > SQLite.xsc && mv SQLite.xsc SQLite.c
cc -c -I. -I/usr/perl5/site_perl/5.6.1/sun4-solaris-64int/auto/DBI -I/opt/THUSsqlite/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -xdepend -DVERSION=\"1.09\" -DXS_VERSION=\"1.09\" -KPIC -I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE -DNDEBUG=1 -DSQLITE_PTR_SZ=4 SQLite.c
"SQLite.xs", line 43: warning: implicit function declaration: sqlite3_db_create_function
"SQLite.xs", line 54: warning: implicit function declaration: sqlite3_db_create_aggregate
"SQLite.xs", line 62: warning: implicit function declaration: dbd_set_sqlite3_busy_timeout
cc -c -I. -I/usr/perl5/site_perl/5.6.1/sun4-solaris-64int/auto/DBI -I/opt/THUSsqlite/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -xdepend -DVERSION=\"1.09\" -DXS_VERSION=\"1.09\" -KPIC -I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE -DNDEBUG=1 -DSQLITE_PTR_SZ=4 dbdimp.c
"dbdimp.c", line 742: warning: argument #1 is incompatible with prototype:
prototype: pointer to const char : "/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE/proto.h", line 550
argument : pointer to const unsigned char
"dbdimp.c", line 905: warning: argument #1 is incompatible with prototype:
prototype: pointer to const char : "/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE/proto.h", line 550
argument : pointer to const unsigned char
Running Mkbootstrap for DBD::SQLite ()
chmod 644 SQLite.bs
rm -f blib/arch/auto/DBD/SQLite/SQLite.so
LD_RUN_PATH="" cc -G SQLite.o dbdimp.o -L/opt/THUSsqlite/lib -o blib/arch/auto/DBD/SQLite/SQLite.so
chmod 755 blib/arch/auto/DBD/SQLite/SQLite.so
cp SQLite.bs blib/arch/auto/DBD/SQLite/SQLite.bs
chmod 644 blib/arch/auto/DBD/SQLite/SQLite.bs
Manifying blib/man3/DBD::SQLite.3
----
Message body not shown because it is not plain text.