]> git.sur5r.net Git - bacula/bacula/commitdiff
Support for PostgreSQL.
authorDan Langille <dan@langille.org>
Tue, 9 Dec 2003 22:00:36 +0000 (22:00 +0000)
committerDan Langille <dan@langille.org>
Tue, 9 Dec 2003 22:00:36 +0000 (22:00 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@849 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/autoconf/acconfig.h
bacula/autoconf/aclocal.m4
bacula/autoconf/config.h.in
bacula/autoconf/configure.in

index e9cef42055dd2798dbf4493faded6c55962d72db..e7fb0a28fb4051d54a830027328159381cdc7928 100644 (file)
@@ -20,6 +20,9 @@
 /* Define to `int' if <sys/types.h> 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
 
 /* 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
 
index b5f4b4d889a971b454466810664d77744daf0106..db5969418b4fde0bddc787d356f058dfd59e1ba4 100644 (file)
@@ -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)
index db3f80dc3cca8d4d9711d3f9f8f1fc039dfb36a5..0c53e5767645d41776a280d61e4243d1d9388a44 100644 (file)
@@ -21,6 +21,9 @@
 /* Define to `int' if <sys/types.h> 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
 /* 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
 
index b5b9052e1b52899c9f42e10d0df320c9d596f563..6a1b34bf15c8fcb66b4284f0f7390d90144254b2 100644 (file)
@@ -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}