Greg Ward committed c899be0

configure: check for sqlite3 so we can build without it
(albeit without svn >= 1.7 support)

Comments (0)

Files changed (4)

 CFLAGS = -Wall -Wextra -Wno-unused-parameter -std=gnu99 -g
 headers = $(wildcard src/*.h)
 sources = $(wildcard src/*.c)
 objects = $(subst .c,.o,$(sources))
 vcprompt: $(objects)
-	$(CC) -o $@ $(objects) -l sqlite3
+	$(CC) -o $@ $(objects) $(LIBS)
 # build a standalone version of capture_child() library for testing
 src/capture: src/capture.c src/capture.h src/common.c src/common.h
 /* Define to 1 if you have the ANSI C header files. */
+#undef HAVE_SQLITE3_H
 /* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
    <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
    #define below would cause a syntax error. */
 # Checks for libraries.
+AC_CHECK_LIB(sqlite3, sqlite3_open)
 # Checks for header files.
 AC_CHECK_HEADERS([arpa/inet.h stdlib.h string.h sys/time.h unistd.h])
 # Checks for typedefs, structures, and compiler characteristics.
  * (at your option) any later version.
+#include "../config.h"
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
-#include <sqlite3.h>
 #include <unistd.h>
+# include <sqlite3.h>
 #include "common.h"
 #include "svn.h"
     return isdir(".svn");
 static int
 svn_read_sqlite(result_t *result)
     return ok;
+static int
+svn_read_sqlite(result_t *result)
+    debug("vcprompt built without sqlite3 (cannot support svn >= 1.7)");
+    return 0;
 static int
 svn_read_custom(FILE *fp, char line[], int size, int line_num, result_t *result)