]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/autoconf/configure.in
bat: cleanup job and mediainfo panel
[bacula/bacula] / bacula / autoconf / configure.in
index a3c703cd80cbfafbe324d482425da0d293dccdef..149f9e7c3eb4ef17ce59979a7082735e0546ad4d 100644 (file)
@@ -1,4 +1,4 @@
-lal
+dnl
 dnl
 dnl Process this file with autoconf to produce a configure script.
 dnl
@@ -279,7 +279,6 @@ fi
 dnl -------------------------------------------------------------------------
 dnl  If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
 dnl -------------------------------------------------------------------------
-dnl z
 if test x$htmldir = x${docdir} ; then
    htmldir=`eval echo ${docdir}bacula/html`
 fi
@@ -287,7 +286,6 @@ fi
 dnl -------------------------------------------------------------------------
 dnl  If the user has not set --docdir, we default to /usr/share/doc/
 dnl -------------------------------------------------------------------------
-dnl z
 if test x$docdir = x'/usr/share/doc/' ; then
    docdir=`eval echo ${docdir}bacula`
 fi
@@ -567,6 +565,10 @@ AC_ARG_ENABLE(static-tools,
    AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
    [
        if test x$enableval = xyes; then
+         if test x$use_libtool = xyes; then
+            AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
+  please rerun configure with --disable-libtool])
+         fi
          support_static_tools=yes
        fi
    ]
@@ -585,6 +587,10 @@ AC_ARG_ENABLE(static-fd,
    AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
    [
        if test x$enableval = xyes; then
+         if test x$use_libtool = xyes; then
+            AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
+  please rerun configure with --disable-libtool])
+         fi
          support_static_fd=yes
        fi
    ]
@@ -603,6 +609,10 @@ AC_ARG_ENABLE(static-sd,
    AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
    [
        if test x$enableval = xyes; then
+         if test x$use_libtool = xyes; then
+            AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
+  please rerun configure with --disable-libtool])
+         fi
          support_static_sd=yes
        fi
    ]
@@ -621,6 +631,10 @@ AC_ARG_ENABLE(static-dir,
    AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
    [
        if test x$enableval = xyes; then
+         if test x$use_libtool = xyes; then
+            AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
+  please rerun configure with --disable-libtool])
+         fi
          support_static_dir=yes
        fi
    ]
@@ -639,6 +653,10 @@ AC_ARG_ENABLE(static-cons,
    AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
    [
        if test x$enableval = xyes; then
+         if test x$use_libtool = xyes; then
+            AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
+  please rerun configure with --disable-libtool])
+         fi
          support_static_cons=yes
        fi
    ]
@@ -904,35 +922,43 @@ AC_ARG_WITH(python,
        PYTHON_LIBS=
        if test "$withval" != "no"; then
          if test "$withval" = "yes"; then
-            for python_root in /usr /usr/local /usr/sfw; do
-               for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
-                  if test -f $python_root/include/${ver}/Python.h; then
-                     PYTHON_INCDIR=-I$python_root/include/${ver}
-                     if test -d $python_root/lib64/${ver}/config; then
-                        PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
-                     else
-                        PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
+            if test -e /usr/bin/python-config ; then
+               PYTHON_INCDIR=`/usr/bin/python-config --includes`
+               PYTHON_LIBS=`/usr/bin/python-config --libs`
+            else
+               for python_root in /usr /usr/local /usr/sfw; do
+                  for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
+                     if test -f $python_root/include/${ver}/Python.h; then
+                        PYTHON_INCDIR=-I$python_root/include/${ver}
+                        if test -d $python_root/lib64/${ver}/config; then
+                           PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
+                        else
+                           PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
+                        fi
+                        break 
                      fi
-                     break 
-                  fi
+                  done
                done
-            done
 
-            if test x$PYTHON_INCDIR = x; then
-               if test -f $prefix/include/Python.h; then
-                  PYTHON_INCDIR=-I$prefix/include
-                  if test -d $prefix/lib64/config; then
-                     PYTHON_LIBS="-L$prefix/lib64/config -lpython"
+               if test x$PYTHON_INCDIR = x; then
+                  if test -f $prefix/include/Python.h; then
+                     PYTHON_INCDIR=-I$prefix/include
+                     if test -d $prefix/lib64/config; then
+                        PYTHON_LIBS="-L$prefix/lib64/config -lpython"
+                     else
+                        PYTHON_LIBS="-L$prefix/lib/config -lpython"
+                     fi
                   else
-                     PYTHON_LIBS="-L$prefix/lib/config -lpython"
+                     AC_MSG_RESULT(no)
+                     AC_MSG_ERROR(Unable to find Python.h in standard locations)
                   fi
-               else
-                  AC_MSG_RESULT(no)
-                  AC_MSG_ERROR(Unable to find Python.h in standard locations)
                fi
             fi
          else
-            if test -f $withval/Python.h; then
+            if test -e $withval/bin/python-config ; then
+               PYTHON_INCDIR=`$withval/bin/python-config --includes`
+               PYTHON_LIBS=`$withval/bin/python-config --libs`
+            elif test -f $withval/Python.h; then
                PYTHON_INCDIR=-I$withval
                PYTHON_LIBS="-L$withval/config -lpython"
             elif test -f $withval/include/Python.h; then
@@ -1138,6 +1164,11 @@ else
    OPENSSL_INC=""
 fi
 
+if test "$support_tls" = "no"; then
+   OPENSSL_LIBS=""
+   OPENSSL_INC=""
+fi  
+
 AC_MSG_RESULT([$support_tls])
 AC_SUBST(OPENSSL_LIBS)
 AC_SUBST(OPENSSL_INC)
@@ -1165,7 +1196,7 @@ AC_SUBST(working_dir)
 dnl ------------------------------------------------------------------
 dnl If the user has not set archivedir, we set our default as /tmp
 dnl ------------------------------------------------------------------
-archive_dir=/tmp
+archivedir=/tmp
 AC_ARG_WITH(archivedir,
    AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
    [
@@ -1177,6 +1208,40 @@ AC_ARG_WITH(archivedir,
 
 AC_SUBST(archivedir)
 
+dnl ------------------------------------------------------------------
+dnl Allow the user to specify the daemon resource name default hostname
+dnl ------------------------------------------------------------------
+basename=`hostname`
+AC_ARG_WITH(basename,
+   AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
+   [
+       if test "x$withval" != "xno" ; then     
+         basename=$withval
+       fi
+   ]
+)
+
+AC_SUBST(basename)
+
+dnl ------------------------------------------------------------------
+dnl Allow the user to override the hostname (default = machine hostname)
+dnl ------------------------------------------------------------------
+hostname=`uname -n | cut -d '.' -f 1`
+if test x${hostname} = x ; then
+  hostname="localhost"
+fi
+AC_ARG_WITH(hostname,
+   AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
+   [
+       if test "x$withval" != "xno" ; then
+        hostname=$withval
+       fi
+   ]
+)
+
+AC_SUBST(hostname)
+
+
 dnl ------------------------------------------
 dnl Where to place scriptdir (script files)
 dnl ------------------------------------------
@@ -1192,10 +1257,42 @@ AC_ARG_WITH(scriptdir,
 
 AC_SUBST(scriptdir)
 
+
+dnl ------------------------------------------
+dnl Where to place bsrdir (bsr files)
+dnl ------------------------------------------
+bsrdir=/tmp
+AC_ARG_WITH(bsrdir,
+   AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
+   [
+       if test "x$withval" != "xno" ; then     
+         bsrdir=$withval
+       fi
+   ]
+)
+
+AC_SUBST(bsrdir)
+
+dnl ------------------------------------------
+dnl Where to place logdir (bsr files)
+dnl ------------------------------------------
+logdir=/tmp
+AC_ARG_WITH(logdir,
+   AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
+   [
+       if test "x$withval" != "xno" ; then     
+         logdir=$withval
+       fi
+   ]
+)
+
+AC_SUBST(logdir)
+
+
 # ------------------------------------------
 # Where to place plugindir (plugin files)
 # ------------------------------------------
-plugindir=`eval echo ${sysconfdir}`
+plugindir=`eval echo ${libdir}`
 AC_ARG_WITH(plugindir,
    AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
    [
@@ -2251,11 +2348,13 @@ fi
 dnl
 dnl Check for ACL support and libraries
 dnl
-support_acl=yes
+support_acl=auto
 AC_ARG_ENABLE(acl,
    AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
    [
-       if test x$enableval = xno; then
+       if test x$enableval = xyes; then
+         support_acl=yes
+       elif test x$enableval = xno; then
          support_acl=no
        fi
    ]
@@ -2263,7 +2362,7 @@ AC_ARG_ENABLE(acl,
 
 have_acl=no
 have_extended_acl=no
-if test x$support_acl = xyes; then
+if test x$support_acl = xyes -o x$support_acl = xauto; then
    AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
    AC_CHECK_FUNC(acl_get_file,
       [
@@ -2297,30 +2396,38 @@ if test x$support_acl = xyes; then
          )
       ]
    )
-   if test $have_acl = yes; then
-      AC_DEFINE([HAVE_ACL], [], [Normal attribute support])
-   fi
 
-   if test $have_extended_acl = yes; then
-      AC_DEFINE([HAVE_EXTENDED_ACL], [], [Extended attribute support])
+   if test x$support_acl = xyes -a $have_acl != yes; then
+      AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found, 
+  please either load the acl libraries or rerun configure without --enable-acl])
+   else
+      if test $have_acl = yes; then
+        AC_DEFINE([HAVE_ACL], [], [Normal attribute support])
+      fi
+
+      if test $have_extended_acl = yes; then
+        AC_DEFINE([HAVE_EXTENDED_ACL], [], [Extended attribute support])
+      fi
    fi
 fi
 
 dnl
 dnl Check for XATTR support
 dnl
-support_xattr=yes
+support_xattr=auto
 AC_ARG_ENABLE(xattr,
    AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
    [
-       if test x$enableval = xno; then
+       if test x$enableval = xyes; then
+         support_xattr=yes
+       elif test x$enableval = xno; then
          support_xattr=no
        fi
    ]
 )
 
 have_xattr=no
-if test x$support_xattr = xyes; then
+if test x$support_xattr = xyes -o x$support_xattr = xauto; then
    AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
    AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
       [
@@ -2373,8 +2480,13 @@ if test x$support_xattr = xyes; then
       fi
    fi
 
-   if test $have_xattr = yes; then
-      AC_DEFINE([HAVE_XATTR], [], [XATTR support])
+   if test x$support_xattr = xyes -a $have_xattr != yes; then
+      AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found, 
+  please either load the xattr libraries or rerun configure without --enable-xatt])
+   else
+      if test $have_xattr = yes; then
+        AC_DEFINE([HAVE_XATTR], [], [XATTR support])
+      fi
    fi
 fi
 
@@ -2444,10 +2556,17 @@ PFILES="platforms/Makefile"
 PSCMD="ps -e"
 WIN32=
 MACOSX=
+
 hostname=`uname -n | cut -d '.' -f 1`
 if test x${hostname} = x ; then
    hostname="localhost"
 fi
+dnl Make sure hostname is resolved
+ping -c 1 $hostname 2>/dev/null 1>/dev/null
+if test ! $? = 0; then
+  hostname="localhost"
+fi
+
 case "$DISTNAME" in
 aix)
    DISTVER=`uname -r`
@@ -2499,11 +2618,6 @@ darwin)
       platforms/darwin/Makefile"
   ;;
 debian)
-   dnl Make sure hostname is resolved
-   ping -c 1 $hostname 2>&1 1>/dev/null
-   if test ! $? = 0; then
-      hostname="localhost"
-   fi
    if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
       DISTNAME="ubuntu"
    fi
@@ -2537,11 +2651,6 @@ debian)
    fi
   ;;
 freebsd)
-   dnl Make sure hostname is resolved
-   ping -c 1 $hostname 2>&1 1>/dev/null
-   if test ! $? = 0; then
-      hostname="localhost"
-   fi
    DISTVER=`uname -a |awk '{print $3}'`
    VER=`echo $DISTVER | cut -c 1`
    if test x$VER = x4 ; then
@@ -2601,11 +2710,6 @@ openbsd)
        platforms/openbsd/bacula-dir"
   ;;
 redhat)
-   dnl Make sure hostname is resolved
-   ping -c 1 $hostname 2>&1 1>/dev/null
-   if test ! $? = 0; then
-      hostname="localhost"
-   fi
    if test -f /etc/whitebox-release ; then
       f=/etc/whitebox-release
    else
@@ -2625,16 +2729,10 @@ redhat)
        platforms/redhat/Makefile \
        platforms/redhat/bacula-fd \
        platforms/redhat/bacula-sd \
-       platforms/redhat/bacula-dir \
-       platforms/redhat/bacula.spec \
+       platforms/redhat/bacula-dir
        "
   ;;
 mandrake)
-   dnl Make sure hostname is resolved
-   ping -c 1 $hostname 2>&1 1>/dev/null
-   if test ! $? = 0; then
-      hostname="localhost"
-   fi
    DISTVER=`cat /etc/mandrake-release | grep release |\
       cut -f 5 -d ' '`
    TAPEDRIVE="/dev/nst0"
@@ -2648,11 +2746,6 @@ mandrake)
        "
   ;;
 gentoo)
-   dnl Make sure hostname is resolved
-   ping -c 1 $hostname 2>&1 1>/dev/null
-   if test ! $? = 0; then
-      hostname="localhost"
-   fi
    DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
    TAPEDRIVE="/dev/nst0"
    PSCMD="ps -e -o pid,command"
@@ -2664,11 +2757,6 @@ gentoo)
        platforms/gentoo/bacula-dir"
   ;;
 slackware)
-   dnl Make sure hostname is resolved
-   ping -c 1 $hostname 2>&1 1>/dev/null
-   if test ! $? = 0; then
-      hostname="localhost"
-   fi
    DISTVER=`cat /etc/slackware-version`
    TAPEDRIVE="/dev/nst0"
    PSCMD="ps -e -o pid,command"
@@ -2694,11 +2782,6 @@ solaris)
    LIBS="$LIBS -lresolv"
   ;;
 suse)
-   dnl Make sure hostname is resolved
-   ping -c 1 $hostname 2>&1 1>/dev/null
-   if test ! $? = 0; then
-      hostname="localhost"
-   fi
    DISTVER=`cat /etc/SuSE-release |grep VERSION|\
        cut -f 3 -d ' '`
    TAPEDRIVE="/dev/nst0"
@@ -2712,11 +2795,6 @@ suse)
        platforms/suse/bacula.spec"
   ;;
 suse5)
-   dnl Make sure hostname is resolved
-   ping -c 1 $hostname 2>&1 1>/dev/null
-   if test ! $? = 0; then
-      hostname="localhost"
-   fi
    DISTNAME=suse
    DISTVER=5.x
    TAPEDRIVE="/dev/nst0"
@@ -2888,8 +2966,7 @@ AC_OUTPUT([autoconf/Make.common \
 
 if test "${support_bat}" = "yes" ; then
    if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
-      echo "Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation"
-      exit 1
+      AC_MSG_ERROR([Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation])
    fi
 
    QMAKEBIN="qmake"
@@ -2900,6 +2977,8 @@ if test "${support_bat}" = "yes" ; then
   
    cd src/qt-console
    echo "Creating bat Makefile"
+   touch bat
+   chmod 755 bat
    $QMAKEBIN
    make clean
    cd ${BUILD_DIR}