summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-18 17:48:50 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-05-18 17:48:50 +0200
commit9207a22a0e624b60f148fe7ac261b130ba6c285d (patch)
tree868361b9efd04d4e504588da5a2ba87854cf75b9
parent4911af47f8cd750f9b0f1374b447f171318de964 (diff)
downloadsamba-9207a22a0e624b60f148fe7ac261b130ba6c285d.tar.gz
samba-9207a22a0e624b60f148fe7ac261b130ba6c285d.tar.bz2
samba-9207a22a0e624b60f148fe7ac261b130ba6c285d.zip
Move writing autoconf vars into files into m4 macros.
(This used to be commit 3ce8a4bb5568bb798c40034e3fa6a613ad2bf43b)
-rw-r--r--source4/build/m4/public.m440
-rw-r--r--source4/configure.ac28
2 files changed, 42 insertions, 26 deletions
diff --git a/source4/build/m4/public.m4 b/source4/build/m4/public.m4
index ba8251e65d..7a9a76d60f 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,39 @@ $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
+])
diff --git a/source4/configure.ac b/source4/configure.ac
index d07632a291..8671c1a352 100644
--- a/source4/configure.ac
+++ b/source4/configure.ac
@@ -160,25 +160,7 @@ fi
CPPFLAGS="$builddir_headers-I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -I\$(srcdir)/lib/replace -I\$(srcdir)/lib/talloc -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H $CPPFLAGS"
-echo "configure: creating build/smb_build/config.pm"
-cat >build/smb_build/config.pm<<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
+SMB_WRITE_PERLVARS(build/smb_build/config.pm)
echo "configure: creating config.mk"
cat >config.mk<<CEOF
@@ -222,13 +204,7 @@ if test $CMP_RET != 0; then
cp include/config_tmp.h include/config.h
fi
-echo "configure: creating mkconfig.mk"
-cat >mkconfig.mk<<CEOF
-# mkconfig.mk - Autogenerated by configure, DO NOT EDIT!
-AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_VARS]), [
-AC_Var = $AC_Var])
-$MAKE_SETTINGS
-CEOF
+SMB_WRITE_MAKEVARS(mkconfig.mk)
if test $USESHARED = true
then