actually link to <sqlite3.h> when -tags libsqlite3

Building with -tags libsqlite3 used the sqlite3.h from the system but the go
compiler will compile all *.{c,h} files in the same direcory:

	"When the Go tool sees that one or more Go files use the special import
	"C", it will look for other non-Go files in the directory and compile
	them as part of the Go package. Any .c, .s, or .S files will be compiled
	with the C compiler." (https://golang.org/cmd/cgo/)

So if users actually want to link against the system sqlite3 we should make
sqlite3-binding.* a noop.

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
This commit is contained in:
Christian Brauner 2016-10-17 14:28:16 +02:00
parent e5a3c16c5c
commit f6e7921d24
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D
3 changed files with 18 additions and 3 deletions

View File

@ -17,6 +17,7 @@
** language. The code for the "sqlite3" command-line shell is also in a ** language. The code for the "sqlite3" command-line shell is also in a
** separate file. This file contains only code for the core SQLite library. ** separate file. This file contains only code for the core SQLite library.
*/ */
#ifndef USE_LIBSQLITE3
#define SQLITE_CORE 1 #define SQLITE_CORE 1
#define SQLITE_AMALGAMATION 1 #define SQLITE_AMALGAMATION 1
#ifndef SQLITE_PRIVATE #ifndef SQLITE_PRIVATE
@ -197846,5 +197847,9 @@ static int sqlite3Fts5VocabInit(Fts5Global *pGlobal, sqlite3 *db){
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5) */ #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5) */
#else // USE_LIBSQLITE3
// If users really want to link against the system sqlite3 we
// need to make this file a noop.
#endif
/************** End of fts5.c ************************************************/ /************** End of fts5.c ************************************************/

View File

@ -30,6 +30,7 @@
** the version number) and changes its name to "sqlite3.h" as ** the version number) and changes its name to "sqlite3.h" as
** part of the build process. ** part of the build process.
*/ */
#ifndef USE_LIBSQLITE3
#ifndef SQLITE3_H #ifndef SQLITE3_H
#define SQLITE3_H #define SQLITE3_H
#include <stdarg.h> /* Needed for the definition of va_list */ #include <stdarg.h> /* Needed for the definition of va_list */
@ -10338,5 +10339,9 @@ struct fts5_api {
#endif #endif
#endif /* _FTS5_H */ #endif /* _FTS5_H */
#else // USE_LIBSQLITE3
// If users really want to link against the system sqlite3 we
// need to make this file a noop.
#endif
/******** End of fts5.h *********/ /******** End of fts5.h *********/

View File

@ -1,3 +1,4 @@
#ifndef USE_LIBSQLITE3
/* /*
** 2006 June 7 ** 2006 June 7
** **
@ -558,3 +559,7 @@ typedef int (*sqlite3_loadext_entry)(
#endif #endif
#endif /* SQLITE3EXT_H */ #endif /* SQLITE3EXT_H */
#else // USE_LIBSQLITE3
// If users really want to link against the system sqlite3 we
// need to make this file a noop.
#endif