s4:torture/libnetapi: fix netapi detection
authorStefan Metzmacher <metze@samba.org>
Wed, 3 Jun 2009 12:11:37 +0000 (14:11 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 3 Jun 2009 12:12:36 +0000 (14:12 +0200)
We need to set SMB_ENABLE(TORTURE_LIBNETAPI,NO) first
to overwrite the default of YES for MODULES and
then only set it to YES if netapi was found.

metze

source4/torture/libnetapi/config.m4

index 43724908ca40b70fdc1c308c1adcbb522cd197b1..fadef6981cdae07f30d190402076ca6c350adc1d 100644 (file)
@@ -4,7 +4,7 @@
 
 use_netapi=auto
 AC_ARG_ENABLE(netapi,
-AS_HELP_STRING([--enable-netapi],[Turn on netapi support (default=yes)]),
+AS_HELP_STRING([--enable-netapi],[Turn on netapi support (default=auto)]),
     [if test x$enable_netapi = xno; then
         use_netapi=no
     fi])
@@ -16,13 +16,17 @@ AS_HELP_STRING([--enable-netapi],[Turn on netapi support (default=yes)]),
 #                                                         [use_netapi=no])
 #fi
 
-if test x$use_netapi = xauto; then
+SMB_ENABLE(TORTURE_LIBNETAPI,NO)
+if test x$use_netapi != xno; then
        AC_CHECK_HEADERS(netapi.h)
        AC_CHECK_LIB_EXT(netapi, NETAPI_LIBS, libnetapi_init)
        if test x"$ac_cv_header_netapi_h" = x"yes" -a x"$ac_cv_lib_ext_netapi_libnetapi_init" = x"yes";then
                SMB_ENABLE(NETAPI,YES)
+               SMB_ENABLE(TORTURE_LIBNETAPI,YES)
        else
-               SMB_ENABLE(TORTURE_LIBNETAPI,NO)
+               if test x$use_netapi != xauto; then
+                       AC_MSG_ERROR([--enable-netapi: libnetapi not found])
+               fi
        fi
        SMB_EXT_LIB(NETAPI, $NETAPI_LIBS)
 fi