diff options
author | Mateusz Kaduk <mateusz.kaduk@gmail.com> | 2005-05-23 07:30:50 +0000 |
---|---|---|
committer | Mateusz Kaduk <mateusz.kaduk@gmail.com> | 2005-05-23 07:30:50 +0000 |
commit | 7594437a36acbdc7fb0c1a0e56b0954910c2543c (patch) | |
tree | b2e1a9212f09ac1b6c1703a44658356bdaa2c24d | |
parent | 5cf7a669530b9f328fa79c401575cdd0e14a523e (diff) | |
download | manaserv-7594437a36acbdc7fb0c1a0e56b0954910c2543c.tar.gz manaserv-7594437a36acbdc7fb0c1a0e56b0954910c2543c.tar.bz2 manaserv-7594437a36acbdc7fb0c1a0e56b0954910c2543c.tar.xz manaserv-7594437a36acbdc7fb0c1a0e56b0954910c2543c.zip |
Building sqlite conditionaly
-rw-r--r-- | configure.ac | 26 | ||||
-rw-r--r-- | src/Makefile.am | 8 | ||||
-rw-r--r-- | src/sqlite/SQLiteWrapper.cpp | 1 | ||||
-rw-r--r-- | src/sqlite/SQLiteWrapper.h | 1 | ||||
-rw-r--r-- | src/storage.h | 2 |
5 files changed, 26 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac index 29a898b1..93ac8d95 100644 --- a/configure.ac +++ b/configure.ac @@ -3,14 +3,27 @@ AC_INIT([TMW Server], [0.0.1], [b_lindeijer@users.sourceforge.net]) AC_CONFIG_HEADERS([config.h:config.h.in]) AM_INIT_AUTOMAKE -# Check with pkg-config -PKG_CHECK_MODULES(SQLITE, [sqlite3 >= 3.0.6], +# Check if with sqlite +AC_ARG_WITH(sqlite,[ --with-sqlite support SQLite ] ) +if test "x$with_sqlite" == "xyes"; then + with_sqlite=yes + + # Check with pkg-config + PKG_CHECK_MODULES(SQLITE, [sqlite3 >= 3.0.6], [], [AC_MSG_ERROR([Cannot find SQLite 3])] -) + ) + + # Add define + SQLITE_CFLAGS=" -DSQLITE_SUPPORT $SQLITE_SUPPORT" + + AC_SUBST(SQLITE_CFLAGS) + AC_SUBST(SQLITE_LIBS) +else + with_sqlite=no +fi -AC_SUBST(SQLITE_CFLAGS) -AC_SUBST(SQLITE_LIBS) +AM_CONDITIONAL(BUILD_SQLITE, test x$with_sqlite = xyes) # Checks for programs. AC_PROG_CXX @@ -35,7 +48,6 @@ else with_scripting=no fi - # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([string.h]) @@ -53,3 +65,5 @@ AC_OUTPUT echo echo "Building with scripting support: $with_scripting" +echo "Building with SQLite support: $with_sqlite" +echo diff --git a/src/Makefile.am b/src/Makefile.am index 7d4a512b..8c3a9271 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,8 +19,6 @@ tmwserv_SOURCES = main.cpp \ netsession.cpp \ packet.h \ packet.cpp \ - sqlite/SQLiteWrapper.cpp \ - sqlite/SQLiteWrapper.h \ log.h \ log.cpp \ skill.h \ @@ -31,6 +29,12 @@ tmwserv_SOURCES = main.cpp \ script-squirrel.cpp \ storage.cpp storage.h + +if BUILD_SQLITE +tmwserv_SOURCES += sqlite/SQLiteWrapper.cpp \ + sqlite/SQLiteWrapper.h +endif + # set the include path found by configure INCLUDES= $(all_includes) $(SQLITE_CFLAGS) LIBS = $(SQLITE_LIBS) diff --git a/src/sqlite/SQLiteWrapper.cpp b/src/sqlite/SQLiteWrapper.cpp index eef2498f..f5b484b7 100644 --- a/src/sqlite/SQLiteWrapper.cpp +++ b/src/sqlite/SQLiteWrapper.cpp @@ -263,4 +263,3 @@ bool SQLiteWrapper::Commit() { bool SQLiteWrapper::Rollback() { return DirectStatement("rollback"); } - diff --git a/src/sqlite/SQLiteWrapper.h b/src/sqlite/SQLiteWrapper.h index 324fdb66..419e3d50 100644 --- a/src/sqlite/SQLiteWrapper.h +++ b/src/sqlite/SQLiteWrapper.h @@ -137,4 +137,3 @@ class SQLiteWrapper { }; #endif - diff --git a/src/storage.h b/src/storage.h index da30c083..8fd981a0 100644 --- a/src/storage.h +++ b/src/storage.h @@ -23,8 +23,6 @@ #ifndef STORAGE_H #define STORAGE_H -#define SQLITE_SUPPORT // For now - #ifdef SQLITE_SUPPORT #include "sqlite/SQLiteWrapper.h" #endif |