build: handle libsmbsharemodes by SMB_LIBRARY() and correctly create SONAME file.
[tprouty/samba.git] / source / configure.in
index 59d555e4123fbc0868e49a7f6689232a75cf0a33..9f0c794847ef786b1c12438e2f6fc0f992d4885e 100644 (file)
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 
-dnl We must use autotools 2.53 or above
-AC_PREREQ(2.53)
+dnl We must use autotools 2.54 or above
+AC_PREREQ(2.54)
 
 AC_INIT([Samba],[3],[samba-technical@samba.org])
 
@@ -86,22 +86,15 @@ AC_SUBST(LIBADDNS)
 
 AC_SUBST(INSTALL_LIBWBCLIENT)
 AC_SUBST(UNINSTALL_LIBWBCLIENT)
+AC_SUBST(LIBWBCLIENT_SHARED_TARGET)
 AC_SUBST(LIBWBCLIENT_SHARED)
+AC_SUBST(LIBWBCLIENT_STATIC_TARGET)
 AC_SUBST(LIBWBCLIENT_STATIC)
 AC_SUBST(LIBWBCLIENT)
 AC_SUBST(WINBIND_LIBS)
 
 AC_SUBST(LIBSAMBAUTIL_SHARED)
 
-AC_SUBST(INSTALL_LIBSMBCLIENT)
-AC_SUBST(UNINSTALL_LIBSMBCLIENT)
-AC_SUBST(LIBSMBCLIENT_SHARED)
-AC_SUBST(LIBSMBCLIENT)
-AC_SUBST(INSTALL_LIBSMBSHAREMODES)
-AC_SUBST(UNINSTALL_LIBSMBSHAREMODES)
-AC_SUBST(LIBSMBSHAREMODES_SHARED)
-AC_SUBST(LIBSMBSHAREMODES)
-
 AC_SUBST(PRINT_LIBS)
 AC_SUBST(AUTH_LIBS)
 AC_SUBST(ACL_LIBS)
@@ -334,7 +327,7 @@ fi
 # and don't truncate the values to INT_MAX
 # a runtime test is needed here
 AC_SUBST(PIDL_ARGS)
-AC_CACHE_CHECK([that the C compiler understands negative enum values],SMB_BUILD_CC_NEGATIVE_ENUM_VALUES, [
+AC_CACHE_CHECK([that the C compiler understands negative enum values],samba_cv_CC_NEGATIVE_ENUM_VALUES, [
     AC_TRY_RUN(
 [
        #include <stdio.h>
@@ -355,8 +348,8 @@ AC_CACHE_CHECK([that the C compiler understands negative enum values],SMB_BUILD_
                return 0;
        }
 ],
-       SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes,SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=no)])
-if test x"$SMB_BUILD_CC_NEGATIVE_ENUM_VALUES" != x"yes"; then
+       samba_cv_CC_NEGATIVE_ENUM_VALUES=yes,samba_cv__CC_NEGATIVE_ENUM_VALUES=no)])
+if test x"$samba_cv_CC_NEGATIVE_ENUM_VALUES" != x"yes"; then
        AC_MSG_WARN([using --unit-enums for pidl])
        PIDL_ARGS="$PIDL_ARGS --uint-enums"
 fi
@@ -663,7 +656,7 @@ done
 AC_SUBST(LIBREPLACE_OBJS)
 
 # add -ldl to the global LIBS
-LIBS="${LIBS} ${LIBDL}"
+LIBS="${LIBS} ${LIBDL} ${LIBREPLACE_NETWORK_LIBS}"
 
 AC_CHECK_HEADERS(aio.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h rpc/nettype.h)
 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h memory.h alloca.h)
@@ -997,40 +990,6 @@ AC_CHECK_LIB(readline, history_list,
             [],
             [$TERMLIBS])
 
-# The following test taken from the cvs sources
-# If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
-# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
-# libsocket.so which has a bad implementation of gethostbyname (it
-# only looks in /etc/hosts), so we only look for -lsocket if we need
-# it.
-AC_CHECK_FUNCS(connect)
-if test x"$ac_cv_func_connect" = x"no"; then
-    case "$LIBS" in
-    *-lnsl*) ;;
-    *) AC_CHECK_LIB(nsl_s, connect) ;;
-    esac
-    case "$LIBS" in
-    *-lnsl*) ;;
-    *) AC_CHECK_LIB(nsl, connect) ;;
-    esac
-    case "$LIBS" in
-    *-lsocket*) ;;
-    *) AC_CHECK_LIB(socket, connect) ;;
-    esac
-    case "$LIBS" in
-    *-linet*) ;;
-    *) AC_CHECK_LIB(inet, connect) ;;
-    esac
-    dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
-    dnl has been cached.
-    if test x"$ac_cv_lib_socket_connect" = x"yes" ||
-       test x"$ac_cv_lib_inet_connect" = x"yes"; then
-        # ac_cv_func_connect=yes
-        # don't!  it would cause AC_CHECK_FUNC to succeed next time configure is run
-        AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()])
-    fi
-fi
-
 ###############################################
 # test for where we get yp_get_default_domain() from
 AC_SEARCH_LIBS(yp_get_default_domain, [nsl])
@@ -1300,7 +1259,7 @@ fi
 # "struct timespec" or "timespec_t". Linux doesn't have timespec_t, so we
 # prefer struct timespec.
 
-AC_CACHE_CHECK([whether struct stat has sub-second timestamps], samba_stat_hires,
+AC_CACHE_CHECK([whether struct stat has sub-second timestamps], samba_cv_stat_hires,
     [
        AC_TRY_COMPILE(
            [
@@ -1328,10 +1287,10 @@ AC_CACHE_CHECK([whether struct stat has sub-second timestamps], samba_stat_hires
                t.tv_sec = s.st_atim.tv_sec;
                t.tv_nsec = s.st_atim.tv_nsec;
            ],
-           samba_stat_hires=yes, samba_stat_hires=no)
+           samba_cv_stat_hires=yes, samba_cv_stat_hires=no)
     ])
 
-if test x"$samba_stat_hires" = x"yes" ; then
+if test x"$samba_cv_stat_hires" = x"yes" ; then
     AC_DEFINE(HAVE_STAT_ST_MTIM, 1, [whether struct stat contains st_mtim])
     AC_DEFINE(HAVE_STAT_ST_ATIM, 1, [whether struct stat contains st_atim])
     AC_DEFINE(HAVE_STAT_ST_CTIM, 1, [whether struct stat contains st_ctim])
@@ -1339,7 +1298,7 @@ if test x"$samba_stat_hires" = x"yes" ; then
            [whether struct stat has sub-second timestamps])
 fi
 
-AC_CACHE_CHECK([whether struct stat has sub-second timestamps without struct timespec], samba_stat_hires_notimespec,
+AC_CACHE_CHECK([whether struct stat has sub-second timestamps without struct timespec], samba_cv_stat_hires_notimespec,
     [
        AC_TRY_COMPILE(
            [
@@ -1367,10 +1326,10 @@ AC_CACHE_CHECK([whether struct stat has sub-second timestamps without struct tim
                t.tv_sec = s.st_atime;
                t.tv_nsec = s.st_atimensec;
            ],
-           samba_stat_hires=yes, samba_stat_hires=no)
+           samba_cv_stat_hires=yes, samba_cv_stat_hires=no)
     ])
 
-if test x"$samba_stat_hires_notimespec" = x"yes" ; then
+if test x"$samba_cv_stat_hires_notimespec" = x"yes" ; then
     AC_DEFINE(HAVE_STAT_ST_MTIMENSEC, 1, [whether struct stat contains st_mtimensec])
     AC_DEFINE(HAVE_STAT_ST_ATIMENSEC, 1, [whether struct stat contains st_atimensec])
     AC_DEFINE(HAVE_STAT_ST_CTIMENSEC, 1, [whether struct stat contains st_ctimensec])
@@ -1533,6 +1492,10 @@ EOF
        fi
 fi
 
+# Set defaults
+SYMSEXT="syms"
+AC_SUBST(SYMSEXT)
+
 # Assume non-shared by default and override below
 BLDSHARED="false"
 
@@ -1628,7 +1591,9 @@ DSO_EXPORTS=""
                        ;;
                *aix*) AC_DEFINE(AIX,1,[Whether the host os is aix])
                        BLDSHARED="true"
-                       LDSHFLAGS="-Wl,-G,-bexpfull,-bbigtoc"
+                       # use expfull to export underscored symbols
+                       # add rtl to remove /lib/crt0.o warning
+                       LDSHFLAGS="-Wl,-G,-bexpfull,-bbigtoc,-brtl"
                        DYNEXP="-Wl,-brtl,-bexpfull,-bbigtoc"
                        PICFLAG="-O2"
                        # as AIX code is always position independent...
@@ -2638,29 +2603,6 @@ SMB_CHECK_SYSCONF(_SC_NPROCESSORS_ONLN)
 SMB_CHECK_SYSCONF(_SC_PAGESIZE)
 AC_CHECK_FUNCS(getpagesize)
 
-dnl test for ipv6
-AC_CACHE_CHECK([for ipv6 support],samba_cv_HAVE_IPV6,[
-AC_TRY_COMPILE([
-#include <stdlib.h> /* for NULL */
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netdb.h>],
-[
-struct sockaddr_storage sa_store;
-struct addrinfo *ai = NULL;
-struct in6_addr in6addr;
-int s = socket(AF_INET6, SOCK_STREAM, 0);
-int ret = getaddrinfo(NULL, NULL, NULL, &ai);
-if (ret != 0) {
-       const char *es = gai_strerror(ret);
-}
-freeaddrinfo(ai);
-],
-samba_cv_HAVE_IPV6=yes,samba_cv_HAVE_IPV6=no)])
-if test x"$samba_cv_HAVE_IPV6" = x"yes"; then
-    AC_DEFINE(HAVE_IPV6,1,[Whether the system has IPv6 support])
-fi
-
 ################################################
 # look for a method of setting the effective uid
 seteuid=no;
@@ -2836,9 +2778,17 @@ AC_CACHE_CHECK([if the realpath function allows a NULL argument],samba_cv_REALPA
 AC_TRY_RUN([
 #include <stdio.h>
 #include <limits.h>
+#include <signal.h>
+
+void exit_on_core(int ignored) {
+       exit(1);
+}
+
 main() {
-       char *newpath = realpath("/tmp", NULL);
-       exit ((newpath != NULL) ? 0 : 1);
+       char *newpath;
+       signal(SIGSEGV, exit_on_core);
+       newpath = realpath("/tmp", NULL);
+       exit((newpath != NULL) ? 0 : 1);
 }
 ],
 samba_cv_REALPATH_TAKES_NULL=yes,samba_cv_REALPATH_TAKES_NULL=no,samba_cv_REALPATH_TAKES_NULL=cross)])
@@ -3408,11 +3358,13 @@ if test x"$with_ads_support" != x"no"; then
   AC_CHECK_FUNC_EXT(krb5_get_init_creds_opt_free, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_get_init_creds_opt_get_error, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_enctype_to_string, $KRB5_LIBS)
+  AC_CHECK_FUNC_EXT(krb5_fwd_tgt_creds, $KRB5_LIBS)
+  AC_CHECK_FUNC_EXT(krb5_auth_con_set_req_cksumtype, $KRB5_LIBS)
 
   LIBS="$KRB5_LIBS $LIBS"
 
   AC_CACHE_CHECK(whether krb5_ticket contains kvno and enctype,
-       smb_krb5_ticket_has_keyinfo,
+       smb_krb5_cv_ticket_has_keyinfo,
        [
            AC_TRY_COMPILE(
            [
@@ -3426,17 +3378,17 @@ if test x"$with_ads_support" != x"no"; then
                enctype = ticket.enc_part.enctype;
                kvno = ticket.enc_part.kvno;
            ],
-           [ smb_krb5_ticket_has_keyinfo=yes ],
-           [ smb_krb5_ticket_has_keyinfo=no ])
+           [ smb_krb5_cv_ticket_has_keyinfo=yes ],
+           [ smb_krb5_cv_ticket_has_keyinfo=no ])
        ])
 
-  if test x"$smb_krb5_ticket_has_keyinfo" = x"yes" ; then
+  if test x"$smb_krb5_cv_ticket_has_keyinfo" = x"yes" ; then
        AC_DEFINE(KRB5_TICKET_HAS_KEYINFO, 1,
            [Whether the krb5_ticket structure contains the kvno and enctype])
   fi
 
   AC_CACHE_CHECK(whether krb5_get_init_creds_opt_free takes a context argument,
-         smb_krb5_creds_opt_free_context,
+         smb_krb5_cv_creds_opt_free_context,
          [
                AC_TRY_COMPILE([
                    #include <krb5.h>],
@@ -3445,25 +3397,25 @@ if test x"$with_ads_support" != x"no"; then
                        krb5_get_init_creds_opt *opt = NULL;
                        krb5_get_init_creds_opt_free(ctx, opt);
                    ],
-                   [smb_krb5_creds_opt_free_context=yes],
-                   [smb_krb5_creds_opt_free_context=no]
+                   [smb_krb5_cv_creds_opt_free_context=yes],
+                   [smb_krb5_cv_creds_opt_free_context=no]
                )
          ])
 
-  if test x"$smb_krb5_creds_opt_free_context" = x"yes" ; then
+  if test x"$smb_krb5_cv_creds_opt_free_context" = x"yes" ; then
        AC_DEFINE(KRB5_CREDS_OPT_FREE_REQUIRES_CONTEXT, 1,
            [Whether krb5_get_init_creds_opt_free takes a context argument])
   fi
 
-  AC_CACHE_CHECK(whether krb5_verify_checksum takes 7 arguments, smb_krb5_verify_checksum, [
+  AC_CACHE_CHECK(whether krb5_verify_checksum takes 7 arguments, smb_krb5_cv_verify_checksum, [
     AC_TRY_COMPILE([
        #include <krb5.h>],
        [krb5_verify_checksum(0, 0, 0, 0, 0, 0, 0);],
-       [smb_krb5_verify_checksum=7],
-       [smb_krb5_verify_checksum=6],
+       [smb_krb5_cv_verify_checksum=7],
+       [smb_krb5_cv_verify_checksum=6],
     )
   ])
-  AC_DEFINE_UNQUOTED(KRB5_VERIFY_CHECKSUM_ARGS, $smb_krb5_verify_checksum, [Number of arguments to krb5_verify_checksum])
+  AC_DEFINE_UNQUOTED(KRB5_VERIFY_CHECKSUM_ARGS, $smb_krb5_cv_verify_checksum, [Number of arguments to krb5_verify_checksum])
 
   AC_CACHE_CHECK([for checksum in krb5_checksum],
                 samba_cv_HAVE_CHECKSUM_IN_KRB5_CHECKSUM,[
@@ -3786,8 +3738,9 @@ if test x"$with_ads_support" != x"no"; then
 
   if test x"$ac_cv_func_ext_krb5_enctype_to_string" = x"yes"; then
     AC_CACHE_CHECK([for krb5_error_code krb5_enctype_to_string(krb5_context context, krb5_enctype enctype, char **str)],
-        smb_krb5_enctype_to_string_takes_krb5_context_arg,[
+        smb_krb5_cv_enctype_to_string_takes_krb5_context_arg,[
        AC_TRY_RUN_STRICT([
+               #include <stdlib.h>
                #include <krb5.h>
                int main(void) {
                        krb5_context context = NULL;
@@ -3797,16 +3750,16 @@ if test x"$with_ads_support" != x"no"; then
                        return 0;
                }
                ],[$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
-               smb_krb5_enctype_to_string_takes_krb5_context_arg=yes,
-               smb_krb5_enctype_to_string_takes_krb5_context_arg=no)])
+               smb_krb5_cv_enctype_to_string_takes_krb5_context_arg=yes,
+               smb_krb5_cv_enctype_to_string_takes_krb5_context_arg=no)])
 
-    if test x"$smb_krb5_enctype_to_string_takes_krb5_context_arg" = x"yes"; then
+    if test x"$smb_krb5_cv_enctype_to_string_takes_krb5_context_arg" = x"yes"; then
       AC_DEFINE(HAVE_KRB5_ENCTYPE_TO_STRING_WITH_KRB5_CONTEXT_ARG,1,
                 [whether krb5_enctype_to_string takes krb5_context argument])
     fi
 
     AC_CACHE_CHECK([for krb5_error_code krb5_enctype_to_string(krb5_enctype enctype, char *str, size_t len)],
-        smb_krb5_enctype_to_string_takes_size_t_arg,[
+        smb_krb5_cv_enctype_to_string_takes_size_t_arg,[
        AC_TRY_RUN_STRICT([
                #include <krb5.h>
                int main(void) {
@@ -3815,10 +3768,10 @@ if test x"$with_ads_support" != x"no"; then
                        return 0;
                }
                ],[$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
-               smb_krb5_enctype_to_string_takes_size_t_arg=yes,
-               smb_krb5_enctype_to_string_takes_size_t_arg=no)])
+               smb_krb5_cv_enctype_to_string_takes_size_t_arg=yes,
+               smb_krb5_cv_enctype_to_string_takes_size_t_arg=no)])
 
-    if test x"$smb_krb5_enctype_to_string_takes_size_t_arg" = x"yes"; then
+    if test x"$smb_krb5_cv_enctype_to_string_takes_size_t_arg" = x"yes"; then
       AC_DEFINE(HAVE_KRB5_ENCTYPE_TO_STRING_WITH_SIZE_T_ARG,1,
                 [whether krb5_enctype_to_string takes size_t argument])
     fi
@@ -3888,7 +3841,7 @@ if test x"$with_ads_support" != x"no"; then
     use_ads=no
   fi
 
-  if test x"$smb_krb5_ticket_has_keyinfo" != x"yes" ; then
+  if test x"$smb_krb5_cv_ticket_has_keyinfo" != x"yes" ; then
 
       # We only need the following functions if we can't get the enctype
       # and kvno out of the ticket directly (ie. on Heimdal).
@@ -4709,9 +4662,13 @@ AC_ARG_WITH([static-libs],
 #
 LINK_LIBNETAPI=STATIC
 
+LINK_LIBSMBCLIENT=STATIC
+
 SMB_LIBRARY(talloc)
 SMB_LIBRARY(tdb)
 SMB_LIBRARY(netapi)
+SMB_LIBRARY(smbclient)
+SMB_LIBRARY(smbsharemodes)
 
 
 #################################################
@@ -4746,94 +4703,6 @@ AC_ARG_WITH(libaddns,
 [AC_MSG_RESULT(no)]
 )
 
-#################################################
-# should we build libsmbclient?
-
-INSTALL_LIBSMBCLIENT=
-UNINSTALL_LIBSMBCLIENT=
-LIBSMBCLIENT_SHARED=
-LIBSMBCLIENT=
-AC_MSG_CHECKING(whether to build the libsmbclient shared library)
-AC_ARG_WITH(libsmbclient,
-[AS_HELP_STRING([--with-libsmbclient], [Build the libsmbclient shared library (default=yes if shared libs supported)])],
-[ case "$withval" in
-  no)
-     AC_MSG_RESULT(no)
-     ;;
-  *)
-     if test $BLDSHARED = true; then
-        LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
-        LIBSMBCLIENT=libsmbclient
-        AC_MSG_RESULT(yes)
-     else
-       enable_static=yes
-        AC_MSG_RESULT(no shared library support -- will supply static library)
-     fi
-     if test $enable_static = yes; then
-        LIBSMBCLIENT=libsmbclient
-     fi
-     INSTALL_LIBSMBCLIENT=installclientlib
-     UNINSTALL_LIBSMBCLIENT=uninstallclientlib
-     ;;
-  esac ],
-[
-# if unspecified, default is to build it if possible.
-  if test $BLDSHARED = true; then
-     LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
-     LIBSMBCLIENT=libsmbclient
-     AC_MSG_RESULT(yes)
-   else
-     enable_static=yes
-     AC_MSG_RESULT(no shared library support -- will supply static library)
-   fi
-   if test $enable_static = yes; then
-     LIBSMBCLIENT=libsmbclient
-  fi]
-  INSTALL_LIBSMBCLIENT=installclientlib
-  UNINSTALL_LIBSMBCLIENT=uninstallclientlib
-)
-
-INSTALL_LIBSMBSHAREMODES=
-LIBSMBSHAREMODES_SHARED=
-LIBSMBSHAREMODES=
-AC_MSG_CHECKING(whether to build the libsmbsharemodes shared library)
-AC_ARG_WITH(libsmbsharemodes,
-[AS_HELP_STRING([--with-libsmbsharemodes], [Build the libsmbsharemodes shared library (default=yes if shared libs supported)])],
-[ case "$withval" in
-  no)
-     AC_MSG_RESULT(no)
-     ;;
-  *)
-     if test $BLDSHARED = true; then
-        LIBSMBSHAREMODES_SHARED=bin/libsmbsharemodes.$SHLIBEXT
-        LIBSMBSHAREMODES=libsmbsharemodes
-        AC_MSG_RESULT(yes)
-     else
-        enable_static=yes
-        AC_MSG_RESULT(no shared library support -- will supply static library)
-     fi
-     if test $enable_static = yes; then
-        LIBSMBSHAREMODES=libsmbsharemodes
-     fi
-     INSTALL_LIBSMBSHAREMODES=installlibsmbsharemodes
-     UNINSTALL_LIBSMBSHAREMODES=uninstalllibsmbsharemodes
-     ;;
-  esac ],
-[
-# if unspecified, default is to build it if possible.
-  if test $BLDSHARED = true; then
-     LIBSMBSHAREMODES_SHARED=bin/libsmbsharemodes.$SHLIBEXT
-     LIBSMBSHAREMODES=libsmbsharemodes
-     AC_MSG_RESULT(yes)
-   else
-     enable_static=yes
-     AC_MSG_RESULT(no shared library support -- will supply static library)
-   fi
-   if test $enable_static = yes; then
-     LIBSMBSHAREMODES=libsmbsharemodes
-  fi]
-  INSTALL_LIBSMBSHAREMODES=installlibsmbsharemodes
-)
 
 
 #################################################
@@ -5625,6 +5494,26 @@ if test x"$samba_cv_HAVE_POSIX_FADVISE" = x"yes"; then
              [Whether posix_fadvise is available])
 fi
 
+############################################
+# See if we have the Linux splice syscall.
+
+AC_CACHE_CHECK([for Linux splice],
+                samba_cv_HAVE_LINUX_SPLICE,[
+    AC_TRY_LINK([
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#include <fcntl.h>],
+    [long ret = splice(0,0,1,0,400,0);],
+    samba_cv_HAVE_LINUX_SPLICE=yes,
+    samba_cv_HAVE_LINUX_SPLICE=no)])
+
+if test x"$samba_cv_HAVE_LINUX_SPLICE" = x"yes"; then
+  AC_DEFINE(HAVE_LINUX_SPLICE,1,
+             [Whether Linux splice is available])
+fi
+
+AC_HAVE_DECL(splice, [#include <fcntl.h>])
 
 
 #################################################
@@ -5689,8 +5578,8 @@ case "$host_os" in
                NSSSONAMEVERSIONSUFFIX=".1"
                WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o \
                    nsswitch/winbind_nss_linux.o"
-               WINBIND_NSS_EXTRA_LIBS="-lsocket"
-               PAM_WINBIND_EXTRA_LIBS="-lsocket"
+               WINBIND_NSS_EXTRA_LIBS="${LIBREPLACE_NETWORK_LIBS}"
+               PAM_WINBIND_EXTRA_LIBS="${LIBREPLACE_NETWORK_LIBS}"
                ;;
        *hpux11*)
                WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o"
@@ -5728,7 +5617,7 @@ AC_ARG_WITH(winbind,
 # We need unix domain sockets for winbind
 
 if test x"$HAVE_WINBIND" = x"yes"; then
-       if test x"$samba_cv_unixsocket" = x"no"; then
+       if test x"$libreplace_cv_HAVE_UNIXSOCKET" = x"no"; then
                winbind_no_reason=", no unix domain socket support on $host_os"
                HAVE_WINBIND=no
        fi
@@ -5747,17 +5636,19 @@ else
        BUILD_LIBWBCLIENT_SHARED=yes
 fi
 
+LIBWBCLIENT_SHARED_TARGET=bin/libwbclient.$SHLIBEXT
+LIBWBCLIENT_STATIC_TARGET=bin/libwbclient.a
 if test $BLDSHARED = true -a x"$HAVE_WINBIND" = x"yes" -a x"$BUILD_LIBWBCLIENT_SHARED" = x"yes"; then
        NSS_MODULES="${WINBIND_NSS} ${WINBIND_WINS_NSS}"
        ## Only worry about libwbclient if we have shared library support
        ## and winbindd
-        LIBWBCLIENT_SHARED=bin/libwbclient.$SHLIBEXT
+        LIBWBCLIENT_SHARED=$LIBWBCLIENT_SHARED_TARGET
         LIBWBCLIENT=libwbclient
        INSTALL_LIBWBCLIENT=installlibwbclient
        UNINSTALL_LIBWBCLIENT=uninstalllibwbclient
        WINBIND_LIBS="-lwbclient"
 else
-       LIBWBCLIENT_STATIC=bin/libwbclient.a
+       LIBWBCLIENT_STATIC=$LIBWBCLIENT_STATIC_TARGET
 fi
 
 if test x"$HAVE_WINBIND" = x"yes"; then