summaryrefslogtreecommitdiff
path: root/source4/build/m4/public.m4
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build/m4/public.m4')
-rw-r--r--source4/build/m4/public.m471
1 files changed, 71 insertions, 0 deletions
diff --git a/source4/build/m4/public.m4 b/source4/build/m4/public.m4
index ba8251e65d..d932f09a69 100644
--- a/source4/build/m4/public.m4
+++ b/source4/build/m4/public.m4
@@ -12,6 +12,10 @@ dnl SMB_ENABLE(name,default_build)
dnl
dnl SMB_INCLUDE_MK(file)
dnl
+dnl SMB_WRITE_MAKEVARS(file)
+dnl
+dnl SMB_WRITE_PERLVARS(file)
+dnl
dnl #######################################################
dnl ### And now the implementation ###
dnl #######################################################
@@ -150,3 +154,70 @@ $1_ENABLE = $2
SMB_INFO_ENABLES="$SMB_INFO_ENABLES
\$enabled{$1} = \"$2\";"
])
+
+dnl SMB_WRITE_MAKEVARS(path)
+AC_DEFUN([SMB_WRITE_MAKEVARS],
+[
+echo "configure: creating $1"
+cat >$1<<CEOF
+# $1 - Autogenerated by configure, DO NOT EDIT!
+AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_VARS]), [
+AC_Var = $AC_Var])
+$MAKE_SETTINGS
+CEOF
+])
+
+dnl SMB_WRITE_PERLVARS(path)
+AC_DEFUN([SMB_WRITE_PERLVARS],
+[
+echo "configure: creating $1"
+cat >$1<<CEOF
+# config.pm - Autogenerate by configure. DO NOT EDIT!
+
+package config;
+require Exporter;
+@ISA = qw(Exporter);
+@EXPORT_OK = qw(%enabled %config);
+use strict;
+
+use vars qw(%enabled %config);
+
+%config = (AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_VARS]), [
+ AC_Var => '$AC_Var',])
+);
+
+$SMB_INFO_ENABLES
+1;
+CEOF
+])
+
+dnl SMB_BUILD_RUN(OUTPUT_FILE)
+AC_DEFUN([SMB_BUILD_RUN],
+[
+AC_OUTPUT_COMMANDS(
+[
+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
+ )
+
+$PERL -I${builddir} -I${builddir}/build \
+ -I${srcdir} -I${srcdir}/build \
+ ${srcdir}/build/smb_build/main.pl --output=$1 main.mk || exit $?
+],
+[
+srcdir="$srcdir"
+builddir="$builddir"
+PERL="$PERL"
+
+export PERL
+export srcdir
+export builddir
+])
+])