1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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 6f9956a1dd)
This commit is contained in:
Jelmer Vernooij 2005-09-17 13:08:49 +00:00 committed by Gerald (Jerry) Carter
parent 3198e58161
commit 86acf90e43
6 changed files with 58 additions and 43 deletions

View File

@ -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";

View File

@ -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@
$config{srcdir} = '.';
$config{builddir} = '.';
BASEDIR = @prefix@
BINDIR = @bindir@
SBINDIR = @sbindir@
datadir = @datadir@
LIBDIR = @libdir@
CONFIGDIR = @configdir@
localstatedir = @localstatedir@
SWATDIR = @swatdir@
VARDIR = @localstatedir@
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;

View File

@ -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});
}

View File

@ -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

View File

@ -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

View File

@ -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