2003-08-13 05:53:07 +04:00
dnl -*- mode: m4-mode -*-
dnl Process this file with autoconf to produce a configure script.
2008-06-09 12:42:07 +04:00
AC_PREREQ(2.54)
2003-08-13 20:53:37 +04:00
2008-03-07 16:59:19 +03:00
AC_INIT([samba],[4],[samba-technical@samba.org])
2005-07-28 15:51:37 +04:00
2005-07-12 12:21:09 +04:00
AC_CONFIG_SRCDIR([include/includes.h])
2006-04-06 16:30:06 +04:00
AC_CONFIG_HEADER(include/config_tmp.h)
2009-06-18 05:09:36 +04:00
AC_DEFINE(CONFIG_H_IS_FROM_SAMBA,1,[Marker for samba's config.h.])
2003-08-13 05:53:07 +04:00
2005-08-23 04:16:13 +04:00
# Configuration rules.
2006-09-09 06:06:01 +04:00
m4_include(build/m4/env.m4)
2008-09-17 16:11:12 +04:00
m4_include(../lib/replace/samba.m4)
2006-09-05 17:26:51 +04:00
m4_include(lib/smbreadline/readline.m4)
2008-08-01 20:15:11 +04:00
m4_include(heimdal_build/config.m4)
2008-10-11 23:05:38 +04:00
m4_include(../lib/util/fault.m4)
m4_include(../lib/util/signal.m4)
m4_include(../lib/util/util.m4)
m4_include(../lib/util/fsusage.m4)
m4_include(../lib/util/xattr.m4)
m4_include(../lib/util/capability.m4)
m4_include(../lib/util/time.m4)
2008-09-17 16:11:12 +04:00
m4_include(../lib/popt/samba.m4)
2008-10-24 02:06:35 +04:00
m4_include(../lib/util/charset/config.m4)
2006-09-05 17:26:51 +04:00
m4_include(lib/socket/config.m4)
2008-10-17 13:52:55 +04:00
m4_include(../lib/zlib/zlib.m4)
AC_ZLIB([
SMB_EXT_LIB(ZLIB, [${ZLIB_LIBS}])
],[
SMB_INCLUDE_MK(lib/zlib.mk)
])
2008-12-16 12:06:04 +03:00
m4_include(../nsswitch/nsstest.m4)
2008-09-17 20:57:40 +04:00
m4_include(../pidl/config.m4)
2009-06-03 01:07:59 +04:00
m4_include(client/config.m4)
2007-05-07 01:19:22 +04:00
2008-01-25 10:42:30 +03:00
AC_CONFIG_FILES(lib/registry/registry.pc)
AC_CONFIG_FILES(librpc/dcerpc.pc)
2008-10-14 18:23:46 +04:00
AC_CONFIG_FILES(../librpc/ndr.pc)
2008-11-16 02:58:08 +03:00
AC_CONFIG_FILES(../lib/torture/torture.pc)
2008-01-25 10:42:30 +03:00
AC_CONFIG_FILES(auth/gensec/gensec.pc)
2008-04-01 17:08:30 +04:00
AC_CONFIG_FILES(param/samba-hostconfig.pc)
2008-01-25 10:42:30 +03:00
AC_CONFIG_FILES(librpc/dcerpc_samr.pc)
2008-04-03 03:36:03 +04:00
AC_CONFIG_FILES(librpc/dcerpc_atsvc.pc)
2008-01-22 20:28:51 +03:00
2009-03-15 18:35:13 +03:00
m4_include(min_versions.m4)
2009-03-26 18:28:45 +03:00
SMB_INCLUDED_LIB_PKGCONFIG(LIBTALLOC, talloc >= TALLOC_MIN_VERSION, [],
2007-09-07 18:25:03 +04:00
[
2008-09-17 16:11:12 +04:00
m4_include(../lib/talloc/libtalloc.m4)
SMB_INCLUDE_MK(../lib/talloc/config.mk)
2007-09-07 18:25:03 +04:00
]
)
2007-05-07 01:19:22 +04:00
2009-03-26 18:28:45 +03:00
SMB_INCLUDED_LIB_PKGCONFIG(LIBTDB, tdb >= TDB_MIN_VERSION,
2009-06-18 02:53:05 +04:00
[
AC_MSG_CHECKING([for Python TDB bindings])
if $PYTHON -c "from tdb import open" 2>/dev/null; then
AC_MSG_RESULT(yes)
else
SMB_INCLUDE_MK(../lib/tdb/python.mk)
AC_MSG_RESULT(no)
fi
],
2007-09-07 18:25:03 +04:00
[
2008-09-17 16:11:12 +04:00
m4_include(../lib/tdb/libtdb.m4)
SMB_INCLUDE_MK(../lib/tdb/config.mk)
2009-06-18 02:53:05 +04:00
SMB_INCLUDE_MK(../lib/tdb/python.mk)
2007-09-07 18:25:03 +04:00
]
)
2007-05-07 01:19:22 +04:00
2009-03-15 18:35:13 +03:00
SMB_INCLUDED_LIB_PKGCONFIG(LIBTEVENT, tevent = TEVENT_REQUIRED_VERSION,
2009-01-04 19:58:56 +03:00
[],[m4_include(../lib/tevent/samba.m4)]
2008-12-23 21:59:57 +03:00
)
2009-03-26 18:28:45 +03:00
SMB_INCLUDED_LIB_PKGCONFIG(LIBLDB, ldb = LDB_REQUIRED_VERSION,
2007-09-11 21:27:25 +04:00
[
SMB_INCLUDE_MK(lib/ldb/ldb_ildap/config.mk)
SMB_INCLUDE_MK(lib/ldb/tools/config.mk)
2007-09-29 11:57:13 +04:00
define_ldb_modulesdir=no
2009-06-18 06:20:46 +04:00
AC_MSG_CHECKING([for Python LDB bindings])
if $PYTHON -c "import ldb" 2>/dev/null; then
AC_MSG_RESULT(yes)
else
SMB_INCLUDE_MK(lib/ldb/python.mk)
AC_MSG_RESULT(no)
fi
2007-09-11 21:27:25 +04:00
],
[
2007-09-29 11:57:13 +04:00
# 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
])
2008-02-26 17:11:47 +03:00
ldbdir=lib/ldb
AC_SUBST(ldbdir)
2007-09-13 14:53:35 +04:00
m4_include(lib/ldb/sqlite3.m4)
2007-09-11 21:27:25 +04:00
m4_include(lib/ldb/libldb.m4)
SMB_INCLUDE_MK(lib/ldb/config.mk)
2008-01-25 10:42:30 +03:00
AC_CONFIG_FILES(lib/ldb/ldb.pc)
2009-06-18 06:20:46 +04:00
SMB_INCLUDE_MK(lib/ldb/python.mk)
2009-06-18 05:09:36 +04:00
])
2007-09-11 21:27:25 +04:00
2006-09-05 17:26:51 +04:00
m4_include(lib/tls/config.m4)
2009-05-29 18:36:44 +04:00
m4_include(torture/libnetapi/config.m4)
2005-06-07 11:22:25 +04:00
2006-09-05 17:26:51 +04:00
dnl m4_include(auth/kerberos/config.m4)
m4_include(auth/gensec/config.m4)
m4_include(smbd/process_model.m4)
m4_include(ntvfs/posix/config.m4)
m4_include(ntvfs/unixuid/config.m4)
2008-09-17 16:11:12 +04:00
m4_include(../lib/socket_wrapper/config.m4)
m4_include(../lib/nss_wrapper/config.m4)
2006-09-05 17:26:51 +04:00
m4_include(auth/config.m4)
m4_include(kdc/config.m4)
m4_include(ntvfs/sysdep/config.m4)
2008-12-16 12:06:04 +03:00
m4_include(../nsswitch/config.m4)
2003-11-25 06:15:26 +03:00
2004-08-20 10:52:31 +04:00
#################################################
2006-01-11 03:56:49 +03:00
# add *_CFLAGS only for the real build
2006-03-07 20:15:18 +03:00
CFLAGS="${CFLAGS} ${DEVELOPER_CFLAGS}"
2004-08-20 10:52:31 +04:00
2003-08-13 05:53:07 +04:00
#################################################
# final configure stuff
AC_MSG_CHECKING([configure summary])
2009-01-22 13:35:28 +03:00
AC_TRY_RUN([#include "${srcdir-.}/../tests/summary.c"],
2003-08-13 05:53:07 +04:00
AC_MSG_RESULT(yes),
AC_MSG_ERROR([summary failure. Aborting config]); exit 1;,
AC_MSG_WARN([cannot run when cross-compiling]))
2005-08-04 20:49:17 +04:00
LIBS=`echo $LIBS | sed -e 's/ *//g'`
if test x"$LIBS" != x""; then
echo "LIBS: $LIBS"
AC_MSG_WARN([the global \$LIBS variable contains some libraries!])
AC_MSG_WARN([this should not happen, please report to samba-technical@lists.samba.org!])
AC_MSG_ERROR([only _EXT macros from aclocal.m4 should be used!])
fi
2003-08-13 05:53:07 +04:00
dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
LIB_REMOVE_USR_LIB(LDFLAGS)
LIB_REMOVE_USR_LIB(LIBS)
dnl Remove -I/usr/include/? from CFLAGS and CPPFLAGS
CFLAGS_REMOVE_USR_INCLUDE(CFLAGS)
CFLAGS_REMOVE_USR_INCLUDE(CPPFLAGS)
2005-09-17 17:08:49 +04:00
AC_SUBST(ac_default_prefix)
2007-04-02 21:02:52 +04:00
for d in build/smb_build bin include ; do
test -d ${builddir}/$d || AS_MKDIR_P(${builddir}/$d)
done
2008-02-13 20:59:57 +03:00
AC_SUBST(INTERN_LDFLAGS)
AC_SUBST(INSTALL_LINK_FLAGS)
if test $USESHARED = "true";
then
2008-12-23 03:53:38 +03:00
INTERN_LDFLAGS="-L\$(shliboutputdir) -L\${builddir}/bin/static"
INSTALL_LINK_FLAGS="-Wl,-rpath-link,\$(shliboutputdir)";
2008-02-13 20:59:57 +03:00
else
2008-12-23 03:53:38 +03:00
INTERN_LDFLAGS="-L\${builddir}/bin/static -L\$(shliboutputdir)"
2008-02-13 20:59:57 +03:00
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
2008-10-15 02:14:58 +04:00
CPPFLAGS="$builddir_headers-I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -I\$(srcdir)/../lib/replace -I\$(srcdir)/../lib/talloc -I\$(srcdir)/.. -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H $CPPFLAGS"
2008-02-13 20:59:57 +03:00
2008-05-18 19:48:50 +04:00
SMB_WRITE_PERLVARS(build/smb_build/config.pm)
2005-07-28 15:51:37 +04:00
2008-05-21 17:40:55 +04:00
echo "configure: creating config.mk"
2005-07-28 15:51:37 +04:00
cat >config.mk<<CEOF
# config.mk - Autogenerated by configure, DO NOT EDIT!
$SMB_INFO_EXT_LIBS
$SMB_INFO_SUBSYSTEMS
$SMB_INFO_LIBRARIES
CEOF
2008-05-18 19:55:50 +04:00
SMB_BUILD_RUN(data.mk)
2005-09-17 17:08:49 +04:00
AC_OUTPUT
2006-04-07 14:59:10 +04:00
cmp include/config_tmp.h include/config.h >/dev/null 2>&1
CMP_RET=$?
if test $CMP_RET != 0; then
cp include/config_tmp.h include/config.h
fi
2008-02-11 01:32:31 +03:00
2008-05-18 19:48:50 +04:00
SMB_WRITE_MAKEVARS(mkconfig.mk)
2008-02-25 20:51:39 +03:00
if test $USESHARED = true
then
echo "To run binaries without installing, set the following environment variable:"
2008-06-10 16:52:17 +04:00
echo "$LIB_PATH_VAR=$builddir/bin/shared"
2008-02-25 20:51:39 +03:00
fi
echo
2008-06-10 16:52:17 +04:00
echo "To build Samba, run $MAKE"