summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Layton <jlayton@samba.org>2012-04-15 08:11:53 -0400
committerJeff Layton <jlayton@samba.org>2012-04-15 08:11:53 -0400
commitea9407fc4ae72a5d4245cbb25f7429f46d664d23 (patch)
tree635a0dbfb311aa60478ef7720c4733676c32b072
parentfd31a7c0ba7f1282d2d81193d4d100fdc926b99b (diff)
downloadcifs-utils-ea9407fc4ae72a5d4245cbb25f7429f46d664d23.tar.gz
cifs-utils-ea9407fc4ae72a5d4245cbb25f7429f46d664d23.tar.bz2
cifs-utils-ea9407fc4ae72a5d4245cbb25f7429f46d664d23.zip
autoconf: fix tests for wbclient to use pkgconfig
Use the pkgconfig file that's included with wbclient to perform the test for wbclient usability, and to set the correct CFLAGS and LDADD. This is particularly necessary on recent Fedora with samba4 since it puts the wbclient.h file in a different directory than before. Also, remove a redundant test for wbclient.h from configure.ac. Signed-off-by: Jeff Layton <jlayton@samba.org>
-rw-r--r--Makefile.am9
-rw-r--r--aclocal/idmap.m437
-rw-r--r--configure.ac16
3 files changed, 10 insertions, 52 deletions
diff --git a/Makefile.am b/Makefile.am
index 924c99e..17ad8e1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,7 +41,8 @@ endif
if CONFIG_CIFSIDMAP
sbin_PROGRAMS += cifs.idmap
cifs_idmap_SOURCES = cifs.idmap.c
-cifs_idmap_LDADD = -lkeyutils $(WINB_LDADD)
+cifs_idmap_LDADD = -lkeyutils $(WBCLIENT_LIBS)
+cifs_idmap_CFLAGS = $(WBCLIENT_CFLAGS)
man_MANS += cifs.idmap.8
cifs.idmap.8: cifs.idmap.8.in
@@ -56,12 +57,14 @@ endif
if CONFIG_CIFSACL
bin_PROGRAMS += getcifsacl
getcifsacl_SOURCES = getcifsacl.c
-getcifsacl_LDADD = $(WINB_LDADD)
+getcifsacl_LDADD = $(WBCLIENT_LIBS)
+getcifsacl_CFLAGS = $(WBCLIENT_CFLAGS)
man_MANS += getcifsacl.1
bin_PROGRAMS += setcifsacl
setcifsacl_SOURCES = setcifsacl.c
-setcifsacl_LDADD = $(WINB_LDADD)
+setcifsacl_LDADD = $(WBCLIENT_LIBS)
+setcifsacl_CFLAGS = $(WBCLIENT_CFLAGS)
man_MANS += setcifsacl.1
endif
diff --git a/aclocal/idmap.m4 b/aclocal/idmap.m4
index ada73f0..70a0649 100644
--- a/aclocal/idmap.m4
+++ b/aclocal/idmap.m4
@@ -1,33 +1,8 @@
-dnl Headers needed by wbclient.h
-dnl
-AC_DEFUN([AC_WBCH_COMPL],[
-[
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-]
-[#ifdef HAVE_STDBOOL_H
-#include <stdbool.h>
-#endif
-]
-[#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
-]
-[#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-]
-[#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-]])
-
-dnl Check for wbclient.h header and libwbclient.so
+dnl Check for wbclient package
dnl
AC_DEFUN([AC_TEST_WBCHL],[
if test $enable_cifsidmap != "no" -o $enable_cifsacl != "no"; then
- AC_CHECK_HEADERS([wbclient.h], , [
+ PKG_CHECK_MODULES(WBCLIENT, wbclient, , [
if test "$enable_cifsidmap" = "yes"; then
AC_MSG_ERROR([wbclient.h not found, consider installing libwbclient-devel.])
else
@@ -40,7 +15,7 @@ if test $enable_cifsidmap != "no" -o $enable_cifsacl != "no"; then
AC_MSG_WARN([wbclient.h not found, consider installing libwbclient-devel. Disabling cifsacl.])
enable_cifsacl="no"
fi
- ], [ AC_WBCH_COMPL ])
+ ])
fi
if test $enable_cifsacl != "no"; then
@@ -53,10 +28,4 @@ if test $enable_cifsacl != "no"; then
fi
], [ ])
fi
-
-if test $enable_cifsidmap != "no" -o $enable_cifsacl != "no"; then
- AC_CHECK_LIB([wbclient], [wbcStringToSid],
- [ WINB_LDADD='-lwbclient' ] [ AC_DEFINE(HAVE_LIBWBCLIENT, 1, ["Define var have_libwbclient"]) ], [AC_MSG_ERROR([No functioning wbclient library found!])])
- AC_SUBST(WINB_LDADD)
-fi
])
diff --git a/configure.ac b/configure.ac
index 1f561f5..d5d978b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,7 @@ AC_ARG_VAR(ROOTSBINDIR, [Location where files ordinarily under /sbin should be i
AC_PROG_CC
AC_PROG_SED
AC_GNU_SOURCE
+AM_PROG_CC_C_O
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
@@ -139,21 +140,6 @@ if test $enable_cifsupcall != "no" -o $enable_cifsidmap != "no"; then
fi
])
fi
-if test $enable_cifsacl != "no"; then
- AC_CHECK_HEADERS([wbclient.h], , [
- if test "$enable_cifsacl" = "yes"; then
- AC_MSG_ERROR([wbclient.h not found, consider installing libwbclient-devel.])
- else
- AC_MSG_WARN([wbclient.h not found, consider installing libwbclient-devel. Disabling getcifsacl.])
- enable_cifsacl="no"
- fi
- ],
- [AC_INCLUDES_DEFAULT]
- [#ifdef HAVE_STDBOOL_H
- #include <stdbool.h>
- #endif
- ])
-fi
if test $enable_cifsupcall != "no"; then
AC_CHECK_LIB([krb5], [krb5_init_context],
[ KRB5_LDADD='-lkrb5' ],