r23191: Use the new provision-backend script to setup Fedora DS for make test.
[Samba.git] / source / configure.ac
blob6871b81dcf763f954cbf7b0e13f42aa0b94a7f2b
1 dnl -*- mode: m4-mode -*-
2 dnl Process this file with autoconf to produce a configure script.
4 dnl disabled 2.53 requirement - we do work with 2.52 on suse 7.3 for example
5 dnl AC_PREREQ(2.53)
7 AC_INIT([samba],[],[samba-technical@samba.org])
9 AC_CONFIG_SRCDIR([include/includes.h])
10 AC_CONFIG_HEADER(include/config_tmp.h)
11 AC_DEFINE(CONFIG_H_IS_FROM_SAMBA,1,[Marker for samba's config.h])
13 # Configuration rules.
14 m4_include(build/m4/env.m4)
15 m4_include(lib/replace/samba.m4)
16 m4_include(lib/smbreadline/readline.m4)
17 m4_include(heimdal_build/config.m4)
18 m4_include(lib/util/fault.m4)
19 m4_include(lib/util/signal.m4)
20 m4_include(lib/util/util.m4)
21 m4_include(lib/util/fsusage.m4)
22 m4_include(lib/util/xattr.m4)
23 m4_include(lib/util/capability.m4)
24 m4_include(lib/util/time.m4)
25 m4_include(lib/popt/samba.m4)
26 m4_include(lib/charset/config.m4)
27 m4_include(lib/socket/config.m4)
29 #SMB_EXT_LIB_FROM_PKGCONFIG(LIBTALLOC, talloc >= 1.0,
30 #                          [samba_cv_internal_talloc=no],
31 #                          [samba_cv_internal_talloc=yes])
32 samba_cv_internal_talloc=yes
33 if test x"$samba_cv_internal_talloc" = x"yes"; then
34         m4_include(lib/talloc/libtalloc.m4)
35         SMB_INCLUDE_MK(lib/talloc/config.mk)
38 #SMB_EXT_LIB_FROM_PKGCONFIG(LIBTDB, tdb >= 1.1.0,
39 #                          [samba_cv_internal_tdb=no],
40 #                          [samba_cv_internal_tdb=yes])
41 samba_cv_internal_tdb=yes
42 if test x"$samba_cv_internal_tdb" = x"yes"; then
43         m4_include(lib/tdb/libtdb.m4)
44         SMB_INCLUDE_MK(lib/tdb/config.mk)
47 m4_include(lib/ldb/sqlite3.m4)
48 m4_include(lib/ldb/libldb.m4)
49 m4_include(lib/tls/config.m4)
50 m4_include(lib/events/config.m4)
52 dnl m4_include(auth/kerberos/config.m4)
54 m4_include(auth/gensec/config.m4)
55 m4_include(smbd/process_model.m4)
56 m4_include(scripting/swig/config.m4)
57 m4_include(ntvfs/posix/config.m4)
58 m4_include(ntvfs/unixuid/config.m4)
59 m4_include(lib/socket_wrapper/config.m4)
60 m4_include(auth/config.m4)
61 m4_include(kdc/config.m4)
62 m4_include(ntvfs/sysdep/config.m4)
63 m4_include(lib/appweb/config.m4)
64 m4_include(nsswitch/config.m4)
65 m4_include(libcli/config.m4)
67 #################################################
68 # add *_CFLAGS only for the real build
69 CFLAGS="${CFLAGS} ${DEVELOPER_CFLAGS}"
71 #################################################
72 # final configure stuff
74 AC_MSG_CHECKING([configure summary])
75 AC_TRY_RUN([#include "${srcdir-.}/build/tests/summary.c"],
76            AC_MSG_RESULT(yes),
77            AC_MSG_ERROR([summary failure. Aborting config]); exit 1;,
78            AC_MSG_WARN([cannot run when cross-compiling]))
80 LIBS=`echo $LIBS | sed -e 's/ *//g'`
81 if test x"$LIBS" != x""; then
82         echo "LIBS: $LIBS"
83         AC_MSG_WARN([the global \$LIBS variable contains some libraries!])
84         AC_MSG_WARN([this should not happen, please report to samba-technical@lists.samba.org!])
85         AC_MSG_ERROR([only _EXT macros from aclocal.m4 should be used!])
88 dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
89 LIB_REMOVE_USR_LIB(LDFLAGS)
90 LIB_REMOVE_USR_LIB(LIBS)
92 dnl Remove -I/usr/include/? from CFLAGS and CPPFLAGS
93 CFLAGS_REMOVE_USR_INCLUDE(CFLAGS)
94 CFLAGS_REMOVE_USR_INCLUDE(CPPFLAGS)
96 AC_SUBST(ac_default_prefix)
98 for d in build/smb_build bin include ; do
99     test -d ${builddir}/$d || AS_MKDIR_P(${builddir}/$d)
100 done
102 echo "configure: creating build/smb_build/config.pm"
103 cat >build/smb_build/config.pm<<CEOF
104 # config.pm - Autogenerate by configure. DO NOT EDIT!
106 package config;
107 require Exporter;
108 @ISA = qw(Exporter);
109 @EXPORT_OK = qw(%enabled %config);
110 use strict;
112 use vars qw(%enabled %config);
114 %config = (AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_VARS]), [
115         AC_Var => '$AC_Var',])
118 $SMB_INFO_ENABLES
120 CEOF
122 echo "configure: creating config.mk"
123 cat >config.mk<<CEOF
124 # config.mk - Autogenerated by configure, DO NOT EDIT!
125 $SMB_INFO_EXT_LIBS
126 $SMB_INFO_SUBSYSTEMS
127 $SMB_INFO_LIBRARIES
128 CEOF
130 AC_OUTPUT_COMMANDS(
132 test "x$ac_abs_srcdir" != "x$ac_abs_builddir" && (
133         cd $builddir;
134         # NOTE: We *must* use -R so we don't follow symlinks (at least on BSD
135         # systems).
136         test -d heimdal || cp -R $srcdir/heimdal $builddir/
137         test -d heimdal_build || cp -R $srcdir/heimdal_build $builddir/
138         test -d build || builddir="$builddir" \
139                         srcdir="$srcdir" \
140                         $PERL ${srcdir}/script/buildtree.pl
143 $PERL -I${builddir} -I${builddir}/build \
144     -I${srcdir} -I${srcdir}/build \
145     ${srcdir}/build/smb_build/main.pl || exit $?
148 srcdir="$srcdir"
149 builddir="$builddir"
150 PERL="$PERL"
152 export PERL
153 export srcdir
154 export builddir
156 AC_OUTPUT
158 cmp include/config_tmp.h include/config.h >/dev/null 2>&1
159 CMP_RET=$?
160 if test $CMP_RET != 0; then
161         cp include/config_tmp.h include/config.h