Ignore generated build files.
[kai/samba.git] / source3 / samba4.m4
1 BLDSHARED=true
2 AC_SUBST(BLDSHARED)
3 smbtorture4_path=bin/smbtorture4
4 m4_include(build/m4/public.m4)
5
6 m4_include(lib/smbreadline/readline.m4)
7 m4_include(heimdal_build/internal.m4)
8 m4_include(lib/util/fault.m4)
9 m4_include(lib/util/signal.m4)
10 m4_include(lib/util/util.m4)
11 m4_include(lib/util/fsusage.m4)
12 m4_include(lib/util/xattr.m4)
13 m4_include(lib/util/capability.m4)
14 m4_include(lib/util/time.m4)
15 m4_include(lib/popt/samba.m4)
16 m4_include(lib/charset/config.m4)
17 m4_include(lib/socket/config.m4)
18 m4_include(nsswitch/nsstest.m4)
19 m4_include(pidl/config.m4)
20 m4_include(lib/zlib.m4)
21
22 AC_CONFIG_FILES(../source4/lib/registry/registry.pc)
23 AC_CONFIG_FILES(../source4/librpc/dcerpc.pc)
24 AC_CONFIG_FILES(../source4/librpc/ndr.pc)
25 AC_CONFIG_FILES(../source4/lib/torture/torture.pc)
26 AC_CONFIG_FILES(../source4/auth/gensec/gensec.pc)
27 AC_CONFIG_FILES(../source4/param/samba-hostconfig.pc)
28 AC_CONFIG_FILES(../source4/librpc/dcerpc_samr.pc)
29 AC_CONFIG_FILES(../source4/librpc/dcerpc_atsvc.pc)
30
31 SMB_EXT_LIB_FROM_PKGCONFIG(LIBTALLOC, talloc >= 1.2.0,
32         [],
33         [
34                 SMB_INCLUDE_MK(lib/talloc/config.mk)
35         ]
36 )
37
38 SMB_EXT_LIB_FROM_PKGCONFIG(LIBTDB, tdb >= 1.1.0,
39         [],
40         [
41                 m4_include(lib/tdb/libtdb.m4)
42                 SMB_INCLUDE_MK(lib/tdb/config.mk)
43         ]
44 )
45
46 SMB_INCLUDE_MK(lib/tdb/python.mk) 
47
48 SMB_EXT_LIB_FROM_PKGCONFIG(LIBLDB, ldb >= 0.9.1,
49         [
50                 SMB_INCLUDE_MK(lib/ldb/ldb_ildap/config.mk)
51                 SMB_INCLUDE_MK(lib/ldb/tools/config.mk)
52                 define_ldb_modulesdir=no
53         ],
54         [
55                 # Here we need to do some tricks
56                 # with AC_CONFIG_COMMANDS_PRE
57                 # as that's the deferrs the commands
58                 # to location after $prefix and $exec_prefix
59                 # have usefull values and directly before
60                 # creating config.status.
61                 #
62                 # The 'eval eval echo' trick is used to
63                 # actually get the raw absolute directory
64                 # path as this is needed in config.h
65                 define_ldb_modulesdir=yes
66                 AC_CONFIG_COMMANDS_PRE([
67                 if test x"$define_ldb_modulesdir" = x"yes";then
68                         LDB_MODULESDIR=`eval eval echo ${modulesdir}/ldb`
69                         AC_DEFINE_UNQUOTED(LDB_MODULESDIR, "${LDB_MODULESDIR}" , [ldb Modules directory])
70                 fi
71                 ])
72                 ldbdir="\$(abspath \$(srcdir)/../source4/lib/ldb)"
73                 AC_SUBST(ldbdir)
74                 m4_include(lib/ldb/sqlite3.m4)
75                 m4_include(lib/ldb/libldb.m4)
76                 SMB_INCLUDE_MK(lib/ldb/config.mk)
77                 AC_CONFIG_FILES(../source4/lib/ldb/ldb.pc)
78         ]
79 )
80 SMB_INCLUDE_MK(lib/ldb/python.mk) 
81
82 # Not sure why we need this..
83 SMB_ENABLE(swig_ldb,YES)
84
85 m4_include(lib/tls/config.m4)
86 eventsdir="../source4/lib/events"
87 m4_include(lib/events/libevents.m4)
88
89 dnl m4_include(auth/kerberos/config.m4)
90 m4_include(scripting/python/config.m4)
91 m4_include(auth/gensec/config.m4)
92 m4_include(smbd/process_model.m4)
93 m4_include(ntvfs/posix/config.m4)
94 m4_include(ntvfs/unixuid/config.m4)
95 m4_include(auth/config.m4)
96 m4_include(kdc/config.m4)
97 m4_include(ntvfs/sysdep/config.m4)
98 m4_include(lib/appweb/config.m4)
99 m4_include(nsswitch/config.m4)
100
101 dnl Samba 4 files
102 AC_SUBST(LD)
103 AC_LIBREPLACE_SHLD_FLAGS
104 SMB_WRITE_MAKEVARS(samba4-config.mk, [prefix exec_prefix CPPFLAGS LDSHFLAGS POPT_OBJ CFLAGS TALLOC_OBJ])
105                  
106 oldbuilddir="$builddir"
107 builddir="$builddir/../source4"
108 SMB_WRITE_PERLVARS(../source4/build/smb_build/config.pm)
109 builddir="$oldbuilddir"
110
111 echo "configure: creating ../source4/config.mk"
112 cat >../source4/config.mk<<CEOF
113 # config.mk - Autogenerated by configure, DO NOT EDIT!
114 $SMB_INFO_EXT_LIBS
115 $SMB_INFO_SUBSYSTEMS
116 $SMB_INFO_LIBRARIES
117 CEOF
118
119 AC_OUTPUT_COMMANDS([
120 cd ${srcdir}/../source4
121 USESHARED=false $PERL -I${builddir} -I${builddir}/build \
122     -I. -Ibuild \
123     build/smb_build/main.pl --output=../source3/samba4-data.mk main.mk || exit $?
124 cd ../source3
125 ],[
126 srcdir="$srcdir"
127 builddir="$builddir"
128 PERL="$PERL"
129
130 export PERL
131 export srcdir
132 export builddir
133 ])
134
135 AC_CONFIG_COMMANDS([Makefile-samba4], [
136 echo "include samba4.mk" >> ${builddir}/Makefile
137 ])
138