From: Dan Langille Date: Tue, 9 Dec 2003 22:00:36 +0000 (+0000) Subject: Support for PostgreSQL. X-Git-Tag: Release-7.0.0~9881 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=66b0a00981498e6ebbefea46141a97196dc29577;p=bacula%2Fbacula Support for PostgreSQL. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@849 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/autoconf/acconfig.h b/bacula/autoconf/acconfig.h index e9cef42055..e7fb0a28fb 100644 --- a/bacula/autoconf/acconfig.h +++ b/bacula/autoconf/acconfig.h @@ -20,6 +20,9 @@ /* Define to `int' if doesn't define. */ #undef ssize_t +/* Define if you want to use PostgreSQL */ +#undef HAVE_POSTGRESQL + /* Define if you want to use MySQL */ #undef HAVE_MYSQL @@ -121,7 +124,7 @@ /* Define to 1 if utime.h exists and declares struct utimbuf. */ #undef HAVE_UTIME_H -#if (HAVE_MYSQL||HAVE_PGSQL||HAVE_MSQL||HAVE_IODBC||HAVE_UNIXODBC||HAVE_SOLID||HAVE_VIRT||HAVE_IBASE||HAVE_ORACLE8||HAVE_ORACLE7||HAVE_EASYSOFT) +#if (HAVE_MYSQL||HAVE_POSTGRESQL||HAVE_MSQL||HAVE_IODBC||HAVE_UNIXODBC||HAVE_SOLID||HAVE_VIRT||HAVE_IBASE||HAVE_ORACLE8||HAVE_ORACLE7||HAVE_EASYSOFT) #define HAVE_SQL #endif diff --git a/bacula/autoconf/aclocal.m4 b/bacula/autoconf/aclocal.m4 index b5f4b4d889..db5969418b 100644 --- a/bacula/autoconf/aclocal.m4 +++ b/bacula/autoconf/aclocal.m4 @@ -615,8 +615,8 @@ fi AC_MSG_CHECKING(for PostgreSQL support) -AC_ARG_WITH(pgsql, -[ --with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL +AC_ARG_WITH(postgresql, +[ --with-postgresql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL base install directory, defaults to /usr/local/pgsql.], [ if test "$withval" != "no"; then @@ -626,26 +626,33 @@ AC_ARG_WITH(pgsql, fi if test "$withval" = "yes"; then if test -f /usr/include/pgsql/libpq-fe.h; then - PGSQL_INCDIR=/usr/include/pgsql + POSTGRESQL_INCDIR=/usr/include/pgsql else - PGSQL_INCDIR=/usr/local/pgsql/include + if test -f /usr/include/libpq-fe.h; then + else + POSTGRESQL_INCDIR=/usr/local/pgsql/include + fi fi if test -f /usr/lib/libpq.a; then - PGSQL_LIBDIR=/usr/lib + POSTGRESQL_LIBDIR=/usr/lib else - PGSQL_LIBDIR=/usr/local/pgsql/lib + if test -f /usr/local/lib/libpq.a; then + POSTGRESQL_LIBDIR=/usr/local/lib + else + POSTGRESQL_LIBDIR=/usr/local/pgsql/lib + fi fi else - PGSQL_INCDIR=$withval/include - test -d $withval/include/pgsql && PGSQL_INCDIR=$withval/include/pgsql - PGSQL_LIBDIR=$withval/lib - test -d $withval/lib/pgsql && PGSQL_LIBDIR=$withval/lib/pgsql + POSTGRESQL_INCDIR=$withval/include + test -d $withval/include/pgsql && POSTGRESQL_INCDIR=$withval/include/pgsql + POSTGRESQL_LIBDIR=$withval/lib + test -d $withval/lib/pgsql && POSTGRESQL_LIBDIR=$withval/lib/pgsql fi - PGSQL_INCLUDE=-I$PGSQL_INCDIR - PGSQL_LFLAGS="-L$PGSQL_LIBDIR -lpq" + POSTGRESQL_INCLUDE=-I$POSTGRESQL_INCDIR + POSTGRESQL_LFLAGS="-L$POSTGRESQL_LIBDIR -lpq" AC_CHECK_FUNC(crypt, , AC_CHECK_LIB(crypt, crypt, [LIBS="-lcrypt $LIBS"])) - AC_DEFINE(HAVE_PGSQL) + AC_DEFINE(HAVE_POSTGRESQL) AC_MSG_RESULT(yes) have_db=yes else @@ -654,8 +661,8 @@ AC_ARG_WITH(pgsql, ],[ AC_MSG_RESULT(no) ]) -AC_SUBST(PGSQL_LFLAGS) -AC_SUBST(PGSQL_INCLUDE) +AC_SUBST(POSTGRESQL_LFLAGS) +AC_SUBST(POSTGRESQL_INCLUDE) AC_MSG_CHECKING(for mSQL support) diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in index db3f80dc3c..0c53e57676 100644 --- a/bacula/autoconf/config.h.in +++ b/bacula/autoconf/config.h.in @@ -21,6 +21,9 @@ /* Define to `int' if doesn't define. */ #undef ssize_t +/* Define if you want to use PostgreSQL */ +#undef HAVE_POSTGRESQL + /* Define if you want to use MySQL */ #undef HAVE_MYSQL @@ -38,7 +41,7 @@ /* Define if you want to use PostgreSQL */ -#undef HAVE_PGSQL +#undef HAVE_POSTGRESQL /* Define if you want to use mSQL */ #undef HAVE_MSQL @@ -121,7 +124,7 @@ /* Define to 1 if utime.h exists and declares struct utimbuf. */ #undef HAVE_UTIME_H -#if (HAVE_MYSQL||HAVE_PGSQL||HAVE_MSQL||HAVE_IODBC||HAVE_UNIXODBC||HAVE_SOLID||HAVE_VIRT||HAVE_IBASE||HAVE_ORACLE8||HAVE_ORACLE7||HAVE_EASYSOFT) +#if (HAVE_MYSQL||HAVE_POSTGRESQL||HAVE_MSQL||HAVE_IODBC||HAVE_UNIXODBC||HAVE_SOLID||HAVE_VIRT||HAVE_IBASE||HAVE_ORACLE8||HAVE_ORACLE7||HAVE_EASYSOFT) #define HAVE_SQL #endif diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index b5b9052e1b..6a1b34bf15 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -140,6 +140,7 @@ fi support_mysql=no support_sqlite=no +support_postgresql=no support_smartalloc=yes support_readline=yes support_gnome=no @@ -814,6 +815,12 @@ AC_SUBST(sd_group) AC_SUBST(fd_user) AC_SUBST(fd_group) +# ------------------------------------------------ +# Bacula check for various SQL database engines +# ------------------------------------------------ +BA_CHECK_POSTGRESQL_DB + + # ------------------------------------------------ # Bacula check for various SQL database engines # ------------------------------------------------ @@ -1518,6 +1525,10 @@ AC_OUTPUT([autoconf/Make.common \ src/cats/Makefile \ src/cats/make_catalog_backup \ src/cats/delete_catalog_backup \ + src/cats/make_postgresql_tables \ + src/cats/drop_postgresql_tables \ + src/cats/create_postgresql_database \ + src/cats/grant_postgresql_privileges \ src/cats/make_mysql_tables \ src/cats/drop_mysql_tables \ src/cats/update_mysql_tables \ @@ -1546,9 +1557,12 @@ chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer chmod 755 bconsole gconsole mtx-changer cd .. chmod 755 src/cats/make_mysql_tables src/cats/drop_mysql_tables +chmod 755 src/cats/make_postgresql_tables src/cats/drop_postgresql_tables chmod 755 src/cats/make_test_tables src/cats/drop_test_tables +chmod 755 src/cats/create_postgresql_database chmod 755 src/cats/create_mysql_database chmod 755 src/cats/make_catalog_backup src/cats/delete_catalog_backup +chmod 755 src/cats/grant_postgresql_privileges chmod 755 src/cats/grant_mysql_privileges chmod 755 src/cats/make_sqlite_tables src/cats/drop_sqlite_tables chmod 755 src/cats/update_sqlite_tables @@ -1625,7 +1639,7 @@ Configuration on `date`: Director User: ${dir_user} Director Group: ${dir_group} Storage Daemon User: ${dir_user} - Storage DaemonGroup: ${dir_group} + Storage Daemon Group: ${dir_group} File Daemon User: ${dir_user} File Daemon Group: ${dir_group}