]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/autoconf/configure.in
bat: cleanup job and mediainfo panel
[bacula/bacula] / bacula / autoconf / configure.in
index 470c7288f43b35a3f6507a77ec8e3b639ac149ff..149f9e7c3eb4ef17ce59979a7082735e0546ad4d 100644 (file)
@@ -566,8 +566,8 @@ AC_ARG_ENABLE(static-tools,
    [
        if test x$enableval = xyes; then
          if test x$use_libtool = xyes; then
-            echo "Libtool is enabled, not compatible with static tools, please rerun configure with --disable-libtool"
-            exit 1
+            AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
+  please rerun configure with --disable-libtool])
          fi
          support_static_tools=yes
        fi
@@ -588,8 +588,8 @@ AC_ARG_ENABLE(static-fd,
    [
        if test x$enableval = xyes; then
          if test x$use_libtool = xyes; then
-            echo "Libtool is enabled, not compatible with static tools, please rerun configure with --disable-libtool"
-            exit 1
+            AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
+  please rerun configure with --disable-libtool])
          fi
          support_static_fd=yes
        fi
@@ -610,8 +610,8 @@ AC_ARG_ENABLE(static-sd,
    [
        if test x$enableval = xyes; then
          if test x$use_libtool = xyes; then
-            echo "Libtool is enabled, not compatible with static tools, please rerun configure with --disable-libtool"
-            exit 1
+            AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
+  please rerun configure with --disable-libtool])
          fi
          support_static_sd=yes
        fi
@@ -632,8 +632,8 @@ AC_ARG_ENABLE(static-dir,
    [
        if test x$enableval = xyes; then
          if test x$use_libtool = xyes; then
-            echo "Libtool is enabled, not compatible with static tools, please rerun configure with --disable-libtool"
-            exit 1
+            AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
+  please rerun configure with --disable-libtool])
          fi
          support_static_dir=yes
        fi
@@ -654,8 +654,8 @@ AC_ARG_ENABLE(static-cons,
    [
        if test x$enableval = xyes; then
          if test x$use_libtool = xyes; then
-            echo "Libtool is enabled, not compatible with static tools, please rerun configure with --disable-libtool"
-            exit 1
+            AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
+  please rerun configure with --disable-libtool])
          fi
          support_static_cons=yes
        fi
@@ -922,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
@@ -1156,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)
@@ -1210,6 +1223,24 @@ AC_ARG_WITH(basename,
 
 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)
@@ -2317,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
    ]
@@ -2329,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,
       [
@@ -2363,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,
       [
@@ -2439,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
 
@@ -2510,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`
@@ -2565,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
@@ -2603,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
@@ -2667,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
@@ -2691,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"
@@ -2714,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"
@@ -2730,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"
@@ -2760,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"
@@ -2778,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"
@@ -2954,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"
@@ -2967,6 +2978,7 @@ 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}