diff configure.in @ 6194:0d86bb9cf286 HEAD

Added --enable-sql-plugins to build SQL drivers as plugins. Based on patch by Tomas Janousek.
author Timo Sirainen <tss@iki.fi>
date Tue, 07 Aug 2007 00:13:56 +0300
parents abec53314897
children 068df1748a57
line wrap: on
line diff
--- a/configure.in	Tue Aug 07 00:12:18 2007 +0300
+++ b/configure.in	Tue Aug 07 00:13:56 2007 +0300
@@ -244,6 +244,15 @@
 	fi,
 	want_sqlite=no)
 
+AC_ARG_ENABLE(sql-plugins,
+[  --enable-sql-plugins    Build SQL modules as plugins],
+	if test x$enableval = xno; then
+		want_sql_plugins=no
+	else
+		want_sql_plugins=yes
+	fi,
+	want_sql_plugins=no)
+
 AC_ARG_WITH(lucene,
 [  --with-lucene           Build with CLucene full text search support],
 	if test x$withval = xno; then
@@ -1660,12 +1669,12 @@
 		fi
 		AC_CHECK_HEADER(libpq-fe.h, [
 			if test "$PGSQL_INCLUDE" != ""; then
-				SQL_CFLAGS="$SQL_CFLAGS -I$PGSQL_INCLUDE"
+				PGSQL_CFLAGS="$PGSQL_CFLAGS -I$PGSQL_INCLUDE"
 			fi
 			if test "$PGSQL_LIBDIR" != ""; then
-				SQL_LIBS="$SQL_LIBS -L$PGSQL_LIBDIR"
+				PGSQL_LIBS="$PGSQL_LIBS -L$PGSQL_LIBDIR"
 			fi
-			SQL_LIBS="$SQL_LIBS -lpq"
+			PGSQL_LIBS="$PGSQL_LIBS -lpq"
 			AC_DEFINE(HAVE_PGSQL,, Build with PostgreSQL support)
 			found_sql_drivers="$found_sql_drivers pgsql"
 
@@ -1711,12 +1720,12 @@
 		fi
 		AC_CHECK_HEADER(mysql.h, [
 			if test "$MYSQL_INCLUDE" != ""; then
-				SQL_CFLAGS="$SQL_CFLAGS -I$MYSQL_INCLUDE"
+				MYSQL_CFLAGS="$MYSQL_CFLAGS -I$MYSQL_INCLUDE"
 			fi
 			if test "$MYSQL_LIBDIR" != ""; then
-				SQL_LIBS="$SQL_LIBS -L$MYSQL_LIBDIR"
+				MYSQL_LIBS="$MYSQL_LIBS -L$MYSQL_LIBDIR"
 			fi
-			SQL_LIBS="$SQL_LIBS $mysql_lib"
+			MYSQL_LIBS="$MYSQL_LIBS $mysql_lib"
 
 			AC_CHECK_LIB(mysqlclient, mysql_ssl_set, [
 				AC_DEFINE(HAVE_MYSQL_SSL,, Define if your MySQL library has SSL functions)
@@ -1747,13 +1756,18 @@
 if test $want_sqlite = yes; then
 	AC_CHECK_LIB(sqlite3, sqlite3_open, [
 		AC_CHECK_HEADER(sqlite3.h, [
-			SQL_LIBS="$SQL_LIBS -lsqlite3 -lz"
+			SQLITE_LIBS="$SQLITE_LIBS -lsqlite3 -lz"
 
 			AC_DEFINE(HAVE_SQLITE,, Build with SQLite3 support)
 			found_sql_drivers="$found_sql_drivers sqlite"
 		])
 	])
 fi
+	
+SQL_CFLAGS="$MYSQL_CFLAGS $PGSQL_CFLAGS $SQLITE_CFLAGS"
+if test "$want_sql_plugins" = "no"; then
+	SQL_LIBS="$MYSQL_LIBS $PGSQL_LIBS $SQLITE_LIBS"
+fi
 
 if test "$found_sql_drivers" != "" -o "$want_sql" = "yes"; then
 	if test "$all_sql_drivers" = "yes"; then
@@ -1828,6 +1842,12 @@
 AC_SUBST(AUTH_LIBS)
 AC_SUBST(SQL_CFLAGS)
 AC_SUBST(SQL_LIBS)
+AC_SUBST(MYSQL_CFLAGS)
+AC_SUBST(MYSQL_LIBS)
+AC_SUBST(PGSQL_CFLAGS)
+AC_SUBST(PGSQL_LIBS)
+AC_SUBST(SQLITE_CFLAGS)
+AC_SUBST(SQLITE_LIBS)
 
 AC_SUBST(DICT_LIBS)
 AC_SUBST(dict_drivers)
@@ -1899,17 +1919,27 @@
 dnl ** SQL drivers
 dnl **
 
+build_pgsql=no
+build_mysql=no
+build_sqlite=no
 for driver in $sql_drivers; do
   if test "$driver" = "pgsql"; then
     AC_DEFINE(BUILD_PGSQL,, Built-in PostgreSQL support)
+    build_pgsql=yes
   elif test "$driver" = "mysql"; then
     AC_DEFINE(BUILD_MYSQL,, Built-in MySQL support)
+    build_mysql=yes
   elif test "$driver" = "sqlite"; then
     AC_DEFINE(BUILD_SQLITE,, Built-in SQLite support)
+    build_sqlite=yes
   fi
 done
 
 AC_SUBST(sql_drivers)
+AM_CONDITIONAL(BUILD_PGSQL, test "$build_pgsql" = "yes")
+AM_CONDITIONAL(BUILD_MYSQL, test "$build_mysql" = "yes")
+AM_CONDITIONAL(BUILD_SQLITE, test "$build_sqlite" = "yes")
+AM_CONDITIONAL(SQL_PLUGINS, test "$want_sql_plugins" = "yes")
 
 dnl **
 dnl ** Plugins
@@ -1997,6 +2027,10 @@
 
 AC_OUTPUT
 
+if test "$want_sql_plugins" = "yes"; then
+  sql_drivers="$sql_drivers (plugins)"
+fi
+
 echo
 echo "Install prefix ...................... : $prefix"
 echo "File offsets ........................ : ${offt_bits}bit"