Use variable for ndr_netlogon.o path.
[kai/samba-autobuild/.git] / source4 / configure.ac
index 59a21375f65d0376f08d9c595e974a29adbc89b7..73d3ffd4d9b6c60bde0b4a91710b70a810e1f150 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,15 +26,22 @@ m4_include(lib/popt/samba.m4)
 m4_include(lib/charset/config.m4)
 m4_include(lib/socket/config.m4)
 m4_include(nsswitch/nsstest.m4)
-
-AC_OUTPUT(lib/registry/registry.pc)
-
-SMB_EXT_LIB_FROM_PKGCONFIG(LIBTALLOC, talloc >= 1.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(lib/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)
                SMB_INCLUDE_MK(lib/talloc/config.mk)
-               AC_OUTPUT(lib/talloc/talloc.pc)
        ]
 )
 
@@ -43,7 +50,6 @@ SMB_EXT_LIB_FROM_PKGCONFIG(LIBTDB, tdb >= 1.1.0,
        [
                m4_include(lib/tdb/libtdb.m4)
                SMB_INCLUDE_MK(lib/tdb/config.mk)
-               AC_OUTPUT(lib/tdb/tdb.pc)
        ]
 )
 
@@ -53,8 +59,6 @@ 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])
-               AC_OUTPUT(lib/ldb/ldb.pc)
                define_ldb_modulesdir=no
        ],
        [
@@ -75,9 +79,12 @@ SMB_EXT_LIB_FROM_PKGCONFIG(LIBLDB, ldb >= 0.9.1,
                        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) 
@@ -134,25 +141,26 @@ for d in build/smb_build bin include ; do
     test -d ${builddir}/$d || AS_MKDIR_P(${builddir}/$d)
 done
 
-echo "configure: creating build/smb_build/config.pm"
-cat >build/smb_build/config.pm<<CEOF
-# config.pm - Autogenerate by configure. DO NOT EDIT!
-
-package config;
-require Exporter;
-@ISA = qw(Exporter);
-@EXPORT_OK = qw(%enabled %config);
-use strict;
+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
 
-use vars qw(%enabled %config);
+builddir_headers=""
+       
+if test "x$ac_abs_srcdir" != "x$ac_abs_builddir"
+then
+       builddir_headers="-I\$(builddir)/include -I\$(builddir) -I\$(builddir)/lib ";
+fi
 
-%config = (AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_VARS]), [
-       AC_Var => '$AC_Var',])
-);
+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"
 
-$SMB_INFO_ENABLES
-1;
-CEOF
+SMB_WRITE_PERLVARS(build/smb_build/config.pm)
 
 echo "configure: creating config.mk"
 cat >config.mk<<CEOF
@@ -162,32 +170,7 @@ $SMB_INFO_SUBSYSTEMS
 $SMB_INFO_LIBRARIES
 CEOF
 
-AC_OUTPUT_COMMANDS(
-[
-test "x$ac_abs_srcdir" != "x$ac_abs_builddir" && (
-       cd $builddir;
-       # NOTE: We *must* use -R so we don't follow symlinks (at least on BSD
-       # systems).
-       test -d heimdal || cp -R $srcdir/heimdal $builddir/
-       test -d heimdal_build || cp -R $srcdir/heimdal_build $builddir/
-       test -d build || builddir="$builddir" \
-                       srcdir="$srcdir" \
-                       $PERL ${srcdir}/script/buildtree.pl
- )
-
-$PERL -I${builddir} -I${builddir}/build \
-    -I${srcdir} -I${srcdir}/build \
-    ${srcdir}/build/smb_build/main.pl || exit $?
-],
-[
-srcdir="$srcdir"
-builddir="$builddir"
-PERL="$PERL"
-
-export PERL
-export srcdir
-export builddir
-])
+SMB_BUILD_RUN(data.mk)
 AC_OUTPUT
 
 cmp include/config_tmp.h include/config.h >/dev/null 2>&1
@@ -195,3 +178,14 @@ CMP_RET=$?
 if test $CMP_RET != 0; then
        cp include/config_tmp.h include/config.h
 fi
+
+SMB_WRITE_MAKEVARS(mkconfig.mk)
+
+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"