summaryrefslogtreecommitdiff
path: root/usr/src/lib/libsqlite
diff options
context:
space:
mode:
authorGordon Ross <gwr@nexenta.com>2013-05-25 14:29:15 -0400
committerGordon Ross <gwr@nexenta.com>2015-05-31 23:16:21 -0400
commit91d7f85e02991954d1e1bd44673df567ad8dcc87 (patch)
tree84ba8c28de01779ee2dadbc74dc62348227ba833 /usr/src/lib/libsqlite
parente53cbaa96c466c221cfec0d1a481c6f75be6880d (diff)
downloadillumos-joyent-91d7f85e02991954d1e1bd44673df567ad8dcc87.tar.gz
5916 make libsqlite a real shared lib
Reviewed by: Thomas Keiser <thomas.keiser@nexenta.com> Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/lib/libsqlite')
-rw-r--r--usr/src/lib/libsqlite/Makefile11
-rw-r--r--usr/src/lib/libsqlite/Makefile.com121
-rw-r--r--usr/src/lib/libsqlite/i386/Makefile6
-rw-r--r--usr/src/lib/libsqlite/llib-lsqlite-sys (renamed from usr/src/lib/libsqlite/llib-lsqlite)2
-rw-r--r--usr/src/lib/libsqlite/mapfile-sqlite10
-rw-r--r--usr/src/lib/libsqlite/sparc/Makefile6
6 files changed, 67 insertions, 89 deletions
diff --git a/usr/src/lib/libsqlite/Makefile b/usr/src/lib/libsqlite/Makefile
index 241e3904bd..2d156094a3 100644
--- a/usr/src/lib/libsqlite/Makefile
+++ b/usr/src/lib/libsqlite/Makefile
@@ -2,8 +2,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
SUBDIRS = $(MACH)
@@ -18,10 +16,10 @@ ENCODING = ISO8859
SRCDIR= src
HDRS= sqlite.h sqlite-misc.h
-ROOTHDRDIR= $(ROOT)/usr/include/sqlite
+ROOTHDRDIR= $(ROOT)/usr/include/sqlite-sys
ROOTHDRS= $(HDRS:%=$(ROOTHDRDIR)/%)
CHECKHDRS= $(HDRS:%.h=%.check)
-CLEANFILES += sqlite.h
+CLOBBERFILES += sqlite.h
.KEEP_STATE:
@@ -35,7 +33,8 @@ lint := TARGET= lint
# This is the default Makefile target. The objects listed here
# are what get build when you type just "make" with no arguments.
#
-all clobber install lint: $(SUBDIRS)
+all install: sqlite.h $(SUBDIRS)
+clobber lint: $(SUBDIRS)
$(ROOTHDRDIR):
$(INS.dir)
@@ -52,7 +51,7 @@ check:
#
sqlite.h: $(SRCDIR)/sqlite.h.in
@echo "Generating $@"; \
- sed -e 's"--VERS--"$(SQLITE_VERSION)-$(VERSION)"' \
+ sed -e 's"--VERS--"$(SQLITE_VERSION)"' \
-e s/--ENCODING--/$(ENCODING)/ \
$(SRCDIR)/sqlite.h.in > $@
diff --git a/usr/src/lib/libsqlite/Makefile.com b/usr/src/lib/libsqlite/Makefile.com
index ecafa30d6c..e45f1767dc 100644
--- a/usr/src/lib/libsqlite/Makefile.com
+++ b/usr/src/lib/libsqlite/Makefile.com
@@ -3,12 +3,11 @@
# Use is subject to license terms.
#
-SQLITE_VERSION = 2.8.15-repcached
+# Make the SO name unlikely to conflict with any other
+# libsqlite that might also be found on the system.
+LIBRARY = libsqlite-sys.a
-LIBRARY = libsqlite.a
-RELOC = $(LIBRARY:%.a=%.o)
-
-VERS = .1
+VERS = .2.8.15
OBJECTS = \
attach.o \
auth.o \
@@ -44,18 +43,22 @@ OBJECTS = \
include $(SRC)/lib/Makefile.lib
-# The shared object install target directory is usr/lib/smbsrv.
-SMBSRVLIBDIR= $(ROOTLIBDIR)/smbsrv
-SMBSRVLINK= $(SMBSRVLIBDIR)/$(LIBLINKS)
+# install this library in the root filesystem
+include $(SRC)/lib/Makefile.rootfs
SRCDIR = ../src
TOOLDIR = ../tool
$(DYNLIB) := LDLIBS += -lc
-LIBS = $(RELOC) $(LINTLIB) $(DYNLIB)
+LIBS = $(DYNLIB) $(LINTLIB) $(NATIVERELOC)
+
+$(LINTLIB) := SRCS = ../$(LINTSRC)
-$(LINTLIB) := SRCS = $(LINTSRC)
+# generated sources
+GENSRC = opcodes.c parse.c
+# all sources
SRCS = \
+ $(GENSRC) \
$(SRCDIR)/attach.c \
$(SRCDIR)/auth.c \
$(SRCDIR)/btree.c \
@@ -70,10 +73,8 @@ SRCS = \
$(SRCDIR)/hash.c \
$(SRCDIR)/insert.c \
$(SRCDIR)/main.c \
- opcodes.c \
$(SRCDIR)/os.c \
$(SRCDIR)/pager.c \
- parse.c \
$(SRCDIR)/pragma.c \
$(SRCDIR)/printf.c \
$(SRCDIR)/random.c \
@@ -98,15 +99,17 @@ CERRWARN += -_gcc=-Wno-unused-label
MAPFILES = ../mapfile-sqlite
+# headers generated here
+GENHDR = opcodes.h parse.h
+
# Header files used by all library source files.
#
HDR = \
+ $(GENHDR) \
$(SRCDIR)/btree.h \
$(SRCDIR)/config.h \
$(SRCDIR)/hash.h \
- opcodes.h \
$(SRCDIR)/os.h \
- parse.h \
../sqlite.h \
$(SRCDIR)/sqliteInt.h \
$(SRCDIR)/vdbe.h \
@@ -131,11 +134,11 @@ TESTOBJS = $(TESTSRC:$(SRCDIR)/%.c=%.o)
TESTCLEAN = $(TESTOBJS) test.db test.tcl test1.bt test2.db testdb
#
-# Native variants
+# Native variant (needed by cmd/configd)
#
-NATIVERELOC = $(RELOC:%.o=%-native.o)
-NATIVEPROGS = lemon-build testfixture
-NATIVEOBJS = lemon.o $(OBJS:%.o=%-native.o)
+NATIVERELOC = libsqlite-native.o
+NATIVEPROGS = testfixture
+NATIVEOBJS = $(OBJS:%.o=%-native.o)
NATIVETARGETS = $(NATIVEPROGS) $(NATIVEOBJS) $(NATIVERELOC)
@@ -163,8 +166,6 @@ testfixture := CFLAGS += \
testfixture := LDLIBS += -R$(TCLBASE)/lib -L$(TCLBASE)/lib -l$(TCLVERS) -lm -ldl
CLEANFILES += \
- $(RELOC) \
- $(LINTLIB) \
$(NATIVETARGETS) \
$(TESTCLEAN) \
lemon \
@@ -177,12 +178,10 @@ CLEANFILES += \
parse_tmp.out \
parse_tmp.y \
parse.c \
- parse.h
+ parse.h
ENCODING = ISO8859
-LINTSRC= ../llib-lsqlite
-
.PARALLEL: $(OBJS) $(OBJS:%.o=%-native.o)
.KEEP_STATE:
@@ -191,36 +190,28 @@ LINTSRC= ../llib-lsqlite
# are what get build when you type just "make" with no arguments.
#
all: $(LIBS)
-install: all $(ROOTLIBDIR)/$(RELOC) $(ROOTLIBDIR)/$(NATIVERELOC) \
- $(ROOTLIBDIR)/llib-lsqlite.ln $(SMBSRVLIBDIR)/$(DYNLIB)
+install: all \
+ $(ROOTLIBDIR)/$(DYNLIB) \
+ $(ROOTLIBDIR)/$(LINTLIB) \
+ $(ROOTLIBDIR)/$(NATIVERELOC)
-$(ROOTLIBDIR)/$(RELOC) := FILEMODE= 644
-$(ROOTLIBDIR)/$(NATIVERELOC) := FILEMODE= 644
-$(ROOTLIBDIR)/llib-lsqlite.ln := FILEMODE= 644
-$(SMBSRVLIBDIR)/$(DYNLIB) := FILEMODE= 755
+lint:
-$(ROOTLIBDIR)/%: %
- $(INS.file)
+all_h: $(GENHDR)
-$(SMBSRVLIBDIR): $(ROOTLIBDIR)
- $(INS.dir)
-
-$(SMBSRVLIBDIR)/%: % $(SMBSRVLIBDIR)
- $(INS.file)
+$(ROOTLIBDIR)/$(NATIVERELOC) := FILEMODE= 644
+$(ROOTLINTDIR)/$(LINTLIB) := FILEMODE= 644
-$(SMBSRVLINK): $(SMBSRVLIBDIR) $(SMBSRVLIBDIR)/$(DYNLIB)
+$(ROOTLINK): $(ROOTLIBDIR) $(ROOTLIBDIR)/$(DYNLIB)
$(INS.liblink)
-$(OBJS) $(OBJS:%.o=%-native.o): $(HDR)
+$(ROOTLINTDIR)/%: ../%
+ $(INS.file)
native: $(NATIVERELOC)
-$(RELOC): objs .WAIT $(OBJS)
- $(LD) -r $(MAPFILES:%=-M%) -o $(RELOC) $(OBJS)
- $(CTFMERGE) -t -f -L VERSION -o $(RELOC) $(OBJS)
-
$(NATIVERELOC): objs .WAIT $(OBJS:%.o=%-native.o)
- $(LD) -r $(MAPFILES:%=-M%) -o $(NATIVERELOC) $(OBJS:%.o=%-native.o)
+ $(LD) -r -o $(NATIVERELOC) $(OBJS:%.o=%-native.o)
opcodes.h: $(SRCDIR)/vdbe.c
@echo "Generating $@"; \
@@ -239,20 +230,6 @@ opcodes.c: $(SRCDIR)/vdbe.c
sed -e 's/^.*OP_/ "/' -e 's/:.*$$/", /' >> $@ ; \
echo '};' >> $@
-#
-# We use a recursive invocation because otherwise pmake always rebuilds
-# everything, due to multiple expansions of "foo := A += B".
-#
-lemon: FRC
- $(MAKE) lemon-build
-
-lemon-build: lemon.o $(TOOLDIR)/lempar.c
- $(LINK.c) -o lemon lemon.o
- $(RM) lempar.c
- $(LN) -s $(TOOLDIR)/lempar.c lempar.c
- $(RM) lemon-build
- $(CP) lemon lemon-build
-
testfixture: FRC
@if [ -f $(TCLBASE)/include/tcl.h ]; then \
unset SUNPRO_DEPENDENCIES; \
@@ -263,39 +240,43 @@ testfixture: FRC
exit 1; \
fi
-parse_tmp.out: $(SRCDIR)/parse.y lemon
- $(RM) parse_tmp.y
+parse.h parse.c : $(SRCDIR)/parse.y $(TOOLDIR)/lemon.c $(TOOLDIR)/lempar.c
+ -$(RM) parse_tmp.y lempar.c
$(CP) $(SRCDIR)/parse.y parse_tmp.y
+ $(CP) $(TOOLDIR)/lempar.c lempar.c
+ $(NATIVECC) -o lemon $(TOOLDIR)/lemon.c
./lemon parse_tmp.y
-
-parse.h: parse_tmp.out
+ -$(RM) parse.c parse.h
$(CP) parse_tmp.h parse.h
-
-parse.c: parse_tmp.out
$(CP) parse_tmp.c parse.c
-objs/%-native.o: $(SRCDIR)/%.c
+objs/%-native.o: $(SRCDIR)/%.c $(GENHDR)
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
-objs/%-native.o: %.c
+objs/%-native.o: %.c $(GENHDR)
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
-objs/parse-native.o: parse.c
+objs/parse-native.o: parse.c $(GENHDR)
$(COMPILE.c) -o $@ parse.c
$(POST_PROCESS_O)
-objs/%.o: %.c
+objs/%.o pics/%.o: $(SRCDIR)/%.c $(GENHDR)
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
-%.o: $(SRCDIR)/%.c
+objs/%.o pics/%.o: %.c $(GENHDR)
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
-%.o: $(TOOLDIR)/%.c
- $(COMPILE.c) -o $@ $<
+# need direct rules for generated files
+objs/opcodes.o pics/opcodes.o: opcodes.c $(GENHDR)
+ $(COMPILE.c) -o $@ opcodes.c
+ $(POST_PROCESS_O)
+
+objs/parse.o pics/parse.o: parse.c $(GENHDR)
+ $(COMPILE.c) -o $@ parse.c
$(POST_PROCESS_O)
include $(SRC)/lib/Makefile.targ
diff --git a/usr/src/lib/libsqlite/i386/Makefile b/usr/src/lib/libsqlite/i386/Makefile
index a60da1b947..c7cca61bea 100644
--- a/usr/src/lib/libsqlite/i386/Makefile
+++ b/usr/src/lib/libsqlite/i386/Makefile
@@ -22,11 +22,7 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
include ../Makefile.com
-install: $(ROOTLIBDIR)/$(RELOC) $(SMBSRVLIBDIR)/$(DYNLIB) $(SMBSRVLINK)
-
-$(ROOTLIBDIR)/$(RELOC): all
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libsqlite/llib-lsqlite b/usr/src/lib/libsqlite/llib-lsqlite-sys
index 220ae71518..c4d2f47fd9 100644
--- a/usr/src/lib/libsqlite/llib-lsqlite
+++ b/usr/src/lib/libsqlite/llib-lsqlite-sys
@@ -3,8 +3,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/* LINTLIBRARY */
/* PROTOLIB1 */
diff --git a/usr/src/lib/libsqlite/mapfile-sqlite b/usr/src/lib/libsqlite/mapfile-sqlite
index 7dbdf5d2be..f93dc474b4 100644
--- a/usr/src/lib/libsqlite/mapfile-sqlite
+++ b/usr/src/lib/libsqlite/mapfile-sqlite
@@ -22,7 +22,7 @@
$mapfile_version 2
-SYMBOL_SCOPE {
+SYMBOL_VERSION ILLUMOS_sqlite_2.8.15 {
global:
# exported functions
sqlite_open;
@@ -72,7 +72,15 @@ SYMBOL_SCOPE {
# exported data
sqlite_version;
sqlite_encoding;
+};
+SYMBOL_VERSION SUNWprivate {
+ global:
+ sqlite_temp_directory;
+ sqliteIsNumber;
+ sqliteOsFileExists;
+ sqliteStrICmp;
+ sqliteStrNICmp;
local:
*;
};
diff --git a/usr/src/lib/libsqlite/sparc/Makefile b/usr/src/lib/libsqlite/sparc/Makefile
index a60da1b947..c7cca61bea 100644
--- a/usr/src/lib/libsqlite/sparc/Makefile
+++ b/usr/src/lib/libsqlite/sparc/Makefile
@@ -22,11 +22,7 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
include ../Makefile.com
-install: $(ROOTLIBDIR)/$(RELOC) $(SMBSRVLIBDIR)/$(DYNLIB) $(SMBSRVLINK)
-
-$(ROOTLIBDIR)/$(RELOC): all
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)