]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/autoconf/configure.in
new devel_bacula + fixes to conio/console
[bacula/bacula] / bacula / autoconf / configure.in
index e18b4107358a32370ff3557f5c8955f1b12deb24..4a1901d9bf2290cc8401ac211f9be2f36baf8a70 100644 (file)
@@ -61,6 +61,8 @@ AC_PATH_PROG(TBL, tbl, tbl)
 AC_PATH_PROG(AR, ar, ar)
 AC_PATH_PROG(RANLIB, ranlib, ranlib)
 AC_PATH_PROG(OPENSSL, openssl, none)
+AC_PATH_PROG(MTX, mtx, mtx)
+AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
 
 test -n "$ARFLAG" || ARFLAGS="cr"
 AC_SUBST(ARFLAGS)
@@ -138,9 +140,12 @@ fi
 
 support_mysql=no
 support_sqlite=no
+support_postgresql=no
 support_smartalloc=yes
-support_readline=yes
+support_readline=no
+support_conio=yes
 support_gnome=no
+gnome_version=
 support_static_tools=no
 support_static_fd=no
 support_static_sd=no
@@ -166,8 +171,25 @@ AC_ARG_ENABLE(gnome,
 
 GNOME_DIR=
 if test x$support_gnome = xyes; then
-    GNOME_INIT
-    GNOME_DIR=src/gnome-console
+  abc=`$PKGCONFIG --exists libgnomeui-2.0`
+  pkg=$?
+  if test $pkg = 0; then
+     GNOME_INCLUDEDIR=`pkg-config --cflags-only-I libgnomeui-2.0`
+     GNOMEUI_LIBS=`pkg-config --libs-only-l libgnomeui-2.0`
+     GNOME_LIBDIR=`pkg-config --libs libgnomeui-2.0`
+     GNOME_LIBS=`pkg-config --libs-only-l libgnomeui-2.0`
+     AC_SUBST(GNOME_INCLUDEDIR)
+     AC_SUBST(GNOMEUI_LIBS)
+     AC_SUBST(GNOME_LIBDIR)
+     AC_SUBST(GNOME_LIBS)
+     GNOME_DIR=src/gnome2-console
+     gnome_version="Version 2.x"
+  else
+dnl do 1.4 stuff
+     GNOME_INIT
+     GNOME_DIR=src/gnome-console
+     gnome_version="Version 1.4"
+  fi
 fi
 AC_SUBST(GNOME_DIR)
 
@@ -255,10 +277,13 @@ AC_ARG_ENABLE(static-cons,
    fi])
 
 STATIC_CONS=
+STATIC_GNOME_CONS=
 if test x$support_static_cons = xyes; then
-   STATIC_CONS="static-console"
+   STATIC_CONS="static-bconsole"
+   STATIC_GNOME_CONS="static-gnome-console"
 fi
 AC_SUBST(STATIC_CONS)
+AC_SUBST(STATIC_GNOME_CONS)
 
 # -------------------------------------------
 # client_only  (default off)
@@ -276,11 +301,34 @@ fi
 AC_SUBST(ALL_DIRS)
 
 # ---------------------------------------------------
-# Check for readline support/directory (default on)
+# Check for conio (Bacula readline substitute)(
+# ---------------------------------------------------
+# this allows you to turn it completely off
+AC_ARG_ENABLE(conio,   
+  [  --disable-conio        disable conio support [enabled]
+                                                     ],
+  [if test x$enableval = xno; then
+    support_conio=no
+  fi])
+
+got_conio="no"
+if test x$support_conio = xyes; then
+   CONS_OBJ="conio.o"
+   CONS_SRC="conio.c"
+   got_conio="yes"
+   AC_CHECK_HEADERS(termcap.h)
+   AC_CHECK_LIB(termcap, tgetent, CONS_LIBS="-ltermcap")
+   support_readline=no
+   AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled]) 
+fi
+
+
+# ---------------------------------------------------
+# Check for readline support/directory (default off)
 # ---------------------------------------------------
 # this allows you to turn it completely off
 AC_ARG_ENABLE(readline,
-  [  --disable-readline      disable readline support [enabled]
+  [  --disable-readline      disable readline support [disable]
                                                      ],
   [if test x$enableval = xno; then
     support_readline=no
@@ -336,7 +384,12 @@ if test x$support_readline = xyes; then
      ]  
    )
 fi
+
+
+
 AC_SUBST(CONS_INC)
+AC_SUBST(CONS_OBJ)
+AC_SUBST(CONS_SRC)
 AC_SUBST(CONS_LIBS)
 AC_SUBST(CONS_LDFLAGS)
 AC_SUBST(READLINE_SRC)
@@ -351,19 +404,9 @@ AC_HEADER_DIRENT
 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat lchown)
 AC_CHECK_FUNCS(nanosleep)
 
-#AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG),
-#   [LIBEXTRAOBJ="$LIBEXTRAOBJ getopt.o getopt1.o"
-#    EXTRAOBJ="$EXTRAOBJ lib/getopt.o lib/getopt1.o"])
-
-AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG))
-
-
-AC_FUNC_STRCOLL
+AC_CHECK_HEADERS(varargs.h)
 
-AC_CHECK_HEADERS(varargs.h \
-               sys/ptem.h sys/pte.h sys/stream.h)      
-
-# End of readline stuff
+# End of readline/conio stuff
 # -----------------------------------------------------------------------
 
 
@@ -498,7 +541,7 @@ AC_ARG_WITH(tcp-wrappers,
   [
     if test "x$withval" != "xno" ; then
        saved_LIBS="$LIBS"
-       LIBS="$LIBS -lwrap -lnsl"
+       LIBS="$saved_LIBS -lwrap"
        AC_MSG_CHECKING(for libwrap)
        AC_TRY_LINK(
          [ #include <tcpd.h>
@@ -510,8 +553,21 @@ AC_ARG_WITH(tcp-wrappers,
            AC_MSG_RESULT(yes)
            AC_DEFINE(HAVE_LIBWRAP)
            TCPW_MSG="yes" 
-         ],
-         [AC_MSG_ERROR([*** libwrap missing]) ]
+         ], [
+           LIBS="$saved_LIBS -lwrap -lnsl"
+           AC_TRY_LINK(
+             [ #include <tcpd.h>
+                int deny_severity = 0;
+                int allow_severity = 0;
+                struct request_info *req; ],
+             [ hosts_access(req); ],
+             [
+                AC_MSG_RESULT(yes)
+                AC_DEFINE(HAVE_LIBWRAP)
+                TCPW_MSG="yes" 
+             ],
+             [AC_MSG_ERROR([*** libwrap missing]) ] ]
+           )
        )
     fi
   ]
@@ -721,17 +777,86 @@ AC_SUBST(fd_password)
 AC_SUBST(sd_password)
 
 
+#
+# Handle users and groups for each daemon
+#
+dir_user=
+AC_ARG_WITH(dir_user,
+    [  --with-dir-user=USER             specify user for Director daemon],
+    [
+       if test "x$withval" != "x" ; then       
+            dir_user=$withval
+       fi
+    ]
+)
 
+dir_group=
+AC_ARG_WITH(dir_group,
+    [  --with-dir-group=GROUP           specify group for Director daemon],
+    [
+       if test "x$withval" != "x" ; then       
+            dir_group=$withval
+       fi
+    ]
+)
 
-# ------------------------------------------------
-# Bacula check for various SQL database engines
-# ------------------------------------------------
-BA_CHECK_MYSQL_DB
+sd_user=
+AC_ARG_WITH(sd_user,
+    [  --with-sd-user=USER              specify user for Storage daemon],
+    [
+       if test "x$withval" != "x" ; then       
+            sd_user=$withval
+       fi
+    ]
+)
+
+sd_group=
+AC_ARG_WITH(sd_group,
+    [  --with-sd-group=GROUP            specify group for Storage daemon],
+    [
+       if test "x$withval" != "x" ; then       
+            sd_group=$withval
+       fi
+    ]
+)
+
+fd_user=
+AC_ARG_WITH(fd_user,
+    [  --with-fd-user=USER              specify user for File daemon],
+    [
+       if test "x$withval" != "x" ; then       
+            fd_user=$withval
+       fi
+    ]
+)
+
+fd_group=
+AC_ARG_WITH(fd_group,
+    [  --with-fd-group=GROUP            specify group for File daemon],
+    [
+       if test "x$withval" != "x" ; then       
+            fd_group=$withval
+       fi
+    ]
+)
 
 
+
+
+AC_SUBST(dir_user)
+AC_SUBST(dir_group)
+AC_SUBST(sd_user)
+AC_SUBST(sd_group)
+AC_SUBST(fd_user)
+AC_SUBST(fd_group)
+
 # ------------------------------------------------
 # Bacula check for various SQL database engines
 # ------------------------------------------------
+BA_CHECK_POSTGRESQL_DB
+
+BA_CHECK_MYSQL_DB
+
 BA_CHECK_SQLITE_DB
 
 AC_SUBST(cats)
@@ -1220,8 +1345,11 @@ debian)
   ;;
 freebsd)
        DISTVER=`uname -a |awk '{print $3}'`
-       PTHREAD_LIB="-pthread"
-       CFLAGS="${CFLAGS} -pthread"
+       VER=`echo $DISTVER | cut -c 1`
+       if test x$VER = x4 ; then
+          PTHREAD_LIB="-pthread"
+          CFLAGS="${CFLAGS} -pthread"
+       fi
        lld="qd"
        llu="qu"
        TAPEDRIVE="/dev/nrsa0"
@@ -1272,8 +1400,14 @@ openbsd)
            platforms/openbsd/bacula-dir"
   ;;
 redhat)
-       DISTVER=`cat /etc/redhat-release | grep release |\
-          cut -f 5 -d ' '`
+       if test `cat /etc/redhat-release | grep release |\
+                  cut -f 3 -d ' '`x = "Enterprise"x ; then
+          DISTVER="Enterprise "`cat /etc/redhat-release | grep release |\
+                   cut -f 6 -d ' '`
+       else
+           DISTVER=`cat /etc/redhat-release | grep release |\
+                    cut -f 5 -d ' '`
+       fi
        TAPEDRIVE="/dev/nst0"
        PSCMD="ps -e -o pid,command"
        PFILES="${PFILES} \
@@ -1336,6 +1470,11 @@ suse)
        TAPEDRIVE="/dev/nst0"
        PSCMD="ps -e -o pid,command"
        hostname=`hostname -s`
+       PFILES="${PFILES} \
+           platforms/suse/Makefile \
+           platforms/suse/bacula-fd \
+           platforms/suse/bacula-sd \
+           platforms/suse/bacula-dir"
   ;;
 suse5)
        DISTNAME=suse
@@ -1343,6 +1482,11 @@ suse5)
        TAPEDRIVE="/dev/nst0"
        PSCMD="ps -e -o pid,command"
        hostname=`hostname -s`
+       PFILES="${PFILES} \
+           platforms/suse/Makefile \
+           platforms/suse/bacula-fd \
+           platforms/suse/bacula-sd \
+           platforms/suse/bacula-dir"
   ;;
 unknown)
        DISTVER=unknown
@@ -1394,20 +1538,25 @@ AC_OUTPUT([autoconf/Make.common \
           scripts/btraceback \
           scripts/startit \
           scripts/stopit \
-          scripts/console \
+          scripts/bconsole \
           scripts/gconsole \
           scripts/bacula \
+          scripts/devel_bacula \
           scripts/fd \
           scripts/Makefile \
           scripts/logrotate \
           scripts/bacula.desktop.gnome1 \
           scripts/bacula.desktop.gnome2 \
+          scripts/mtx-changer \
           doc/Makefile \
           src/Makefile \
+          src/host.h \
           src/console/Makefile \
-          src/console/console.conf \
+          src/console/bconsole.conf \
           src/gnome-console/Makefile \
           src/gnome-console/gnome-console.conf \
+          src/gnome2-console/Makefile \
+          src/gnome2-console/gnome-console.conf \
           src/tconsole/Makefile \
           src/dird/Makefile \
           src/dird/bacula-dir.conf \
@@ -1415,28 +1564,43 @@ AC_OUTPUT([autoconf/Make.common \
           src/stored/Makefile \
           src/stored/bacula-sd.conf \
           src/filed/Makefile \
-          src/filed/host.h \
           src/filed/bacula-fd.conf \
           src/filed/win32/Makefile \
           src/cats/Makefile \
           src/cats/make_catalog_backup \
           src/cats/delete_catalog_backup \
-          src/cats/alter_mysql_tables \
-          src/cats/make_mysql_tables \
-          src/cats/drop_mysql_tables \
+          src/cats/create_postgresql_database \
+          src/cats/update_postgresql_tables \
+          src/cats/make_postgresql_tables \
+          src/cats/grant_postgresql_privileges \
+          src/cats/drop_postgresql_tables \
+          src/cats/drop_postgresql_database \
           src/cats/create_mysql_database \
+          src/cats/update_mysql_tables \
+          src/cats/make_mysql_tables \
           src/cats/grant_mysql_privileges \
-          src/cats/alter_sqlite_tables \
+          src/cats/drop_mysql_tables \
+          src/cats/drop_mysql_database \
+          src/cats/create_sqlite_database \
+          src/cats/update_sqlite_tables \
           src/cats/make_sqlite_tables \
+          src/cats/grant_sqlite_privileges \
           src/cats/drop_sqlite_tables \
-          src/cats/create_sqlite_database \
+          src/cats/drop_sqlite_database \
           src/cats/sqlite \
           src/cats/mysql \
           src/cats/create_bdb_database \
+          src/cats/update_bdb_tables \
           src/cats/make_bdb_tables \
+          src/cats/grant_bdb_privileges \
           src/cats/drop_bdb_tables \
+          src/cats/drop_bdb_database \
+          src/cats/create_bacula_database \
+          src/cats/update_bacula_tables \
+          src/cats/grant_bacula_privileges \
           src/cats/make_bacula_tables \
           src/cats/drop_bacula_tables \
+          src/cats/drop_bacula_database \
           src/findlib/Makefile \
           src/tools/Makefile \
           $PFILES ],  
@@ -1445,21 +1609,29 @@ AC_OUTPUT([autoconf/Make.common \
 
 cd scripts
 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
-chmod 755 console gconsole
+chmod 755 bconsole gconsole mtx-changer devel_bacula
 cd ..
-chmod 755 src/cats/make_mysql_tables src/cats/drop_mysql_tables
-chmod 755 src/cats/make_test_tables src/cats/drop_test_tables
-chmod 755 src/cats/create_mysql_database 
-chmod 755 src/cats/make_catalog_backup src/cats/delete_catalog_backup
-chmod 755 src/cats/alter_mysql_tables
-chmod 755 src/cats/grant_mysql_privileges
-chmod 755 src/cats/make_sqlite_tables src/cats/drop_sqlite_tables 
-chmod 755 src/cats/make_bacula_tables src/cats/drop_bacula_tables 
-chmod 755 src/cats/create_sqlite_database
-chmod 755 src/cats/alter_sqlite_tables
-chmod 755 src/cats/sqlite
-chmod 755 src/cats/make_bdb_tables src/cats/drop_bdb_tables 
-chmod 755 src/cats/create_bdb_database
+
+c=src/cats
+
+chmod 755 $c/create_bacula_database   $c/update_bacula_tables  $c/make_bacula_tables
+chmod 755 $c/grant_bacula_privileges  $c/drop_bacula_tables    $c/drop_bacula_database
+
+chmod 755 $c/create_bdb_database      $c/update_bdb_tables     $c/make_bdb_tables
+chmod 755 $c/grant_bdb_privileges     $c/drop_bdb_tables       $c/drop_bdb_database
+
+chmod 755 $c/create_mysql_database    $c/update_mysql_tables   $c/make_mysql_tables
+chmod 755 $c/grant_mysql_privileges   $c/drop_mysql_tables     $c/drop_mysql_database
+
+chmod 755 $c/create_sqlite_database   $c/update_sqlite_tables  $c/make_sqlite_tables
+chmod 755 $c/grant_sqlite_privileges  $c/drop_sqlite_tables    $c/drop_sqlite_database
+
+chmod 755 $c/create_postgresql_database  $c/update_postgresql_tables $c/make_postgresql_tables
+chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables   $c/drop_postgresql_database
+
+chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
+chmod 755 $c/sqlite
+chmod 755 $c/mysql
 
 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
    largefile_support="yes"
@@ -1518,17 +1690,27 @@ Configuration on `date`:
   Job Output Email:          ${job_email}
   Traceback Email:           ${dump_email}
   SMTP Host Address:         ${smtp_host}
-  Director Port              ${dir_port}
-  File daemon Port           ${fd_port}
-  Storage daemon Port        ${sd_port}
+
+  Director Port:             ${dir_port}
+  File daemon Port:          ${fd_port}
+  Storage daemon Port:       ${sd_port}
+
+  Director User:             ${dir_user}
+  Director Group:            ${dir_group}
+  Storage Daemon User:       ${dir_user}
+  Storage DaemonGroup:       ${dir_group}
+  File Daemon User:          ${dir_user}
+  File Daemon Group:         ${dir_group}
+
   SQL binaries Directory      ${SQL_BINDIR}
 
   Large file support:        $largefile_support
+  Bacula conio support:       ${got_conio} ${CONS_LIBS}
   readline support:          ${got_readline} ${PRTREADLINE_SRC}
   TCP Wrappers support:       ${TCPW_MSG}
   ZLIB support:              ${have_zlib}
   enable-smartalloc:         ${support_smartalloc} 
-  enable-gnome:              ${support_gnome}
+  enable-gnome:              ${support_gnome} ${gnome_version}
   client-only:               ${build_client_only}
 
   " > config.out