2003-08-13 05:53:07 +04:00
dnl -*- mode: m4-mode -*-
dnl Process this file with autoconf to produce a configure script.
2003-08-13 20:53:37 +04:00
dnl disabled 2.53 requirement - we do work with 2.52 on suse 7.3 for example
dnl AC_PREREQ(2.53)
2005-07-12 17:05:50 +04:00
AC_INIT([samba],[],[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)
2006-09-13 13:23:05 +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)
2006-09-13 20:51:45 +04:00
m4_include(lib/replace/samba.m4)
2006-09-05 17:26:51 +04:00
m4_include(lib/smbreadline/readline.m4)
m4_include(heimdal_build/config.m4)
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)
2006-09-06 04:35:29 +04:00
m4_include(lib/popt/samba.m4)
2006-09-05 17:26:51 +04:00
m4_include(lib/charset/config.m4)
m4_include(lib/socket/config.m4)
m4_include(lib/talloc/libtalloc.m4)
2006-09-06 04:35:29 +04:00
m4_include(lib/tdb/libtdb.m4)
2006-09-05 17:26:51 +04:00
m4_include(lib/ldb/sqlite3.m4)
2006-09-06 04:35:29 +04:00
m4_include(lib/ldb/libldb.m4)
2006-09-05 17:26:51 +04:00
m4_include(lib/tls/config.m4)
m4_include(lib/events/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)
2005-06-07 11:22:25 +04:00
2006-09-05 17:26:51 +04:00
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(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)
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])
2004-02-13 18:20:52 +03:00
AC_TRY_RUN([#include "${srcdir-.}/build/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
2006-05-13 02:21:44 +04:00
echo "configure: creating build/smb_build/config.pm"
2006-05-13 15:21:46 +04:00
cat >build/smb_build/config.pm<<CEOF
2005-07-28 15:51:37 +04:00
# config.pm - Autogenerate by configure. DO NOT EDIT!
package config;
2005-07-28 17:37:21 +04:00
require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(%enabled %config);
2005-07-28 15:51:37 +04:00
use strict;
2005-07-28 17:37:21 +04:00
use vars qw(%enabled %config);
2005-07-28 15:51:37 +04:00
2005-07-28 17:37:21 +04:00
%config = (AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_VARS]), [
AC_Var => '$AC_Var',])
);
2005-07-28 15:51:37 +04:00
$SMB_INFO_ENABLES
2005-07-28 17:37:21 +04:00
1;
2005-07-28 15:51:37 +04:00
CEOF
echo "configure: creating config.mk"
cat >config.mk<<CEOF
# config.mk - Autogenerated by configure, DO NOT EDIT!
$SMB_INFO_EXT_LIBS
$SMB_INFO_SUBSYSTEMS
$SMB_INFO_LIBRARIES
CEOF
2005-12-30 22:18:51 +03:00
AC_OUTPUT_COMMANDS(
2007-04-02 21:02:52 +04:00
[
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
2006-04-11 15:37:52 +04:00
)
2007-04-02 21:02:52 +04:00
$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
2005-12-30 22:18:51 +03:00
])
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