]> git.sur5r.net Git - bacula/bacula/commitdiff
Apply Joao's patch to separate DB_TYPE and DB_PROG in configure.
authorKern Sibbald <kern@sibbald.com>
Wed, 27 Feb 2008 17:19:44 +0000 (17:19 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 27 Feb 2008 17:19:44 +0000 (17:19 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6498 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/autoconf/bacula-macros/db.m4
bacula/autoconf/configure.in
bacula/configure

index dbc95336580429e43a335c0f58636106c0ee4ad5..df2c980a85dd3d8f82777061995857f22275d21e 100644 (file)
@@ -118,6 +118,66 @@ AC_SUBST(DBI_DBD_DRIVERDIR)
 
 ])
 
+AC_DEFUN([BA_CHECK_DBI_DRIVER],
+[
+db_found=no
+db_prog=no
+AC_MSG_CHECKING(for DBI drivers support)
+AC_ARG_WITH(dbi-driver,
+[
+  --with-dbi-driver@<:@=DRIVER@:>@     Suport for DBI driver.  DRIVER is 
+                          the one DBI driver like Mysql, Postgresql, others.
+                          Default is to not configure any driver.],
+[
+  if test "$withval" != "no"; then
+     case $withval in
+        "mysql")
+           db_prog="mysql"
+           if test -f /usr/local/mysql/bin/mysql; then
+              SQL_BINDIR=/usr/local/mysql/bin
+           elif test -f /usr/bin/mysql; then
+              SQL_BINDIR=/usr/bin
+           elif test -f /usr/local/bin/mysql; then
+              SQL_BINDIR=/usr/local/bin
+           else
+              AC_MSG_RESULT(no)
+              AC_MSG_ERROR(Unable to find mysql in standard locations)
+           fi
+        ;;
+        "postgresql")
+           db_prog="postgresql"
+           PG_CONFIG=`which pg_config`
+           if test -n "$PG_CONFIG";then
+              SQL_BINDIR=`"$PG_CONFIG" --bindir`
+           elif test -f /usr/local/bin/psql; then
+              SQL_BINDIR=/usr/local/bin
+           elif test -f /usr/bin/psql; then
+              SQL_BINDIR=/usr/bin
+           else
+              AC_MSG_RESULT(no)
+              AC_MSG_ERROR(Unable to find psql in standard locations)
+          fi
+        ;;
+        *)
+           AC_MSG_RESULT(no)
+           AC_MSG_ERROR(Unable to set DBI driver. $withval is not supported)
+        ;;
+     esac
+
+     AC_MSG_RESULT(yes)
+     DB_PROG=$db_prog
+
+  else
+     AC_MSG_RESULT(no)
+  fi
+],[
+  AC_MSG_RESULT(no)
+])
+AC_SUBST(SQL_BINDIR)
+AC_SUBST(DB_PROG)
+
+])
+
 
 AC_DEFUN([BA_CHECK_MYSQL_DB],
 [
index ad7144a1030c0d0dc26165175bcb2e77808f910d..75e849dc9ef37a0d6ff4049c94afcacacb6b64bf 100644 (file)
@@ -1332,6 +1332,8 @@ BA_CHECK_SQLITE_DB
 
 BA_CHECK_DBI_DB
 
+BA_CHECK_DBI_DRIVER
+
 AC_SUBST(cats)
 AC_SUBST(DB_TYPE)
 
@@ -1361,6 +1363,11 @@ if test x$DB_TYPE = xpostgresql; then
    fi
 fi
 
+if test x$DB_TYPE = xdbi; then
+   DB_TYPE=$DB_PROG
+   db_type=$DB_PROG
+fi
+
 if test $support_batch_insert = yes ; then
    AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
 fi
index 85c2f05f2b770da0549b2ce8f082ff9b6593e7f5..9f583fd37c6073115d88b732f260a75022aca182 100755 (executable)
@@ -832,6 +832,7 @@ SQL_LFLAGS
 SQL_INCLUDE
 SQL_BINDIR
 DBI_DBD_DRIVERDIR
+DB_PROG
 cats
 DB_TYPE
 GETCONF
@@ -1537,6 +1538,10 @@ Optional Packages:
   --with-dbi[=DIR]     Include DBI support.  DIR is the DBD base
                           install directory, default is to search through
                           a number of common places for the DBI files.
+
+  --with-dbi-driver[=DRIVER]     Suport for DBI driver.  DRIVER is
+                          the one DBI driver like Mysql, Postgresql, others.
+                          Default is to not configure any driver.
   --with-x                use the X Window System
 
 Some influential environment variables:
 
 
 
+db_found=no
+db_prog=no
+{ echo "$as_me:$LINENO: checking for DBI drivers support" >&5
+echo $ECHO_N "checking for DBI drivers support... $ECHO_C" >&6; }
+
+# Check whether --with-dbi-driver was given.
+if test "${with_dbi_driver+set}" = set; then
+  withval=$with_dbi_driver;
+  if test "$withval" != "no"; then
+     case $withval in
+        "mysql")
+           db_prog="mysql"
+           if test -f /usr/local/mysql/bin/mysql; then
+              SQL_BINDIR=/usr/local/mysql/bin
+           elif test -f /usr/bin/mysql; then
+              SQL_BINDIR=/usr/bin
+           elif test -f /usr/local/bin/mysql; then
+              SQL_BINDIR=/usr/local/bin
+           else
+              { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+              { { echo "$as_me:$LINENO: error: Unable to find mysql in standard locations" >&5
+echo "$as_me: error: Unable to find mysql in standard locations" >&2;}
+   { (exit 1); exit 1; }; }
+           fi
+        ;;
+        "postgresql")
+           db_prog="postgresql"
+           PG_CONFIG=`which pg_config`
+           if test -n "$PG_CONFIG";then
+              SQL_BINDIR=`"$PG_CONFIG" --bindir`
+           elif test -f /usr/local/bin/psql; then
+              SQL_BINDIR=/usr/local/bin
+           elif test -f /usr/bin/psql; then
+              SQL_BINDIR=/usr/bin
+           else
+              { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+              { { echo "$as_me:$LINENO: error: Unable to find psql in standard locations" >&5
+echo "$as_me: error: Unable to find psql in standard locations" >&2;}
+   { (exit 1); exit 1; }; }
+          fi
+        ;;
+        *)
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+           { { echo "$as_me:$LINENO: error: Unable to set DBI driver. $withval is not supported" >&5
+echo "$as_me: error: Unable to set DBI driver. $withval is not supported" >&2;}
+   { (exit 1); exit 1; }; }
+        ;;
+     esac
+
+     { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+     DB_PROG=$db_prog
+
+  else
+     { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+  fi
+
+else
+
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+
+
+
+
+
+
 
 
 # -------------------------------------------
@@ -18024,6 +18103,11 @@ if test x$DB_TYPE = xpostgresql; then
    fi
 fi
 
+if test x$DB_TYPE = xdbi; then
+   DB_TYPE=$DB_PROG
+   db_type=$DB_PROG
+fi
+
 if test $support_batch_insert = yes ; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -31285,6 +31369,7 @@ SQL_LFLAGS!$SQL_LFLAGS$ac_delim
 SQL_INCLUDE!$SQL_INCLUDE$ac_delim
 SQL_BINDIR!$SQL_BINDIR$ac_delim
 DBI_DBD_DRIVERDIR!$DBI_DBD_DRIVERDIR$ac_delim
+DB_PROG!$DB_PROG$ac_delim
 cats!$cats$ac_delim
 DB_TYPE!$DB_TYPE$ac_delim
 GETCONF!$GETCONF$ac_delim
@@ -31313,7 +31398,7 @@ DISTVER!$DISTVER$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 54; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 55; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5