Fix authservice count.
[jelmer/samba4-debian.git] / source / configure.ac
index bb32698..66fb696 100644 (file)
@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
 dnl disabled 2.53 requirement - we do work with 2.52 on suse 7.3 for example
 dnl AC_PREREQ(2.53)
 
-AC_INIT([samba],[],[samba-technical@samba.org])
+AC_INIT([samba],[4],[samba-technical@samba.org])
 
 AC_CONFIG_SRCDIR([include/includes.h])
 AC_CONFIG_HEADER(include/config_tmp.h)
@@ -26,8 +26,18 @@ m4_include(lib/popt/samba.m4)
 m4_include(lib/charset/config.m4)
 m4_include(lib/socket/config.m4)
 m4_include(nsswitch/nsstest.m4)
-
-SMB_EXT_LIB_FROM_PKGCONFIG(LIBTALLOC, talloc >= 1.0,
+m4_include(pidl/config.m4)
+
+AC_CONFIG_FILES(lib/registry/registry.pc)
+AC_CONFIG_FILES(librpc/dcerpc.pc)
+AC_CONFIG_FILES(librpc/ndr.pc)
+AC_CONFIG_FILES(torture/torture.pc)
+AC_CONFIG_FILES(auth/gensec/gensec.pc)
+AC_CONFIG_FILES(param/samba-hostconfig.pc)
+AC_CONFIG_FILES(librpc/dcerpc_samr.pc)
+AC_CONFIG_FILES(librpc/dcerpc_atsvc.pc)
+
+SMB_EXT_LIB_FROM_PKGCONFIG(LIBTALLOC, talloc >= 1.2.0,
        [],
        [
                m4_include(lib/talloc/libtalloc.m4)
@@ -43,25 +53,59 @@ SMB_EXT_LIB_FROM_PKGCONFIG(LIBTDB, tdb >= 1.1.0,
        ]
 )
 
-m4_include(lib/ldb/sqlite3.m4)
-m4_include(lib/ldb/libldb.m4)
+SMB_INCLUDE_MK(lib/tdb/python.mk) 
+
+SMB_EXT_LIB_FROM_PKGCONFIG(LIBLDB, ldb >= 0.9.1,
+       [
+               SMB_INCLUDE_MK(lib/ldb/ldb_ildap/config.mk)
+               SMB_INCLUDE_MK(lib/ldb/tools/config.mk)
+               SMB_SUBSYSTEM(ldb_map, [], [LIBLDB])
+               define_ldb_modulesdir=no
+       ],
+       [
+               # Here we need to do some tricks
+               # with AC_CONFIG_COMMANDS_PRE
+               # as that's the deferrs the commands
+               # to location after $prefix and $exec_prefix
+               # have usefull values and directly before
+               # creating config.status.
+               #
+               # The 'eval eval echo' trick is used to
+               # actually get the raw absolute directory
+               # path as this is needed in config.h
+               define_ldb_modulesdir=yes
+               AC_CONFIG_COMMANDS_PRE([
+               if test x"$define_ldb_modulesdir" = x"yes";then
+                       LDB_MODULESDIR=`eval eval echo ${modulesdir}/ldb`
+                       AC_DEFINE_UNQUOTED(LDB_MODULESDIR, "${LDB_MODULESDIR}" , [ldb Modules directory])
+               fi
+               ])
+               ldbdir=lib/ldb
+               AC_SUBST(ldbdir)
+               m4_include(lib/ldb/sqlite3.m4)
+               m4_include(lib/ldb/libldb.m4)
+               SMB_INCLUDE_MK(lib/ldb/config.mk)
+               AC_CONFIG_FILES(lib/ldb/ldb.pc)
+       ]
+)
+SMB_INCLUDE_MK(lib/ldb/python.mk) 
+
 m4_include(lib/tls/config.m4)
 m4_include(lib/events/config.m4)
 
 dnl m4_include(auth/kerberos/config.m4)
-
+m4_include(scripting/python/config.m4)
 m4_include(auth/gensec/config.m4)
 m4_include(smbd/process_model.m4)
-m4_include(scripting/swig/config.m4)
 m4_include(ntvfs/posix/config.m4)
 m4_include(ntvfs/unixuid/config.m4)
 m4_include(lib/socket_wrapper/config.m4)
+m4_include(lib/nss_wrapper/config.m4)
 m4_include(auth/config.m4)
 m4_include(kdc/config.m4)
 m4_include(ntvfs/sysdep/config.m4)
 m4_include(lib/appweb/config.m4)
 m4_include(nsswitch/config.m4)
-m4_include(libcli/config.m4)
 
 #################################################
 # add *_CFLAGS only for the real build
@@ -98,6 +142,25 @@ for d in build/smb_build bin include ; do
     test -d ${builddir}/$d || AS_MKDIR_P(${builddir}/$d)
 done
 
+AC_SUBST(INTERN_LDFLAGS)
+AC_SUBST(INSTALL_LINK_FLAGS)
+if test $USESHARED = "true";
+then
+       INTERN_LDFLAGS="-L\${builddir}/bin/shared -L\${builddir}/bin/static"
+       INSTALL_LINK_FLAGS="-Wl,-rpath-link,\${builddir}/bin/shared";
+else
+       INTERN_LDFLAGS="-L\${builddir}/bin/static -L\${builddir}/bin/shared"
+fi
+
+builddir_headers=""
+       
+if test "x$ac_abs_srcdir" != "x$ac_abs_builddir"
+then
+       builddir_headers="-I\$(builddir)/include -I\$(builddir) -I\$(builddir)/lib ";
+fi
+
+CPPFLAGS="$builddir_headers-I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -I\$(srcdir)/lib/replace -I\$(srcdir)/lib/talloc -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H $CPPFLAGS"
+
 echo "configure: creating build/smb_build/config.pm"
 cat >build/smb_build/config.pm<<CEOF
 # config.pm - Autogenerate by configure. DO NOT EDIT!
@@ -159,3 +222,20 @@ CMP_RET=$?
 if test $CMP_RET != 0; then
        cp include/config_tmp.h include/config.h
 fi
+
+echo "configure: creating mkconfig.mk"
+cat >mkconfig.mk<<CEOF
+# mkconfig.mk - Autogenerated by configure, DO NOT EDIT!
+AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_VARS]), [
+AC_Var = $AC_Var])
+$MAKE_SETTINGS
+CEOF
+
+if test $USESHARED = true
+then
+       echo "To run binaries without installing, set the following environment variable:"
+       echo "$ac_cv_LIB_PATH_VAR=$builddir/bin/shared"
+fi
+
+echo
+echo "To build Samba, run $ac_cv_path_MAKE"