SQLite 基础2

2021-12-01 17:14:20 浏览数 (1)

解压安装

解压安装命令

使用下列命令进行解压安装

代码语言:javascript复制
tar -zxvf sqlite-autoconf-3110100.tar.gz 
cd sqlite-autoconf-3110100
./configure --prefix=/usr/local/sqlite3.11
make
make install

详细安装过程

代码语言:javascript复制
[root@h102 sqlite]# tar -zxvf sqlite-autoconf-3110100.tar.gz 
sqlite-autoconf-3110100/
sqlite-autoconf-3110100/config.sub
sqlite-autoconf-3110100/shell.c
sqlite-autoconf-3110100/sqlite3.c
sqlite-autoconf-3110100/configure.ac
sqlite-autoconf-3110100/sqlite3.1
sqlite-autoconf-3110100/install-sh
sqlite-autoconf-3110100/Makefile.msc
sqlite-autoconf-3110100/compile
sqlite-autoconf-3110100/INSTALL
sqlite-autoconf-3110100/tea/
sqlite-autoconf-3110100/tea/generic/
sqlite-autoconf-3110100/tea/generic/tclsqlite3.c
sqlite-autoconf-3110100/tea/license.terms
sqlite-autoconf-3110100/tea/configure.ac
sqlite-autoconf-3110100/tea/tclconfig/
sqlite-autoconf-3110100/tea/tclconfig/install-sh
sqlite-autoconf-3110100/tea/tclconfig/tcl.m4
sqlite-autoconf-3110100/tea/README
sqlite-autoconf-3110100/tea/pkgIndex.tcl.in
sqlite-autoconf-3110100/tea/aclocal.m4
sqlite-autoconf-3110100/tea/doc/
sqlite-autoconf-3110100/tea/doc/sqlite3.n
sqlite-autoconf-3110100/tea/win/
sqlite-autoconf-3110100/tea/win/rules.vc
sqlite-autoconf-3110100/tea/win/makefile.vc
sqlite-autoconf-3110100/tea/win/nmakehlp.c
sqlite-autoconf-3110100/tea/configure
sqlite-autoconf-3110100/tea/Makefile.in
sqlite-autoconf-3110100/sqlite3ext.h
sqlite-autoconf-3110100/aclocal.m4
sqlite-autoconf-3110100/ltmain.sh
sqlite-autoconf-3110100/config.guess
sqlite-autoconf-3110100/sqlite3.rc
sqlite-autoconf-3110100/sqlite3.h
sqlite-autoconf-3110100/missing
sqlite-autoconf-3110100/depcomp
sqlite-autoconf-3110100/configure
sqlite-autoconf-3110100/Makefile.am
sqlite-autoconf-3110100/Makefile.in
sqlite-autoconf-3110100/sqlite3.pc.in
sqlite-autoconf-3110100/README.txt
[root@h102 sqlite]# ls
sqlite-autoconf-3110100  sqlite-autoconf-3110100.tar.gz
[root@h102 sqlite]# cd sqlite-autoconf-3110100
[root@h102 sqlite-autoconf-3110100]# ls
aclocal.m4    config.sub    depcomp     ltmain.sh    Makefile.msc  shell.c    sqlite3ext.h   sqlite3.rc
compile       configure     INSTALL     Makefile.am  missing       sqlite3.1  sqlite3.h      tea
config.guess  configure.ac  install-sh  Makefile.in  README.txt    sqlite3.c  sqlite3.pc.in
[root@h102 sqlite-autoconf-3110100]#
[root@h102 sqlite-autoconf-3110100]# ./configure --prefix=/usr/local/sqlite3.11
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1966080
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %sn
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for fdatasync... yes
checking for usleep... yes
checking for fullfsync... no
checking for localtime_r... yes
checking for gmtime_r... yes
checking whether strerror_r is declared... yes
checking for strerror_r... yes
checking whether strerror_r returns char *... no
checking for library containing readline... no
checking for library containing pthread_create... -lpthread
checking for library containing pthread_mutexattr_init... none required
checking for library containing dlopen... -ldl
checking for whether to support dynamic extensions... yes
checking for posix_fallocate... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating sqlite3.pc
config.status: executing depfiles commands
config.status: executing libtool commands
[root@h102 sqlite-autoconf-3110100]# echo $?
0
[root@h102 sqlite-autoconf-3110100]# make 
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DPACKAGE_NAME="sqlite" -DPACKAGE_TARNAME="sqlite" -DPACKAGE_VERSION="3.11.1" -DPACKAGE_STRING="sqlite 3.11.1" -DPACKAGE_BUGREPORT="http://www.sqlite.org" -DPACKAGE_URL="" -DPACKAGE="sqlite" -DVERSION="3.11.1" -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_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_POSIX_FALLOCATE=1 -I.    -D_REENTRANT=1 -DSQLITE_THREADSAFE=1    -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -MT sqlite3.lo -MD -MP -MF .deps/sqlite3.Tpo -c -o sqlite3.lo sqlite3.c
libtool: compile:  gcc -DPACKAGE_NAME="sqlite" -DPACKAGE_TARNAME="sqlite" -DPACKAGE_VERSION="3.11.1" "-DPACKAGE_STRING="sqlite 3.11.1"" -DPACKAGE_BUGREPORT="http://www.sqlite.org" -DPACKAGE_URL="" -DPACKAGE="sqlite" -DVERSION="3.11.1" -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_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_POSIX_FALLOCATE=1 -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -MT sqlite3.lo -MD -MP -MF .deps/sqlite3.Tpo -c sqlite3.c  -fPIC -DPIC -o .libs/sqlite3.o
libtool: compile:  gcc -DPACKAGE_NAME="sqlite" -DPACKAGE_TARNAME="sqlite" -DPACKAGE_VERSION="3.11.1" "-DPACKAGE_STRING="sqlite 3.11.1"" -DPACKAGE_BUGREPORT="http://www.sqlite.org" -DPACKAGE_URL="" -DPACKAGE="sqlite" -DVERSION="3.11.1" -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_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_POSIX_FALLOCATE=1 -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -MT sqlite3.lo -MD -MP -MF .deps/sqlite3.Tpo -c sqlite3.c -o sqlite3.o >/dev/null 2>&1
mv -f .deps/sqlite3.Tpo .deps/sqlite3.Plo
/bin/sh ./libtool  --tag=CC   --mode=link gcc -D_REENTRANT=1 -DSQLITE_THREADSAFE=1    -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -no-undefined -version-info 8:6:8  -o libsqlite3.la -rpath /usr/local/sqlite3.11/lib sqlite3.lo  -ldl -lpthread 
libtool: link: gcc -shared  -fPIC -DPIC  .libs/sqlite3.o   -ldl -lpthread  -g -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" )
gcc -DPACKAGE_NAME="sqlite" -DPACKAGE_TARNAME="sqlite" -DPACKAGE_VERSION="3.11.1" -DPACKAGE_STRING="sqlite 3.11.1" -DPACKAGE_BUGREPORT="http://www.sqlite.org" -DPACKAGE_URL="" -DPACKAGE="sqlite" -DVERSION="3.11.1" -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_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_POSIX_FALLOCATE=1 -I.    -D_REENTRANT=1 -DSQLITE_THREADSAFE=1    -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -g -O2 -MT sqlite3-shell.o -MD -MP -MF .deps/sqlite3-shell.Tpo -c -o sqlite3-shell.o `test -f 'shell.c' || echo './'`shell.c
mv -f .deps/sqlite3-shell.Tpo .deps/sqlite3-shell.Po
gcc -DPACKAGE_NAME="sqlite" -DPACKAGE_TARNAME="sqlite" -DPACKAGE_VERSION="3.11.1" -DPACKAGE_STRING="sqlite 3.11.1" -DPACKAGE_BUGREPORT="http://www.sqlite.org" -DPACKAGE_URL="" -DPACKAGE="sqlite" -DVERSION="3.11.1" -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_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_POSIX_FALLOCATE=1 -I.    -D_REENTRANT=1 -DSQLITE_THREADSAFE=1    -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -g -O2 -MT sqlite3-sqlite3.o -MD -MP -MF .deps/sqlite3-sqlite3.Tpo -c -o sqlite3-sqlite3.o `test -f 'sqlite3.c' || echo './'`sqlite3.c
mv -f .deps/sqlite3-sqlite3.Tpo .deps/sqlite3-sqlite3.Po
/bin/sh ./libtool  --tag=CC   --mode=link gcc -D_REENTRANT=1 -DSQLITE_THREADSAFE=1    -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -g -O2   -o sqlite3 sqlite3-shell.o sqlite3-sqlite3.o  -ldl -lpthread 
libtool: link: gcc -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -g -O2 -o sqlite3 sqlite3-shell.o sqlite3-sqlite3.o  -ldl -lpthread
[root@h102 sqlite-autoconf-3110100]# echo $?
0
[root@h102 sqlite-autoconf-3110100]# make install 
make[1]: Entering directory `/usr/local/src/sqlite/sqlite-autoconf-3110100'
 /bin/mkdir -p '/usr/local/sqlite3.11/lib'
 /bin/sh ./libtool   --mode=install /usr/bin/install -c   libsqlite3.la '/usr/local/sqlite3.11/lib'
libtool: install: /usr/bin/install -c .libs/libsqlite3.so.0.8.6 /usr/local/sqlite3.11/lib/libsqlite3.so.0.8.6
libtool: install: (cd /usr/local/sqlite3.11/lib && { ln -s -f libsqlite3.so.0.8.6 libsqlite3.so.0 || { rm -f libsqlite3.so.0 && ln -s libsqlite3.so.0.8.6 libsqlite3.so.0; }; })
libtool: install: (cd /usr/local/sqlite3.11/lib && { ln -s -f libsqlite3.so.0.8.6 libsqlite3.so || { rm -f libsqlite3.so && ln -s libsqlite3.so.0.8.6 libsqlite3.so; }; })
libtool: install: /usr/bin/install -c .libs/libsqlite3.lai /usr/local/sqlite3.11/lib/libsqlite3.la
libtool: install: /usr/bin/install -c .libs/libsqlite3.a /usr/local/sqlite3.11/lib/libsqlite3.a
libtool: install: chmod 644 /usr/local/sqlite3.11/lib/libsqlite3.a
libtool: install: ranlib /usr/local/sqlite3.11/lib/libsqlite3.a
libtool: finish: PATH="/usr/local/rvm/gems/ruby-2.2.1/bin:/usr/local/rvm/gems/ruby-2.2.1@global/bin:/usr/local/rvm/rubies/ruby-2.2.1/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/rvm/bin:/root/bin:/sbin" ldconfig -n /usr/local/sqlite3.11/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/sqlite3.11/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/usr/local/sqlite3.11/bin'
  /bin/sh ./libtool   --mode=install /usr/bin/install -c sqlite3 '/usr/local/sqlite3.11/bin'
libtool: install: /usr/bin/install -c sqlite3 /usr/local/sqlite3.11/bin/sqlite3
 /bin/mkdir -p '/usr/local/sqlite3.11/include'
 /usr/bin/install -c -m 644 sqlite3.h sqlite3ext.h '/usr/local/sqlite3.11/include'
 /bin/mkdir -p '/usr/local/sqlite3.11/share/man/man1'
 /usr/bin/install -c -m 644 sqlite3.1 '/usr/local/sqlite3.11/share/man/man1'
 /bin/mkdir -p '/usr/local/sqlite3.11/lib/pkgconfig'
 /usr/bin/install -c -m 644 sqlite3.pc '/usr/local/sqlite3.11/lib/pkgconfig'
make[1]: Leaving directory `/usr/local/src/sqlite/sqlite-autoconf-3110100'
[root@h102 sqlite-autoconf-3110100]# echo $?
0
[root@h102 sqlite-autoconf-3110100]# ll /usr/local/sqlite3.11/
total 16
drwxr-xr-x 2 root root 4096 Mar 12 00:05 bin
drwxr-xr-x 2 root root 4096 Mar 12 00:05 include
drwxr-xr-x 3 root root 4096 Mar 12 00:05 lib
drwxr-xr-x 3 root root 4096 Mar 12 00:05 share
[root@h102 sqlite-autoconf-3110100]# tree /usr/local/sqlite3.11/
/usr/local/sqlite3.11/
├── bin
│   └── sqlite3
├── include
│   ├── sqlite3ext.h
│   └── sqlite3.h
├── lib
│   ├── libsqlite3.a
│   ├── libsqlite3.la
│   ├── libsqlite3.so -> libsqlite3.so.0.8.6
│   ├── libsqlite3.so.0 -> libsqlite3.so.0.8.6
│   ├── libsqlite3.so.0.8.6
│   └── pkgconfig
│       └── sqlite3.pc
└── share
    └── man
        └── man1
            └── sqlite3.1

7 directories, 10 files
[root@h102 sqlite-autoconf-3110100]# 

0 人点赞