diff --git a/ext/sqlite3/extconf.rb b/ext/sqlite3/extconf.rb index b42eb9aa..b090c3ce 100644 --- a/ext/sqlite3/extconf.rb +++ b/ext/sqlite3/extconf.rb @@ -78,7 +78,14 @@ def configure_extension append_cflags("-DTAINTING_SUPPORT") end - abort_could_not_find("sqlite3.h") unless find_header("sqlite3.h") + if find_header("sqlite3.h") + # noop + elsif find_header("#{libname}/sqlite3.h") + $defs.push "-DHAVE_LIB_FLDR" + else + abort_could_not_find("sqlite3.h") + end + abort_could_not_find(libname) unless find_library(libname, "sqlite3_libversion_number", "sqlite3.h") # Functions defined in 1.9 but not 1.8 diff --git a/ext/sqlite3/sqlite3_ruby.h b/ext/sqlite3/sqlite3_ruby.h index a647c440..16eaabb7 100644 --- a/ext/sqlite3/sqlite3_ruby.h +++ b/ext/sqlite3/sqlite3_ruby.h @@ -21,8 +21,11 @@ #define SQLITE3_UTF8_STR_NEW2(_obj) \ (rb_enc_associate_index(rb_str_new2(_obj), rb_utf8_encindex())) - +#ifdef HAVE_LIB_FLDR /* only occurs with sqlcipher? */ +#include +#else #include +#endif #ifndef HAVE_TYPE_SQLITE3_INT64 typedef sqlite_int64 sqlite3_int64;