summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/m4/public.m422
1 files changed, 22 insertions, 0 deletions
diff --git a/source4/build/m4/public.m4 b/source4/build/m4/public.m4
index 1823f1ba97..a707a113cd 100644
--- a/source4/build/m4/public.m4
+++ b/source4/build/m4/public.m4
@@ -6,6 +6,8 @@ dnl Published under the GPL
dnl
dnl SMB_EXT_LIB_FROM_PKGCONFIG(name,pkg-config name,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
dnl
+dnl SMB_INCLUDED_LIB_PKGCONFIG(name,pkg-config name,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
+dnl
dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags)
dnl
dnl SMB_ENABLE(name,default_build)
@@ -125,6 +127,26 @@ AC_DEFUN([SMB_EXT_LIB_FROM_PKGCONFIG],
fi
])
+dnl SMB_INCLUDED_LIB_PKGCONFIG(name,pkg-config name,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
+AC_DEFUN([SMB_INCLUDED_LIB_PKGCONFIG],
+[
+ AC_ARG_ENABLE([external-]translit($1,`A-Z',`a-z'),
+ AS_HELP_STRING([--enable-external-]translit($1,`A-Z',`a-z'), [Use external $1 instead of built-in (default=auto)]), [], [enableval=auto])
+
+ if test $enableval = yes -o $enableval = auto; then
+ SMB_EXT_LIB_FROM_PKGCONFIG([$1], [$2], [$3], [
+ if test $enableval = yes; then
+ AC_MSG_ERROR([Unable to find external $1])
+ fi
+ ])
+ else
+ ifelse([$4], [], [
+ SMB_EXT_LIB($1)
+ SMB_ENABLE($1, NO)
+ ], [$4])
+ fi
+])
+
dnl SMB_INCLUDE_MK(file)
AC_DEFUN([SMB_INCLUDE_MK],
[