2003-08-13 01:53:07 +00:00
dnl -*- mode: m4-mode -*-
dnl Process this file with autoconf to produce a configure script.
2003-08-13 16:53:37 +00: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 13:05:50 +00:00
AC_INIT([samba],[],[samba-technical@samba.org])
2005-07-28 11:51:37 +00:00
2005-07-12 08:21:09 +00:00
AC_CONFIG_SRCDIR([include/includes.h])
2006-04-06 12:30:06 +00:00
AC_CONFIG_HEADER(include/config_tmp.h)
2003-08-13 01:53:07 +00:00
2005-08-23 00:16:13 +00:00
# Configuration rules.
2005-06-05 00:28:32 +00:00
sinclude(build/m4/env.m4)
2005-08-04 16:49:17 +00:00
sinclude(lib/replace/config.m4)
2005-07-13 20:44:46 +00:00
sinclude(lib/replace/win32/config.m4)
2005-07-25 04:03:01 +00:00
sinclude(lib/replace/repdir/config.m4)
2006-04-29 12:39:19 +00:00
sinclude(include/system/config.m4)
sinclude(build/m4/rewrite.m4)
2005-06-07 07:22:25 +00:00
sinclude(heimdal_build/config.m4)
2006-04-08 15:26:59 +00:00
sinclude(lib/util/fsusage.m4)
2006-04-08 16:25:53 +00:00
sinclude(lib/util/capability.m4)
2006-04-08 17:19:32 +00:00
sinclude(lib/util/time.m4)
2005-06-05 00:28:32 +00:00
sinclude(lib/popt/config.m4)
2005-08-04 23:56:18 +00:00
sinclude(lib/charset/config.m4)
2005-06-05 00:28:32 +00:00
sinclude(lib/socket/config.m4)
2005-08-04 16:49:17 +00:00
sinclude(lib/netif/config.m4)
2005-06-05 00:28:32 +00:00
sinclude(lib/talloc/config.m4)
sinclude(lib/tdb/config.m4)
2005-06-05 04:18:57 +00:00
sinclude(lib/ldb/sqlite3.m4)
2005-06-05 00:28:32 +00:00
sinclude(lib/ldb/config.m4)
2005-07-15 07:00:12 +00:00
sinclude(lib/tls/config.m4)
2005-06-05 00:28:32 +00:00
sinclude(lib/events/config.m4)
2005-06-07 07:22:25 +00:00
dnl disabled until we support external heimdal again
dnl sinclude(auth/kerberos/config.m4)
2005-06-05 00:28:32 +00:00
sinclude(auth/gensec/config.m4)
sinclude(smbd/process_model.m4)
sinclude(lib/registry/config.m4)
2006-04-04 14:39:00 +00:00
sinclude(scripting/swig/config.m4)
2005-06-05 00:28:32 +00:00
sinclude(gtk/config.m4)
sinclude(ntvfs/posix/config.m4)
sinclude(lib/socket_wrapper/config.m4)
sinclude(web_server/config.m4)
sinclude(auth/config.m4)
2005-06-05 12:10:40 +00:00
sinclude(kdc/config.m4)
2006-04-03 06:46:55 +00:00
sinclude(ntvfs/sysdep/config.m4)
2006-04-29 12:39:19 +00:00
sinclude(lib/appweb/config.m4)
sinclude(nsswitch/config.m4)
2003-11-25 03:15:26 +00:00
2006-05-01 20:58:49 +00:00
AC_ARG_ENABLE(dso,
[ --enable-dso Enable building internal libraries as DSO's (experimental)],
[ if test x$enable_dso != xyes; then
BLDSHARED=false
fi],
[BLDSHARED=false])
2004-08-20 06:52:31 +00:00
#################################################
2006-01-11 00:56:49 +00:00
# add *_CFLAGS only for the real build
2006-03-07 17:15:18 +00:00
CFLAGS="${CFLAGS} ${DEVELOPER_CFLAGS}"
2004-08-20 06:52:31 +00:00
2003-08-13 01:53:07 +00:00
#################################################
# final configure stuff
AC_MSG_CHECKING([configure summary])
2004-02-13 15:20:52 +00:00
AC_TRY_RUN([#include "${srcdir-.}/build/tests/summary.c"],
2003-08-13 01:53:07 +00: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 16:49:17 +00: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 01:53:07 +00: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 13:08:49 +00:00
AC_SUBST(ac_default_prefix)
2005-08-05 21:22:20 +00:00
echo "configure: creating config.pm"
2005-07-28 11:51:37 +00:00
cat >config.pm<<CEOF
# config.pm - Autogenerate by configure. DO NOT EDIT!
package config;
2005-07-28 13:37:21 +00:00
require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(%enabled %config);
2005-07-28 11:51:37 +00:00
use strict;
2005-07-28 13:37:21 +00:00
use vars qw(%enabled %config);
2005-07-28 11:51:37 +00:00
2005-07-28 13:37:21 +00:00
%config = (AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_VARS]), [
AC_Var => '$AC_Var',])
);
2005-07-28 11:51:37 +00:00
$SMB_INFO_ENABLES
2005-07-28 13:37:21 +00:00
1;
2005-07-28 11:51:37 +00: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 19:18:51 +00:00
AC_OUTPUT_COMMANDS(
2006-04-11 11:37:52 +00:00
[test "x$ac_abs_srcdir" != "x$ac_abs_builddir" &&
(cd $builddir;
test -d heimdal || cp -r $srcdir/heimdal $builddir/
test -d heimdal_build || cp -r $srcdir/heimdal_build $builddir/
test -d build || samba_builddir="$builddir" samba_srcdir="$srcdir" $PERL $srcdir/script/buildtree.pl
test -f $builddir/include/smb.h || cp $srcdir/include/smb.h $builddir/include
)
$PERL -I${builddir} -I${srcdir} -I${srcdir}/build ${srcdir}/build/smb_build/main.pl || exit $?],[
2005-12-30 19:18:51 +00:00
PERL="$PERL";export PERL;export srcdir; export builddir;
])
2005-09-17 13:08:49 +00:00
AC_OUTPUT
2006-04-07 10:59:10 +00: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