   "Compile the SQLite back-end for EmacSQL, returning non-nil on success.
 If called with non-nil ASYNC the return value is meaningless."
   (let* ((cc (executable-find "cc"))
-         (src (expand-file-name "sqlite" emacsql-data-root))
+         (src (expand-file-name "sqlite" emacsql-sqlite-data-root))
          (files (mapcar (lambda (f) (expand-file-name f src))
                         '("sqlite3.c" "emacsql.c")))
          (cflags (list (format "-I%s" src) (format "-O%d" (or o-level 2))))


(defun emacsql-sqlite-compile-switches ()
  "Return the compilation switches from the Makefile under sqlite/."
  (let ((makefile (expand-file-name "sqlite/Makefile" emacsql-data-root))
        (case-fold-search nil))
    (with-temp-buffer
      (insert-file-contents makefile)

          ((not emacsql-sqlite-automatic-build)
           (prog1 nil
             (message "Local SQLite build disabled, skipping")))
          (t (mkdir (expand-file-name "bin" emacsql-sqlite-data-root) t)
             (message "Compiling EmacSQL SQLite binary ...")
             (let ((log (get-buffer-create byte-compile-log-buffer)))
               (with-current-buffer log
