Compile o sqlite com o recurso soundex

0

Em 14.04 LTS:

Eu estou tentando construir um teste funcional de uma aplicação Symfony que usa a função soundex() no MySQL. O ambiente de teste usa o sqlite, que por padrão não compila seu recurso soundex() . Os documentos do sqlite sugerem que tudo o que você precisa fazer é adicionar a opção -SQLITE_SOUNDEX de tempo de compilação.

Infelizmente eu sou um noob bruto quando se trata de compilar. Cheguei até a fazer o download do arquivo autoconf e extraí-lo. Eu tentei isso:

$ /src/sqlite$ ./configure -CFLAGS="-SQLITE_SOUNDEX"

e tenho isso:

configure: error: unrecognized option: '-CFLAGS=-SQLITE_SOUNDEX'

Então está claro que estou na minha cabeça. Eu gostaria de acabar com um driver pdo_sqlite para PHP, e talvez até mesmo um php_pdo_sqlite.dll para minha caixa do Windows.

Editar - progresso de uma espécie.

Eu encontrei um comando sqlite configure que eu modifiquei:

$ sudo ./configure --prefix=/usr --disable-static CFLAGS="-g -O2 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_SECURE_DELETE=1 -SQLITE_SOUNDEX"

Isso resultou em:

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... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in '/home/george/src/sqlite':
configure: error: C compiler cannot create executables

Então eu incluí o config.log caso ele contenha informações úteis para os cognoscenti:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by sqlite configure 3.8.7.1, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure --prefix=/usr --disable-static CFLAGS=-g -O2 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_SECURE_DELETE=1 -SQLITE_SOUNDEX

## --------- ##
## Platform. ##
## --------- ##

hostname = nginx
uname -m = x86_64
uname -r = 3.13.0-32-generic
uname -s = Linux
uname -v = #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2212: checking for a BSD-compatible install
configure:2280: result: /usr/bin/install -c
configure:2291: checking whether build environment is sane
configure:2341: result: yes
configure:2482: checking for a thread-safe mkdir -p
configure:2521: result: /bin/mkdir -p
configure:2534: checking for gawk
configure:2564: result: no
configure:2534: checking for mawk
configure:2550: found /usr/bin/mawk
configure:2561: result: mawk
configure:2572: checking whether make sets $(MAKE)
configure:2594: result: yes
configure:2687: checking for style of include used by make
configure:2715: result: GNU
configure:2786: checking for gcc
configure:2802: found /usr/bin/gcc
configure:2813: result: gcc
configure:3042: checking for C compiler version
configure:3051: gcc --version >&5
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3062: $? = 0
configure:3051: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) 
configure:3062: $? = 0
configure:3051: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3062: $? = 4
configure:3051: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3062: $? = 4
configure:3082: checking whether the C compiler works
configure:3104: gcc -g -O2 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_SECURE_DELETE=1 -SQLITE_SOUNDEX   conftest.c  >&5
gcc: error: unrecognized command line option '-SQLITE_SOUNDEX'
configure:3108: $? = 1
configure:3146: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "sqlite"
| #define PACKAGE_TARNAME "sqlite"
| #define PACKAGE_VERSION "3.8.7.1"
| #define PACKAGE_STRING "sqlite 3.8.7.1"
| #define PACKAGE_BUGREPORT "http://www.sqlite.org"
| #define PACKAGE_URL ""
| #define PACKAGE "sqlite"
| #define VERSION "3.8.7.1"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3151: error: in '/home/george/src/sqlite':
configure:3153: error: C compiler cannot create executables
See 'config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-g -O2 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_SECURE_DELETE=1 -SQLITE_SOUNDEX'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_mkdir=/bin/mkdir
ac_cv_prog_AWK=mawk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /home/george/src/sqlite/missing --run aclocal-1.11'
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AR=''
AUTOCONF='${SHELL} /home/george/src/sqlite/missing --run autoconf'
AUTOHEADER='${SHELL} /home/george/src/sqlite/missing --run autoheader'
AUTOMAKE='${SHELL} /home/george/src/sqlite/missing --run automake-1.11'
AWK='mawk'
BUILD_CFLAGS=''
CC='gcc'
CCDEPMODE=''
CFLAGS='-g -O2 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_SECURE_DELETE=1 -SQLITE_SOUNDEX'
CPP=''
CPPFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR='.deps'
DLLTOOL=''
DSYMUTIL=''
DUMPBIN=''
DYNAMIC_EXTENSION_FLAGS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
FGREP=''
GREP=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD=''
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LTLIBOBJS=''
MAKEINFO='${SHELL} /home/george/src/sqlite/missing --run makeinfo'
MANIFEST_TOOL=''
MKDIR_P='/bin/mkdir -p'
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OTOOL64=''
OTOOL=''
PACKAGE='sqlite'
PACKAGE_BUGREPORT='http://www.sqlite.org'
PACKAGE_NAME='sqlite'
PACKAGE_STRING='sqlite 3.8.7.1'
PACKAGE_TARNAME='sqlite'
PACKAGE_URL=''
PACKAGE_VERSION='3.8.7.1'
PATH_SEPARATOR=':'
RANLIB=''
READLINE_LIBS=''
SED=''
SET_MAKE=''
SHELL='/bin/bash'
STRIP=''
THREADSAFE_FLAGS=''
VERSION='3.8.7.1'
ac_ct_AR=''
ac_ct_CC='gcc'
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include='include'
am__isrc=''
am__leading_dot='.'
am__nodep='_no'
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /home/george/src/sqlite/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='/bin/mkdir -p'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "sqlite"
#define PACKAGE_TARNAME "sqlite"
#define PACKAGE_VERSION "3.8.7.1"
#define PACKAGE_STRING "sqlite 3.8.7.1"
#define PACKAGE_BUGREPORT "http://www.sqlite.org"
#define PACKAGE_URL ""
#define PACKAGE "sqlite"
#define VERSION "3.8.7.1"

configure: exit 77
    
por geoB 13.11.2014 / 00:18

1 resposta

0

Experimente ./configure -SQLITE_SOUNDEX ou ./configure -SQLITE_SOUNDEX=1

Editar

O comando correto é ./configure "CFLAGS=-DSQLITE_SOUNDEX"

Se você executar ./configure --help , verá:

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

As instruções de compilação do sqlite indicam que você precisa definir SQLITE_SOUNDEX para obter essa funcionalidade. A opção do compilador C para definir algo é -D, então o parâmetro da linha de comando vem para "CFLAGS = -DSQLITE_SOUNDEX"

    
por sмurf 13.11.2014 / 01:04

Tags