r22697: Support building with external talloc.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 6 May 2007 15:31:03 +0000 (15:31 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:52:02 +0000 (14:52 -0500)
source/build/m4/public.m4
source/configure.ac
source/lib/basic.mk

index afb707e81d25714f7b42d38acbb45f1aa859c49f..003605c40128177c635b4f38a5b68a555faa126a 100644 (file)
@@ -6,12 +6,14 @@ dnl Published under the GPL
 dnl
 dnl SMB_SUBSYSTEM(name,obj_files,required_subsystems)
 dnl
-dnl SMB_EXT_LIB_FROM_PKGCONFIG(name,pkg-config name)
+dnl SMB_EXT_LIB_FROM_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)
 dnl
+dnl SMB_INCLUDE_MK(file)
+dnl
 dnl #######################################################
 dnl ### And now the implementation                     ###
 dnl #######################################################
@@ -32,7 +34,7 @@ ENABLE = YES
 "
 ])
 
-dnl SMB_EXT_LIB_FROM_PKGCONFIG(name,pkg-config name)
+dnl SMB_EXT_LIB_FROM_PKGCONFIG(name,pkg-config name,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
 AC_DEFUN([SMB_EXT_LIB_FROM_PKGCONFIG], 
 [
        dnl Figure out the correct variables and call SMB_EXT_LIB()
@@ -46,8 +48,10 @@ AC_DEFUN([SMB_EXT_LIB_FROM_PKGCONFIG],
                echo "*** in your path, or set the PKG_CONFIG environment variable"
                echo "*** to the full path to pkg-config."
                echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
-                       SMB_EXT_LIB($1)
-                       SMB_ENABLE($1, NO)
+               SMB_EXT_LIB($1)
+               SMB_ENABLE($1, NO)
+               $4
+
        else
                if $PKG_CONFIG --atleast-pkgconfig-version 0.9.0; then
                        AC_MSG_CHECKING(for $2)
@@ -55,6 +59,7 @@ AC_DEFUN([SMB_EXT_LIB_FROM_PKGCONFIG],
                        if test "$SMB_$1"x = "NO"x ; then
                                SMB_ENABLE($1, NO)
                                AC_MSG_RESULT(disabled)         
+                               $4
                        elif $PKG_CONFIG --exists '$2' ; then
                                AC_MSG_RESULT(yes)
 
@@ -76,22 +81,33 @@ AC_DEFUN([SMB_EXT_LIB_FROM_PKGCONFIG],
                                        [`$PKG_CONFIG --cflags-only-other '$2'`],
                                        [`$PKG_CONFIG --cflags-only-I '$2'`],
                                        [`$PKG_CONFIG --libs-only-other '$2'` `$PKG_CONFIG --libs-only-L '$2'`])
+                               $3
 
                        else
                                SMB_EXT_LIB($1)
                                SMB_ENABLE($1, NO)
                                AC_MSG_RESULT(no)
                                $PKG_CONFIG --errors-to-stdout --print-errors '$2'
+                               $4
                        fi
                else
                        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
                                echo "*** See http://www.freedesktop.org/software/pkgconfig"
                                SMB_EXT_LIB($1)
                                SMB_ENABLE($1, NO)
+                               $4
                fi
        fi
 ])
 
+dnl SMB_INCLUDE_MK(file)
+AC_DEFUN([SMB_INCLUDE_MK],
+[
+SMB_INFO_EXT_LIBS="$SMB_INFO_EXT_LIBS
+include $1
+"
+])
+
 dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags)
 AC_DEFUN([SMB_EXT_LIB],
 [
index f8450b01d19c44c826d96f17ab494769b73dbd1e..8c7a38d25c037fd10a3e9320cd7f8689b18bcca3 100644 (file)
@@ -25,7 +25,10 @@ m4_include(lib/util/time.m4)
 m4_include(lib/popt/samba.m4)
 m4_include(lib/charset/config.m4)
 m4_include(lib/socket/config.m4)
-m4_include(lib/talloc/libtalloc.m4)
+SMB_EXT_LIB_FROM_PKGCONFIG(LIBTALLOC, talloc >= 1.0, [], [
+       m4_include(lib/talloc/libtalloc.m4)
+       SMB_INCLUDE_MK(lib/talloc/config.mk)
+])
 m4_include(lib/tdb/libtdb.m4)
 m4_include(lib/ldb/sqlite3.m4)
 m4_include(lib/ldb/libldb.m4)
index b5a3a031eb938b29c0329ae73546aab8839f61c3..e41f284392ce2fe8ddc33e277314d35bd7a596d5 100644 (file)
@@ -3,7 +3,6 @@ include samba3/config.mk
 include socket/config.mk
 include charset/config.mk
 include ldb/config.mk
-include talloc/config.mk
 include tdb/config.mk
 include tls/config.mk
 include registry/config.mk