On Fri, Feb 29, 2008 at 09:32:02AM -0800, Norm Jacobs wrote:
> I'm not sure how that will fix your libtool/tcl problems, but perhaps it 
> does.  I took a quick look at the sqlite3 build and it looks like the 
> libtool/tcl problems could possibly be solved with a couple line fix to 
> their Makefile.in or tclinstaller.tcl.  When sqlite3 installs using 
> their install target, it looks like they end up cherry picking 
> tlibtclsqlite3 from the .libs dir.  They should be making libtool relink 
> it before they try to take a copy.  Presumably fixing this and sending a 
> patch upstream that removes turds from the tcl support would be viewed 
> as a good thing.

I'm going to need some hand-holding to get that right.

However, the approach I suggested works.  I basically apply the attached
patch to the SQLite3 Makefile.in and then I get exactly what I wanted.

Nico
-- 
-------------- next part --------------
--- Makefile.in Thu Dec 13 12:17:41 2007
+++ Makefile.in-sfw     Fri Feb 29 11:25:56 2008
@@ -334,15 +334,21 @@
 # build on the target system.  Some of the C source code and header
 # files are automatically generated.  This target takes care of
 # all that automatic generation.
 #
 target_source: $(SRC) parse.c opcodes.c keywordhash.h $(VDBEHDR)
-       rm -rf tsrc
-       mkdir -p tsrc
-       cp $(SRC) $(VDBEHDR) tsrc
-       rm tsrc/sqlite.h.in tsrc/parse.y
-       cp parse.c opcodes.c keywordhash.h tsrc
+       mkdir -p tsrc
+       for i in $(SRC) $(VDBEHDR) parse.c opcodes.c keywordhash.h; \
+       do \
+               [ $$i = $(TOP)/src/sqlite.h.in ] && continue; \
+               [ $$i = $(TOP)/src/parse.y ] && continue; \
+               if /bin/test $$i -nt tsrc/$$i; \
+               then \
+                       cp $$i tsrc; \
+                       touch target_source; \
+               fi; \
+       done

 sqlite3.c:     target_source $(TOP)/tool/mksqlite3c.tcl
        tclsh $(TOP)/tool/mksqlite3c.tcl

 # Rules to build the LEMON compiler generator
@@ -625,5 +631,23 @@
                | sed 's/^.* _//' >>sqlite3.def

 sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
        $(TCC) -shared -o sqlite3.dll sqlite3.def \
                -Wl,"--strip-all" $(REAL_LIBOBJ)
+
+solaris/libsqlite3.so: sqlite3.c
+       mkdir -p solaris
+       $(TCC) -o solaris/libsqlite3.so -G -KPIC sqlite3.c \
+               -I$(ROOT)/usr/include -L$(ROOT)/usr/lib \
+               -M $(LIBSQLITE_MAPFILE) -h libsqlite3.so.0 -lc -lpthread
+
+solaris/sqlite3: solaris/libsqlite3.so
+       $(TCC) -o solaris/sqlite3 $(TOP)/src/shell.c -L$(TOP)/solaris \
+               -I$(ROOT)/usr/include -L$(ROOT)/usr/lib \
+               -M $(CMD_MAPFILE) -lsqlite3
+
+
+solaris/libtclsqlite3.so: solaris/libsqlite3.so
+       $(TCC) -o solaris/libtclsqlite3.so -G -KPIC $(TOP)/src/tclsqlite.c \
+               -I$(ROOT)/usr/include -L$(ROOT)/usr/lib \
+               -h libtclsqlite3.so.0 -L$(TOP)/solaris -lsqlite3 \
+               -L/usr/lib -ltclstub8.4 -lpthread

Reply via email to