这是正确的标志,但你可能没有运行正确的SQLite。
您的方法是正确的。添加ENV.append 'CPPFLAGS', "-DSQLITE_SOUNDEX"
将用soundex进行编译。我刚刚在我的OS X 10.8.3系统上用SQLite 3.7.16.2和homebrew对它进行了测试。或者,更多的控制,像这样。
option 'with-soundex', 'Enable the SOUNDEX function'
def install
[ ... ]
ENV.append 'CPPFLAGS', "-DSQLITE_SOUNDEX" if build.include? "with-soundex"
你确定你调用正确的sqlite3
程序安装完成后? SQLite是一个“桶只公式”;也就是说,与大多数自制软件公式不同,它不会链接到/ usr/local/bin,以避免与OS X提供的sqlite
冲突。您需要使用完整路径调用自制软件,如/usr/local/Cellar/sqlite/3.7.16.2/bin/sqlite3
。
$ /usr/local/Cellar/sqlite/3.7.16.2/bin/sqlite3
SQLite version 3.7.16.2 2013-04-12 11:52:43
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select soundex('Hello, world!');
H464
这将是容易的--with-同音选项添加到主自制sqlite
配方,使您不必维护单独的公式。如果你认为有足够的人会使用它,请前往the Homebrew issue tracker on GitHub并提出要求。
您可以使用['PRAGMA compile_options'](http://www.sqlite.org/pragma.html#pragma_compile_options)检查使用'SQLITE_SOUNDEX'编译是否有效。 –