summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-09-17 13:08:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:14 -0500
commit86acf90e4335f79cd34e400d687930d922332d8f (patch)
treedcaff9c775bba6808aac804d52044382db9840f1 /source4
parent3198e58161387c7f4f8990c0355dbfa6beee3463 (diff)
downloadsamba-86acf90e4335f79cd34e400d687930d922332d8f.tar.gz
samba-86acf90e4335f79cd34e400d687930d922332d8f.tar.bz2
samba-86acf90e4335f79cd34e400d687930d922332d8f.zip
r10294: Generate Makefile directly rather then thru Makefile.in. Autoconf
substitution variables are now no longer used. This is one more step towards a (hopefully) perl-based configure (This used to be commit 6f9956a1dd870c0669c288b0fe72b7b1c8773dd0)
Diffstat (limited to 'source4')
-rw-r--r--source4/build/smb_build/main.pl2
-rw-r--r--source4/build/smb_build/makefile.pm88
-rw-r--r--source4/build/smb_build/output.pm2
-rw-r--r--source4/configure.in5
-rw-r--r--source4/lib/registry/config.mk2
-rw-r--r--source4/main.mk4
6 files changed, 59 insertions, 44 deletions
diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl
index e6a330e99d..677488312e 100644
--- a/source4/build/smb_build/main.pl
+++ b/source4/build/smb_build/main.pl
@@ -21,7 +21,7 @@ my $INPUT = {};
my $mkfile = smb_build::config_mk::run_config_mk($INPUT, "main.mk");
my $DEPEND = smb_build::input::check($INPUT, \%config::enabled);
my $OUTPUT = output::create_output($DEPEND);
-makefile::create_makefile_in($OUTPUT, $mkfile, "Makefile.in");
+makefile::create_makefile($OUTPUT, $mkfile, "Makefile");
smb_build_h::create_smb_build_h($OUTPUT, "include/smb_build.h");
open DOTTY, ">samba4-deps.dot";
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index f0c17b693e..36183f210f 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -15,23 +15,43 @@ sub _prepare_path_vars()
{
my $output;
- $output = << '__EOD__';
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-selftest_prefix = @selftest_prefix@
-VPATH = @srcdir@
-srcdir = @srcdir@
-builddir = @builddir@
-
-BASEDIR = @prefix@
-BINDIR = @bindir@
-SBINDIR = @sbindir@
-datadir = @datadir@
-LIBDIR = @libdir@
-CONFIGDIR = @configdir@
-localstatedir = @localstatedir@
-SWATDIR = @swatdir@
-VARDIR = @localstatedir@
+ $config{srcdir} = '.';
+ $config{builddir} = '.';
+
+ if ($config{prefix} eq "NONE") {
+ $config{prefix} = $config{ac_default_prefix};
+ }
+
+ if ($config{exec_prefix} eq "NONE") {
+ $config{exec_prefix} = $config{prefix};
+ }
+
+ $output = << "__EOD__";
+prefix = $config{prefix}
+exec_prefix = $config{exec_prefix}
+selftest_prefix = $config{selftest_prefix}
+VPATH = $config{srcdir}
+srcdir = $config{srcdir}
+builddir = $config{builddir}
+
+BINDIR = $config{bindir}
+SBINDIR = $config{sbindir}
+datadir = $config{datadir}
+LIBDIR = $config{libdir}
+CONFIGDIR = $config{configdir}
+localstatedir = $config{localstatedir}
+SWATDIR = $config{swatdir}
+VARDIR = $config{localstatedir}
+LOGFILEBASE = $config{logfilebase}
+NCALRPCDIR = $config{localstatedir}/ncalrpc
+LOCKDIR = $config{lockdir}
+PIDDIR = $config{piddir}
+MANDIR = $config{mandir}
+PRIVATEDIR = $config{privatedir}
+
+__EOD__
+
+ $output.= << '__EOD__';
# The permissions to give the executables
INSTALLPERMS = 0755
@@ -39,27 +59,16 @@ INSTALLPERMS = 0755
# set these to where to find various files
# These can be overridden by command line switches (see smbd(8))
# or in smb.conf (see smb.conf(5))
-LOGFILEBASE = @logfilebase@
CONFIGFILE = $(CONFIGDIR)/smb.conf
LMHOSTSFILE = $(CONFIGDIR)/lmhosts
-NCALRPCDIR = @localstatedir@/ncalrpc
# This is where smbpasswd et al go
-PRIVATEDIR = @privatedir@
SMB_PASSWD_FILE = $(PRIVATEDIR)/smbpasswd
-# the directory where lock files go
-LOCKDIR = @lockdir@
-
-# the directory where pid files go
-PIDDIR = @piddir@
-
-MANDIR = @mandir@
-
PATH_FLAGS = -DCONFIGFILE=\"$(CONFIGFILE)\" -DSBINDIR=\"$(SBINDIR)\" \
-DBINDIR=\"$(BINDIR)\" -DLMHOSTSFILE=\"$(LMHOSTSFILE)\" \
-DLOCKDIR=\"$(LOCKDIR)\" -DPIDDIR=\"$(PIDDIR)\" -DLIBDIR=\"$(LIBDIR)\" \
- -DLOGFILEBASE=\"$(LOGFILEBASE)\" -DSHLIBEXT=\"@SHLIBEXT@\" \
+ -DLOGFILEBASE=\"$(LOGFILEBASE)\" -DSHLIBEXT=\"$(SHLIBEXT)\" \
-DCONFIGDIR=\"$(CONFIGDIR)\" -DNCALRPCDIR=\"$(NCALRPCDIR)\" \
-DSWATDIR=\"$(SWATDIR)\" -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" \
-DPRIVATE_DIR=\"$(PRIVATEDIR)\"
@@ -91,12 +100,15 @@ STLD_FLAGS=-rc
SHLD=$config{CC}
SHLD_FLAGS=$config{LDSHFLAGS}
+SONAMEFLAG=$config{SONAMEFLAG}
+SHLIBEXT=$config{SHLIBEXT}
XSLTPROC=$config{XSLTPROC}
LEX=$config{LEX}
YACC=$config{YACC}
YAPP=$config{YAPP}
+PIDL_ARGS=$config{PIDL_ARGS}
GCOV=$config{GCOV}
@@ -537,7 +549,7 @@ clean: heimdal_clean
distclean: clean
-rm -f bin/.dummy
-rm -f include/config.h include/smb_build.h
- -rm -f Makefile Makefile.in
+ -rm -f Makefile
-rm -f config.status
-rm -f config.log config.cache
-rm -f samba4-deps.dot
@@ -616,12 +628,12 @@ sub _prepare_rule_lists($)
###########################################################
# This function prepares the output for Makefile
#
-# $output = _prepare_makefile_in($OUTPUT)
+# $output = _prepare_makefile($OUTPUT)
#
# $OUTPUT - the global OUTPUT context
#
# $output - the resulting output buffer
-sub _prepare_makefile_in($)
+sub _prepare_makefile($)
{
my ($CTX) = @_;
my $output;
@@ -666,21 +678,21 @@ __EOD__
}
###########################################################
-# This function creates Makefile.in from the OUTPUT
+# This function creates Makefile from the OUTPUT
# context
#
-# create_makefile_in($OUTPUT)
+# create_makefile($OUTPUT)
#
# $OUTPUT - the global OUTPUT context
#
# $output - the resulting output buffer
-sub create_makefile_in($$$)
+sub create_makefile($$$)
{
my ($CTX, $mk, $file) = @_;
- open(MAKEFILE_IN,">$file") || die ("Can't open $file\n");
- print MAKEFILE_IN _prepare_makefile_in($CTX) . $mk;
- close(MAKEFILE_IN);
+ open(MAKEFILE,">$file") || die ("Can't open $file\n");
+ print MAKEFILE _prepare_makefile($CTX) . $mk;
+ close(MAKEFILE);
print "build/smb_build/main.pl: creating $file\n";
return;
diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm
index 68a0060b6c..f6c4a78274 100644
--- a/source4/build/smb_build/output.pm
+++ b/source4/build/smb_build/output.pm
@@ -37,7 +37,7 @@ sub generate_shared_library($)
$lib->{LIBRARY_SONAME} = $lib->{LIBRARY_NAME}.".$lib->{MAJOR_VERSION}";
$lib->{LIBRARY_REALNAME} = $lib->{LIBRARY_SONAME}.".$lib->{MINOR_VERSION}.$lib->{RELEASE_VERSION}";
$lib->{TARGET} = "bin/lib$lib->{LIBRARY_REALNAME}";
- @{$lib->{LINK_FLAGS}} = ("\@SONAMEFLAG\@$lib->{LIBRARY_SONAME}");
+ @{$lib->{LINK_FLAGS}} = ("\$(SONAMEFLAG)$lib->{LIBRARY_SONAME}");
}
$lib->{OUTPUT} = "-l".lc($lib->{NAME});
}
diff --git a/source4/configure.in b/source4/configure.in
index 752b7ad52f..6da3a52c33 100644
--- a/source4/configure.in
+++ b/source4/configure.in
@@ -84,6 +84,8 @@ dnl Remove -I/usr/include/? from CFLAGS and CPPFLAGS
CFLAGS_REMOVE_USR_INCLUDE(CFLAGS)
CFLAGS_REMOVE_USR_INCLUDE(CPPFLAGS)
+AC_SUBST(ac_default_prefix)
+
echo "configure: creating config.pm"
cat >config.pm<<CEOF
# config.pm - Autogenerate by configure. DO NOT EDIT!
@@ -112,4 +114,5 @@ $SMB_INFO_SUBSYSTEMS
$SMB_INFO_LIBRARIES
CEOF
-AC_OUTPUT(Makefile,,[$PERL -Ibuild build/smb_build/main.pl])
+AC_OUTPUT_COMMANDS([$PERL -Ibuild build/smb_build/main.pl],[PERL="$PERL"])
+AC_OUTPUT
diff --git a/source4/lib/registry/config.mk b/source4/lib/registry/config.mk
index 4cf73bf66a..87e0779007 100644
--- a/source4/lib/registry/config.mk
+++ b/source4/lib/registry/config.mk
@@ -18,7 +18,7 @@ INIT_OBJ_FILES = lib/registry/tdr_regf.o
lib/registry/reg_backend_nt4.c: lib/registry/tdr_regf.c
lib/registry/tdr_regf.c: lib/registry/regf.idl
- @CPP="$(CPP)" $(PERL) pidl/pidl --header --outputdir=lib/registry --tdr-header --tdr-parser -- lib/registry/regf.idl
+ @CPP="$(CPP)" pidl/pidl $(PIDL_ARGS) --header --outputdir=lib/registry --tdr-header --tdr-parser -- lib/registry/regf.idl
################################################
# Start MODULE registry_w95
diff --git a/source4/main.mk b/source4/main.mk
index b87d875ce1..672ca4b1ba 100644
--- a/source4/main.mk
+++ b/source4/main.mk
@@ -129,10 +129,10 @@ ctags:
ctags `find $(srcdir) -name "*.[ch]"`
idl_full: pidl/lib/Parse/Pidl/IDL.pm
- @CPP="$(CPP)" PERL="$(PERL)" script/build_idl.sh FULL @PIDL_ARGS@
+ @CPP="$(CPP)" PERL="$(PERL)" script/build_idl.sh FULL $(PIDL_ARGS)
idl: pidl/lib/Parse/Pidl/IDL.pm
- @CPP="$(CPP)" PERL="$(PERL)" script/build_idl.sh PARTIAL @PIDL_ARGS@
+ @CPP="$(CPP)" PERL="$(PERL)" script/build_idl.sh PARTIAL $(PIDL_ARGS)
pidl/lib/Parse/Pidl/IDL.pm: pidl/idl.yp
-$(YAPP) -s -m 'Parse::Pidl::IDL' -o pidl/lib/Parse/Pidl/IDL.pm pidl/idl.yp