From 09447777d0c1a00daced1c63c3614136acfbe53f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 16 Feb 2008 16:15:21 +0100 Subject: use gmake to handle .py file copies. (This used to be commit d54421a9eeadbd76791917c5e3c460c897259ede) --- source4/build/smb_build/makefile.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 29da771353..fa2d7883eb 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -341,9 +341,7 @@ sub PythonFiles($$) foreach (@{$ctx->{PYTHON_FILES}}) { my $target = "bin/python/".basename($_); my $source = output::add_dir_str($ctx->{BASEDIR}, $_); - $self->output("$target: $source\n" . - "\tmkdir -p \$(builddir)/bin/python\n" . - "\tcp $source \$@\n\n"); + $self->output("$target: $source\n\n"); push (@{$self->{python_pys}}, $target); } } -- cgit From 581167ddd7153e59c94d0eb2709cd7719a13ca25 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 16 Feb 2008 16:38:01 +0100 Subject: Create SBIN_PROGS and BIN_PROGS lists from within make. (This used to be commit e0afbc3778ca7c6dc087e2b9f4992a131ec66a75) --- source4/build/smb_build/makefile.pm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index fa2d7883eb..8d7b41a404 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -22,8 +22,6 @@ sub new($$$) bless($self, $myname); $self->{manpages} = []; - $self->{sbin_progs} = []; - $self->{bin_progs} = []; $self->{static_libs} = []; $self->{python_dsos} = []; $self->{python_pys} = []; @@ -301,9 +299,9 @@ sub Binary($$) unless (defined($ctx->{INSTALLDIR})) { } elsif ($ctx->{INSTALLDIR} eq "SBINDIR") { - push (@{$self->{sbin_progs}}, $ctx->{RESULT_BINARY}); + $self->output("SBIN_PROGS += $installdir/$ctx->{BINARY}\n"); } elsif ($ctx->{INSTALLDIR} eq "BINDIR") { - push (@{$self->{bin_progs}}, $ctx->{RESULT_BINARY}); + $self->output("BIN_PROGS += $installdir/$ctx->{BINARY}\n"); } $self->output("binaries:: $ctx->{TARGET_BINARY}\n"); @@ -398,8 +396,6 @@ sub write($$) my ($self, $file) = @_; $self->output("MANPAGES = " . array2oneperline($self->{manpages})."\n"); - $self->output("BIN_PROGS = " . array2oneperline($self->{bin_progs}) . "\n"); - $self->output("SBIN_PROGS = " . array2oneperline($self->{sbin_progs}) . "\n"); $self->output("STATIC_LIBS = " . array2oneperline($self->{static_libs}) . "\n"); $self->output("SHARED_LIBS = " . array2oneperline($self->{shared_libs}) . "\n"); $self->output("PYTHON_DSOS = " . array2oneperline($self->{python_dsos}) . "\n"); -- cgit From f0ad690768b2b9fc260e62e3ab2cca4ad6c93ba9 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 16 Feb 2008 17:01:27 +0100 Subject: Use make to generate list of prototype headers. (This used to be commit 17d2f682e94154ee654de59b88816437f4e7f093) --- source4/build/smb_build/makefile.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 8d7b41a404..b29107679e 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -29,7 +29,6 @@ sub new($$$) $self->{headers} = []; $self->{plugins} = []; $self->{pc_files} = []; - $self->{proto_headers} = []; $self->{output} = ""; $self->{mkfile} = $mkfile; @@ -370,7 +369,7 @@ sub ProtoHeader($$) $comment .= " and "; $target.= " "; } - push (@{$self->{proto_headers}}, $priv); + $self->output("PROTO_HEADERS += $priv\n"); } else { $ctx->{PRIVATE_PROTO_HEADER} = $ctx->{PUBLIC_PROTO_HEADER}; $priv = output::add_dir_str($ctx->{BASEDIR}, $ctx->{PRIVATE_PROTO_HEADER}); @@ -380,7 +379,7 @@ sub ProtoHeader($$) $pub = output::add_dir_str($ctx->{BASEDIR}, $ctx->{PUBLIC_PROTO_HEADER}); $comment .= $pub; $target .= $pub; - push (@{$self->{proto_headers}}, $pub); + $self->output("PROTO_HEADERS += $pub\n"); } else { $ctx->{PUBLIC_PROTO_HEADER} = $ctx->{PRIVATE_PROTO_HEADER}; $pub = output::add_dir_str($ctx->{BASEDIR}, $ctx->{PUBLIC_PROTO_HEADER}); @@ -403,7 +402,6 @@ sub write($$) $self->output("PUBLIC_HEADERS = " . array2oneperline($self->{headers}) . "\n"); $self->output("PC_FILES = " . array2oneperline($self->{pc_files}) . "\n"); $self->output("ALL_OBJS = " . array2oneperline($self->{all_objs}) . "\n"); - $self->output("PROTO_HEADERS = " . array2oneperline($self->{proto_headers}) . "\n"); $self->output("PLUGINS = " . array2oneperline($self->{plugins}) . "\n"); $self->_prepare_mk_files(); -- cgit From b48375f432e014f3250d012b1c1b7da6d47ac383 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 16 Feb 2008 16:58:26 +0100 Subject: Use make to generate lists of libraries. (This used to be commit 3519aae1845f2a15330184625d541ce0f0cac56b) --- source4/build/smb_build/makefile.pm | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index b29107679e..2acd022503 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -21,11 +21,8 @@ sub new($$$) bless($self, $myname); - $self->{manpages} = []; - $self->{static_libs} = []; $self->{python_dsos} = []; $self->{python_pys} = []; - $self->{shared_libs} = []; $self->{headers} = []; $self->{plugins} = []; $self->{pc_files} = []; @@ -217,7 +214,7 @@ sub SharedLibrary($$) { my ($self,$ctx) = @_; - push (@{$self->{shared_libs}}, $ctx->{RESULT_SHARED_LIBRARY}) if (defined($ctx->{SO_VERSION})); + $self->output("SHARED_LIBS += $ctx->{RESULT_SHARED_LIBRARY}\n") if (defined($ctx->{SO_VERSION})); $self->_prepare_list($ctx, "DEPEND_LIST"); $self->_prepare_list($ctx, "LINK_FLAGS"); @@ -273,7 +270,7 @@ sub StaticLibrary($$) return unless (defined($ctx->{OBJ_FILES})); - push (@{$self->{static_libs}}, $ctx->{RESULT_STATIC_LIBRARY}) if ($ctx->{TYPE} eq "LIBRARY"); + $self->output("STATIC_LIBS += $ctx->{TARGET_STATIC_LIBRARY}\n") if ($ctx->{TYPE} eq "LIBRARY"); $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); $self->_prepare_list($ctx, "FULL_OBJ_LIST"); @@ -394,9 +391,6 @@ sub write($$) { my ($self, $file) = @_; - $self->output("MANPAGES = " . array2oneperline($self->{manpages})."\n"); - $self->output("STATIC_LIBS = " . array2oneperline($self->{static_libs}) . "\n"); - $self->output("SHARED_LIBS = " . array2oneperline($self->{shared_libs}) . "\n"); $self->output("PYTHON_DSOS = " . array2oneperline($self->{python_dsos}) . "\n"); $self->output("PYTHON_PYS = " . array2oneperline($self->{python_pys}) . "\n"); $self->output("PUBLIC_HEADERS = " . array2oneperline($self->{headers}) . "\n"); -- cgit From acf5b5a1ab48fab40635f98d54601ec9e65742a9 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 16 Feb 2008 16:58:26 +0100 Subject: Use make to generate lists of libraries. (This used to be commit 2c2a589183067d7fced4ace33380bd1af610924a) --- source4/build/smb_build/makefile.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 2acd022503..fea0977ee6 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -214,7 +214,7 @@ sub SharedLibrary($$) { my ($self,$ctx) = @_; - $self->output("SHARED_LIBS += $ctx->{RESULT_SHARED_LIBRARY}\n") if (defined($ctx->{SO_VERSION})); + $self->output("SHARED_LIBS += $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}\n") if (defined($ctx->{SO_VERSION})); $self->_prepare_list($ctx, "DEPEND_LIST"); $self->_prepare_list($ctx, "LINK_FLAGS"); -- cgit From c865582e9c6159082a59f0bf2bea0538dc277217 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 16 Feb 2008 17:12:01 +0100 Subject: Use make to create lists of pc files and prototype headers. (This used to be commit a932a2e37d1aa86cca769398721318b3942fad83) --- source4/build/smb_build/main.pl | 2 +- source4/build/smb_build/makefile.pm | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index 3ed0327d6d..9690c465a7 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -56,7 +56,7 @@ foreach my $key (values %$OUTPUT) { $mkenv->MergedObj($key) if grep(/MERGED_OBJ/, @{$key->{OUTPUT_TYPE}}); $mkenv->StaticLibrary($key) if grep(/STATIC_LIBRARY/, @{$key->{OUTPUT_TYPE}}); if (defined($key->{PC_FILE})) { - push(@{$mkenv->{pc_files}}, "$key->{BASEDIR}/$key->{PC_FILE}"); + $mkenv->output("PC_FILES += $key->{BASEDIR}/$key->{PC_FILE}\n"); } $mkenv->SharedLibraryPrimitives($key) if ($key->{TYPE} eq "LIBRARY") and grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index fea0977ee6..fe16f0124a 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -25,7 +25,6 @@ sub new($$$) $self->{python_pys} = []; $self->{headers} = []; $self->{plugins} = []; - $self->{pc_files} = []; $self->{output} = ""; $self->{mkfile} = $mkfile; @@ -282,9 +281,15 @@ sub Header($$) { my ($self,$ctx) = @_; + return if ($#{$ctx->{PUBLIC_HEADERS}} == -1); + + $self->output("PUBLIC_HEADERS +="); + foreach (@{$ctx->{PUBLIC_HEADERS}}) { - push (@{$self->{headers}}, output::add_dir_str($ctx->{BASEDIR}, $_)); + $self->output(" " . output::add_dir_str($ctx->{BASEDIR}, $_)); } + + $self->output("\n"); } sub Binary($$) @@ -393,8 +398,6 @@ sub write($$) $self->output("PYTHON_DSOS = " . array2oneperline($self->{python_dsos}) . "\n"); $self->output("PYTHON_PYS = " . array2oneperline($self->{python_pys}) . "\n"); - $self->output("PUBLIC_HEADERS = " . array2oneperline($self->{headers}) . "\n"); - $self->output("PC_FILES = " . array2oneperline($self->{pc_files}) . "\n"); $self->output("ALL_OBJS = " . array2oneperline($self->{all_objs}) . "\n"); $self->output("PLUGINS = " . array2oneperline($self->{plugins}) . "\n"); -- cgit From c88cd9314eb6c86b54cccd57a259cb9a1ef36d73 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 16 Feb 2008 16:48:36 +0100 Subject: Generate manpage list with make. (This used to be commit ea3d3b52504b45f45aca434ea4376906f65ead12) --- source4/build/smb_build/makefile.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index fe16f0124a..73edd5f551 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -349,8 +349,7 @@ sub Manpage($$) { my ($self,$ctx) = @_; - my $path = output::add_dir_str($ctx->{BASEDIR}, $ctx->{MANPAGE}); - push (@{$self->{manpages}}, $path); + $self->output("MANPAGES += " . output::add_dir_str($ctx->{BASEDIR}, $ctx->{MANPAGE}) . "\n"); } sub ProtoHeader($$) -- cgit From 8f69c6462d2117a925975e851ad11f997908b5cc Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 16 Feb 2008 17:14:03 +0100 Subject: Use make to create lists of plugins, remove duplicate variable. (This used to be commit 1ec6870966bcd25b1932da675386d3ad5bcd9b6f) --- source4/build/smb_build/makefile.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 73edd5f551..bb7d2afd8d 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -24,7 +24,6 @@ sub new($$$) $self->{python_dsos} = []; $self->{python_pys} = []; $self->{headers} = []; - $self->{plugins} = []; $self->{output} = ""; $self->{mkfile} = $mkfile; @@ -125,7 +124,7 @@ sub SharedModule($$) push (@{$self->{python_dsos}}, "$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}"); } else { - push (@{$self->{plugins}}, "$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}"); + $self->output("PLUGINS += $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}\n"); $self->output("installplugins:: $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}\n"); $self->output("\t\@echo Installing $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME} as \$(DESTDIR)\$(modulesdir)/$sane_subsystem/$ctx->{LIBRARY_REALNAME}\n"); $self->output("\t\@mkdir -p \$(DESTDIR)\$(modulesdir)/$sane_subsystem/\n"); @@ -398,7 +397,6 @@ sub write($$) $self->output("PYTHON_DSOS = " . array2oneperline($self->{python_dsos}) . "\n"); $self->output("PYTHON_PYS = " . array2oneperline($self->{python_pys}) . "\n"); $self->output("ALL_OBJS = " . array2oneperline($self->{all_objs}) . "\n"); - $self->output("PLUGINS = " . array2oneperline($self->{plugins}) . "\n"); $self->_prepare_mk_files(); -- cgit From f165dad927c44f49d61a079b27103479f5f9bc80 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 16 Feb 2008 17:18:23 +0100 Subject: Use make to generate list of python files, remove unused variable. (This used to be commit 67f15cd484dbf7b49e6c5cb2566ad95d05b66b5b) --- source4/build/smb_build/makefile.pm | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index bb7d2afd8d..96ab789b70 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -21,9 +21,6 @@ sub new($$$) bless($self, $myname); - $self->{python_dsos} = []; - $self->{python_pys} = []; - $self->{headers} = []; $self->{output} = ""; $self->{mkfile} = $mkfile; @@ -121,8 +118,7 @@ sub SharedModule($$) $sane_subsystem =~ s/^lib//; if ($ctx->{TYPE} eq "PYTHON") { - push (@{$self->{python_dsos}}, - "$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}"); + $self->output("PYTHON_DSOS += $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}\n"); } else { $self->output("PLUGINS += $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}\n"); $self->output("installplugins:: $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}\n"); @@ -340,7 +336,7 @@ sub PythonFiles($$) my $target = "bin/python/".basename($_); my $source = output::add_dir_str($ctx->{BASEDIR}, $_); $self->output("$target: $source\n\n"); - push (@{$self->{python_pys}}, $target); + $self->output("PYTHON_PYS += $target\n"); } } @@ -394,8 +390,6 @@ sub write($$) { my ($self, $file) = @_; - $self->output("PYTHON_DSOS = " . array2oneperline($self->{python_dsos}) . "\n"); - $self->output("PYTHON_PYS = " . array2oneperline($self->{python_pys}) . "\n"); $self->output("ALL_OBJS = " . array2oneperline($self->{all_objs}) . "\n"); $self->_prepare_mk_files(); -- cgit From 2219d434ed54f4ba82ac141dafcb10f7f7762d73 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 25 Feb 2008 15:48:35 +0100 Subject: Remove unused include. (This used to be commit cf59ec4cc3c3dca9275236bf45caf56632bf983a) --- source4/build/smb_build/cflags.pm | 2 -- 1 file changed, 2 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/cflags.pm b/source4/build/smb_build/cflags.pm index a4ab90a8cd..ad6cd42c65 100755 --- a/source4/build/smb_build/cflags.pm +++ b/source4/build/smb_build/cflags.pm @@ -23,8 +23,6 @@ sub create_cflags($$$$) { open(CFLAGS_TXT,">$file") || die ("Can't open `$file'\n"); - print CFLAGS_TXT "include mkconfig.mk\n"; - my $src_ne_build = ($srcdir ne $builddir) ? 1 : 0; foreach my $key (values %{$CTX}) { -- cgit From eff6a8c25671c9955159b15e3d36734f6a6b327c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 29 Feb 2008 13:58:20 +0100 Subject: Avoid use of removed variable. (This used to be commit 10f0b5f83f0b34ae9d0f83c0975cf06bf56277d4) --- source4/build/smb_build/makefile.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 96ab789b70..9fedfe9df2 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -291,13 +291,11 @@ sub Binary($$) { my ($self,$ctx) = @_; - my $extradir = ""; - unless (defined($ctx->{INSTALLDIR})) { } elsif ($ctx->{INSTALLDIR} eq "SBINDIR") { - $self->output("SBIN_PROGS += $installdir/$ctx->{BINARY}\n"); + $self->output("SBIN_PROGS += bin/$ctx->{BINARY}\n"); } elsif ($ctx->{INSTALLDIR} eq "BINDIR") { - $self->output("BIN_PROGS += $installdir/$ctx->{BINARY}\n"); + $self->output("BIN_PROGS += bin/$ctx->{BINARY}\n"); } $self->output("binaries:: $ctx->{TARGET_BINARY}\n"); -- cgit From bc282d843d9326233c25f7715c8006b890f89d52 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 25 Feb 2008 18:51:39 +0100 Subject: Move configure output details out of perl code. (This used to be commit e33f357fb00cd504181562eaf2ca1d4511d5ec51) --- source4/build/smb_build/main.pl | 7 ------- 1 file changed, 7 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index 9690c465a7..27ba2d36e1 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -93,11 +93,4 @@ cflags::create_cflags($OUTPUT, $config::config{srcdir}, summary::show($OUTPUT, \%config::config); -if ($shared_libs_used) { - print < Date: Mon, 25 Feb 2008 19:11:04 +0100 Subject: Merge env.pm into makefile.pm. (This used to be commit 28bbd546195461d4b8747bc6cefd6320f8efe17d) --- source4/build/smb_build/env.pm | 57 ------------------------------------- source4/build/smb_build/main.pl | 1 - source4/build/smb_build/makefile.pm | 31 +++++++++++++++++--- 3 files changed, 27 insertions(+), 62 deletions(-) delete mode 100644 source4/build/smb_build/env.pm (limited to 'source4/build') diff --git a/source4/build/smb_build/env.pm b/source4/build/smb_build/env.pm deleted file mode 100644 index 76cd8d1a26..0000000000 --- a/source4/build/smb_build/env.pm +++ /dev/null @@ -1,57 +0,0 @@ -# Environment class -# -# Samba Build Environment -# -# (C) 2005 Jelmer Vernooij -# -# Published under the GNU GPL - -package smb_build::env; -use smb_build::input; -use File::Path; -use File::Basename; - -use strict; - -sub new($$) -{ - my ($name, $config) = @_; - my $self = { }; - bless $self, $name; - - $self->{items} = {}; - $self->{info} = {}; - - $self->_set_config($config); - - return $self; -} - -sub _set_config($$) -{ - my ($self, $config) = @_; - - $self->{config} = $config; - - if (not defined($self->{config}->{srcdir})) { - $self->{config}->{srcdir} = '.'; - } - - if (not defined($self->{config}->{builddir})) { - $self->{config}->{builddir} = '.'; - } - - if ($self->{config}->{prefix} eq "NONE") { - $self->{config}->{prefix} = $self->{config}->{ac_default_prefix}; - } - - if ($self->{config}->{exec_prefix} eq "NONE") { - $self->{config}->{exec_prefix} = $self->{config}->{prefix}; - } - - $self->{developer} = ($self->{config}->{developer} eq "yes"); - $self->{gnu_make} = ($self->{config}->{GNU_MAKE} eq "yes"); - $self->{automatic_deps} = ($self->{config}->{automatic_dependencies} eq "yes"); -} - -1; diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index 27ba2d36e1..6d4a7321a4 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -10,7 +10,6 @@ use smb_build::header; use smb_build::input; use smb_build::config_mk; use smb_build::output; -use smb_build::env; use smb_build::cflags; use smb_build::summary; use smb_build::config; diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 9fedfe9df2..8e6df89d1c 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -6,21 +6,21 @@ # Released under the GNU GPL package smb_build::makefile; -use smb_build::env; use smb_build::output; use File::Basename; use strict; -use base 'smb_build::env'; use Cwd 'abs_path'; sub new($$$) { my ($myname, $config, $mkfile) = @_; - my $self = new smb_build::env($config); - + my $self = {}; + bless($self, $myname); + $self->_set_config($config); + $self->{output} = ""; $self->{mkfile} = $mkfile; @@ -38,6 +38,29 @@ sub new($$$) return $self; } +sub _set_config($$) +{ + my ($self, $config) = @_; + + $self->{config} = $config; + + if (not defined($self->{config}->{srcdir})) { + $self->{config}->{srcdir} = '.'; + } + + if (not defined($self->{config}->{builddir})) { + $self->{config}->{builddir} = '.'; + } + + if ($self->{config}->{prefix} eq "NONE") { + $self->{config}->{prefix} = $self->{config}->{ac_default_prefix}; + } + + if ($self->{config}->{exec_prefix} eq "NONE") { + $self->{config}->{exec_prefix} = $self->{config}->{prefix}; + } +} + sub output($$) { my ($self, $text) = @_; -- cgit From 4e95a259c0faf678a979ca54676c56a747df9e9c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 25 Feb 2008 20:39:29 +0100 Subject: Update smb_build README. (This used to be commit 9db23848dcd1b73273b90edd923b6c55f6c915c4) --- source4/build/smb_build/README.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/README.txt b/source4/build/smb_build/README.txt index a5e4db99e0..5974db998f 100644 --- a/source4/build/smb_build/README.txt +++ b/source4/build/smb_build/README.txt @@ -29,7 +29,7 @@ EXT_LIB: BINARY: a BINARY means a executable binary file. (e.g. 'smbtorture' or 'ldbedit') - a BINARY typicly has only commandline handling and basic + a BINARY typically has only commandline handling and basic functionality code in it and depends on the functions of SUBSYSTEM's (REQUIRED_SUBSYSTEMS). @@ -50,8 +50,6 @@ input.pm - Input validation main.pm - Main makefile.pm - Makefile generation output.pm - Dependency calculation -header.pm - build.h generation -cflags.pm - Generates cflags.txt for file-specific cflags Layout ------- -- cgit From 27a0b3210f4262ddaf43ec1627c81a475121cade Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 25 Feb 2008 18:44:52 +0100 Subject: Remove workaround for some non-GNU makes. (This used to be commit 0580357fb4b10e4a751d281e209f6a87e1c88143) --- source4/build/m4/check_make.m4 | 29 ++++++----------------------- source4/build/smb_build/main.pl | 2 ++ 2 files changed, 8 insertions(+), 23 deletions(-) (limited to 'source4/build') diff --git a/source4/build/m4/check_make.m4 b/source4/build/m4/check_make.m4 index d7799649a7..f497684453 100644 --- a/source4/build/m4/check_make.m4 +++ b/source4/build/m4/check_make.m4 @@ -6,35 +6,26 @@ dnl Released under the GNU GPL dnl ------------------------------------------------------- dnl -AC_PATH_PROG(MAKE,make) +AC_PATH_PROGS(MAKE,gmake make) AC_CACHE_CHECK([whether we have GNU make], samba_cv_gnu_make, [ -if $ac_cv_path_MAKE --version | head -1 | grep GNU 2>/dev/null >/dev/null +if ! $ac_cv_path_MAKE --version | head -1 | grep GNU 2>/dev/null >/dev/null then - samba_cv_gnu_make=yes -else - samba_cv_gnu_make=no + AC_MSG_ERROR([Unable to find GNU make]) fi ]) -GNU_MAKE=$samba_cv_gnu_make -AC_SUBST(GNU_MAKE) - -if test "x$GNU_MAKE" = x"yes"; then - AC_CACHE_CHECK([GNU make version], samba_cv_gnu_make_version,[ +AC_CACHE_CHECK([GNU make version], samba_cv_gnu_make_version,[ samba_cv_gnu_make_version=`$ac_cv_path_MAKE --version | head -1 | cut -d " " -f 3 2>/dev/null` ]) GNU_MAKE_VERSION=$samba_cv_gnu_make_version AC_SUBST(GNU_MAKE_VERSION) -fi new_make=no AC_MSG_CHECKING([for GNU make >= 3.81]) -if test x$GNU_MAKE = x"yes"; then - if $PERL -e " \$_ = '$GNU_MAKE_VERSION'; s/@<:@^\d\.@:>@.*//g; exit (\$_ < 3.81);"; then - new_make=yes - fi +if $PERL -e " \$_ = '$GNU_MAKE_VERSION'; s/@<:@^\d\.@:>@.*//g; exit (\$_ < 3.81);"; then + new_make=yes fi AC_MSG_RESULT($new_make) automatic_dependencies=no @@ -46,11 +37,3 @@ AC_ARG_ENABLE(automatic-dependencies, [ automatic_dependencies=no ]) AC_MSG_RESULT($automatic_dependencies) AC_SUBST(automatic_dependencies) - -FIRST_PREREQ="\$*.c" -AC_SUBST(FIRST_PREREQ) - -if test x$GNU_MAKE = xyes; then - FIRST_PREREQ="\$<" -fi - diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index 6d4a7321a4..d2d3dc9c5c 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -92,4 +92,6 @@ cflags::create_cflags($OUTPUT, $config::config{srcdir}, summary::show($OUTPUT, \%config::config); +print "To build Samba, run $config::config{MAKE}\n"; + 1; -- cgit From bffb5fc1825da328158e9efc4916d90d045eb3f1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 25 Feb 2008 18:14:03 +0100 Subject: Use more GNU-make specific variables. (This used to be commit 3506c707c5e390a0634e597362f454399fb50b07) --- source4/build/smb_build/makefile.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 8e6df89d1c..1bd51d8582 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -253,7 +253,7 @@ sub SharedLibrary($$) # $ctx->{RESULT_SHARED_LIBRARY}: \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST) \@echo Linking \$\@ - \@mkdir -p $ctx->{SHAREDDIR} + \@mkdir -p \$(D@) \@\$(SHLD) \$(LDFLAGS) \$(SHLD_FLAGS) \$(INTERN_LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\ \$($ctx->{NAME}\_FULL_OBJ_LIST) \\ \$($ctx->{NAME}_LINK_FLAGS) \\ @@ -274,7 +274,7 @@ sub MergedObj($$) # $ctx->{RESULT_MERGED_OBJ}: \$($ctx->{NAME}_OBJ_LIST) \@echo Partially linking \$@ - \@mkdir -p bin/mergedobj + \@mkdir -p \$(D@) \$(PARTLINK) -o \$@ \$($ctx->{NAME}_OBJ_LIST) __EOD__ -- cgit From d3f260cbef82c040f8b287163f92c5b54f23d433 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 16 Feb 2008 19:19:02 +0100 Subject: Move logic to makefile (This used to be commit 94b0dd7ab0f5cc5493ea8dcfd8be54e1bec26283) --- source4/build/smb_build/makefile.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 1bd51d8582..a152bfc90f 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -245,9 +245,9 @@ sub SharedLibrary($$) } } - if (defined($ctx->{LIBRARY_SONAME})) { - $lns .= "\n\t\@ln -fs $ctx->{LIBRARY_REALNAME} $ctx->{SHAREDDIR}/$ctx->{LIBRARY_DEBUGNAME}"; - } + $lns .= "\nifdef $ctx->{NAME}_SOVERSION"; + $lns .= "\n\t\@ln -fs $ctx->{LIBRARY_REALNAME} $ctx->{SHAREDDIR}/$ctx->{LIBRARY_DEBUGNAME}"; + $lns .= "\nendif"; $self->output(<< "__EOD__" # -- cgit From d8d9a6ef040b6c3e7946e6ae2cba2b28234c8baf Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 26 Feb 2008 15:11:47 +0100 Subject: Move manpage management out of the perl build system. (This used to be commit 1dd6bea507f1f5e26cccf89148280721260a4673) --- source4/build/smb_build/README.txt | 3 +-- source4/build/smb_build/config_mk.pm | 6 ------ source4/build/smb_build/main.pl | 1 - source4/build/smb_build/makefile.pm | 7 ------- 4 files changed, 1 insertion(+), 16 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/README.txt b/source4/build/smb_build/README.txt index 5974db998f..eac3905cce 100644 --- a/source4/build/smb_build/README.txt +++ b/source4/build/smb_build/README.txt @@ -1,6 +1,5 @@ The Samba Build System ----------------------- ----------------------- +====================== The build system basically has two main parts: the autoconf-generated shell scripts which check for availability of functions and libraries diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm index 4d8db8a04e..2f29516ba5 100644 --- a/source4/build/smb_build/config_mk.pm +++ b/source4/build/smb_build/config_mk.pm @@ -36,8 +36,6 @@ my $section_types = { "ENABLE" => "bool", - "MANPAGE" => "string", - "PUBLIC_PROTO_HEADER" => "string", "PRIVATE_PROTO_HEADER" => "string", @@ -62,7 +60,6 @@ my $section_types = { "OUTPUT_TYPE" => "list", - "MANPAGE" => "string", "PRIVATE_PROTO_HEADER" => "string", "CFLAGS" => "list" @@ -74,7 +71,6 @@ my $section_types = { "ENABLE" => "bool", - "MANPAGE" => "string", "INSTALLDIR" => "string", "PRIVATE_PROTO_HEADER" => "string", @@ -102,8 +98,6 @@ my $section_types = { "ENABLE" => "bool", - "MANPAGE" => "string", - "PUBLIC_HEADERS" => "list", "PUBLIC_PROTO_HEADER" => "string", diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index d2d3dc9c5c..b9e1037423 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -67,7 +67,6 @@ foreach my $key (values %$OUTPUT) { $key->{TYPE} eq "PYTHON") and grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); $mkenv->PythonFiles($key) if defined($key->{PYTHON_FILES}); - $mkenv->Manpage($key) if defined($key->{MANPAGE}); $mkenv->Header($key) if defined($key->{PUBLIC_HEADERS}); $mkenv->ProtoHeader($key) if defined($key->{PRIVATE_PROTO_HEADER}) or defined($key->{PUBLIC_PROTO_HEADER}); diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index a152bfc90f..005c6f7fe8 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -361,13 +361,6 @@ sub PythonFiles($$) } } -sub Manpage($$) -{ - my ($self,$ctx) = @_; - - $self->output("MANPAGES += " . output::add_dir_str($ctx->{BASEDIR}, $ctx->{MANPAGE}) . "\n"); -} - sub ProtoHeader($$) { my ($self,$ctx) = @_; -- cgit From 1ada7108408f567f61cfbf2b625730ba898452db Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 29 Feb 2008 14:23:38 +0100 Subject: Move public header accumulation out of the perl code. Never install generated prototype files. It's easier to break the API when using them and they're not easily readable for 3rd party users. Conflicts: source/auth/config.mk source/auth/credentials/config.mk source/auth/gensec/config.mk source/build/smb_build/config_mk.pm source/build/smb_build/main.pl source/build/smb_build/makefile.pm source/dsdb/config.mk source/lib/charset/config.mk source/lib/tdr/config.mk source/lib/util/config.mk source/libcli/config.mk source/libcli/ldap/config.mk source/librpc/config.mk source/param/config.mk source/rpc_server/config.mk source/torture/config.mk (This used to be commit 6c659689ed4081f1d7a6253c538c7f01784197ba) --- source4/build/smb_build/config_mk.pm | 5 ----- source4/build/smb_build/input.pm | 8 -------- source4/build/smb_build/main.pl | 1 - source4/build/smb_build/makefile.pm | 15 --------------- 4 files changed, 29 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm index 2f29516ba5..90e45124dc 100644 --- a/source4/build/smb_build/config_mk.pm +++ b/source4/build/smb_build/config_mk.pm @@ -39,8 +39,6 @@ my $section_types = { "PUBLIC_PROTO_HEADER" => "string", "PRIVATE_PROTO_HEADER" => "string", - "PUBLIC_HEADERS" => "list", - "CFLAGS" => "list", "LDFLAGS" => "list", "STANDARD_VISIBILITY" => "string", @@ -98,9 +96,6 @@ my $section_types = { "ENABLE" => "bool", - "PUBLIC_HEADERS" => "list", - - "PUBLIC_PROTO_HEADER" => "string", "PRIVATE_PROTO_HEADER" => "string", "CFLAGS" => "list", diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index 8c9a6efacc..948f2657b4 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -233,14 +233,6 @@ sub check($$$$$) my ($INPUT, $enabled, $subsys_ot, $lib_ot, $module_ot) = @_; foreach my $part (values %$INPUT) { - unless (defined($part->{PUBLIC_HEADERS})) { - $part->{PUBLIC_HEADERS} = []; - } - - if (defined($part->{PUBLIC_PROTO_HEADER})) { - push (@{$part->{PUBLIC_HEADERS}}, $part->{PUBLIC_PROTO_HEADER}); - } - if (defined($enabled->{$part->{NAME}})) { $part->{ENABLE} = $enabled->{$part->{NAME}}; next; diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index b9e1037423..6c205a69f0 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -67,7 +67,6 @@ foreach my $key (values %$OUTPUT) { $key->{TYPE} eq "PYTHON") and grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); $mkenv->PythonFiles($key) if defined($key->{PYTHON_FILES}); - $mkenv->Header($key) if defined($key->{PUBLIC_HEADERS}); $mkenv->ProtoHeader($key) if defined($key->{PRIVATE_PROTO_HEADER}) or defined($key->{PUBLIC_PROTO_HEADER}); } diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 005c6f7fe8..06f9d4b194 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -295,21 +295,6 @@ sub StaticLibrary($$) $self->output("$ctx->{RESULT_STATIC_LIBRARY}: \$($ctx->{NAME}_FULL_OBJ_LIST)\n"); } -sub Header($$) -{ - my ($self,$ctx) = @_; - - return if ($#{$ctx->{PUBLIC_HEADERS}} == -1); - - $self->output("PUBLIC_HEADERS +="); - - foreach (@{$ctx->{PUBLIC_HEADERS}}) { - $self->output(" " . output::add_dir_str($ctx->{BASEDIR}, $_)); - } - - $self->output("\n"); -} - sub Binary($$) { my ($self,$ctx) = @_; -- cgit From 21208d3303ec13056f706ee74132822a7dd2f36a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 29 Feb 2008 14:32:37 +0100 Subject: Fix typos, avoid DEPEND_LIST from growing with empty elements. (This used to be commit b30fd477ff0d97bb4de3c5301a6cdc47867451ee) --- source4/build/smb_build/makefile.pm | 4 ++-- source4/build/smb_build/output.pm | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 06f9d4b194..5fe0e68e95 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -253,7 +253,7 @@ sub SharedLibrary($$) # $ctx->{RESULT_SHARED_LIBRARY}: \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST) \@echo Linking \$\@ - \@mkdir -p \$(D@) + \@mkdir -p \$(\@D) \@\$(SHLD) \$(LDFLAGS) \$(SHLD_FLAGS) \$(INTERN_LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\ \$($ctx->{NAME}\_FULL_OBJ_LIST) \\ \$($ctx->{NAME}_LINK_FLAGS) \\ @@ -274,7 +274,7 @@ sub MergedObj($$) # $ctx->{RESULT_MERGED_OBJ}: \$($ctx->{NAME}_OBJ_LIST) \@echo Partially linking \$@ - \@mkdir -p \$(D@) + \@mkdir -p \$(\@D) \$(PARTLINK) -o \$@ \$($ctx->{NAME}_OBJ_LIST) __EOD__ diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index ff9afe8e8c..4ae4a62cf4 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -101,9 +101,6 @@ sub generate_merged_obj($) $lib->{MERGED_OBJNAME} = lc($link_name).".o"; $lib->{RESULT_MERGED_OBJ} = $lib->{OUTPUT_MERGED_OBJ} = "bin/mergedobj/$lib->{MERGED_OBJNAME}"; $lib->{TARGET_MERGED_OBJ} = $lib->{RESULT_MERGED_OBJ}; - } else { - $lib->{TARGET_MERGED_OBJ} = ""; - $lib->{RESULT_MERGED_OBJ} = ""; } } @@ -124,10 +121,6 @@ sub generate_static_library($) $lib->{TARGET_STATIC_LIBRARY} = $lib->{RESULT_STATIC_LIBRARY}; $lib->{STATICDIR} = 'bin/static'; $lib->{OUTPUT_STATIC_LIBRARY} = "-l".lc($link_name); - } else { - $lib->{RESULT_STATIC_LIBRARY} = ""; - $lib->{TARGET_STATIC_LIBRARY} = ""; - $lib->{OUTPUT_STATIC_LIBRARY} = ""; } } -- cgit From 489f66cd422453c00afd14121fb61a41a6785249 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 29 Feb 2008 14:36:51 +0100 Subject: Change remaining prototype headers to be private. (This used to be commit 2f7ff409e89c9682e681ddcf54439db9e3b6ccb4) --- source4/build/smb_build/config_mk.pm | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm index 90e45124dc..d8ec646910 100644 --- a/source4/build/smb_build/config_mk.pm +++ b/source4/build/smb_build/config_mk.pm @@ -36,7 +36,6 @@ my $section_types = { "ENABLE" => "bool", - "PUBLIC_PROTO_HEADER" => "string", "PRIVATE_PROTO_HEADER" => "string", "CFLAGS" => "list", -- cgit From 3017c49fb3feedf8bb147247d5410ceb70a04f4e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 29 Feb 2008 14:43:54 +0100 Subject: Remove cruft that dealt with public prototype headers. (This used to be commit 438997c17951fa7f0a9fb14be14c3b364ed3ad90) --- source4/build/smb_build/main.pl | 3 +-- source4/build/smb_build/makefile.pm | 38 ++++++------------------------------- 2 files changed, 7 insertions(+), 34 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index 6c205a69f0..14f334a6ea 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -67,8 +67,7 @@ foreach my $key (values %$OUTPUT) { $key->{TYPE} eq "PYTHON") and grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); $mkenv->PythonFiles($key) if defined($key->{PYTHON_FILES}); - $mkenv->ProtoHeader($key) if defined($key->{PRIVATE_PROTO_HEADER}) or - defined($key->{PUBLIC_PROTO_HEADER}); + $mkenv->ProtoHeader($key) if defined($key->{PRIVATE_PROTO_HEADER}); } foreach my $key (values %$OUTPUT) { diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 5fe0e68e95..9e728fa162 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -350,39 +350,13 @@ sub ProtoHeader($$) { my ($self,$ctx) = @_; - my $target = ""; - my $comment = "Creating "; - - my $priv = undef; - my $pub = undef; - - if (defined($ctx->{PRIVATE_PROTO_HEADER})) { - $priv = output::add_dir_str($ctx->{BASEDIR}, $ctx->{PRIVATE_PROTO_HEADER}); - $target .= $priv; - $comment .= $priv; - if (defined($ctx->{PUBLIC_PROTO_HEADER})) { - $comment .= " and "; - $target.= " "; - } - $self->output("PROTO_HEADERS += $priv\n"); - } else { - $ctx->{PRIVATE_PROTO_HEADER} = $ctx->{PUBLIC_PROTO_HEADER}; - $priv = output::add_dir_str($ctx->{BASEDIR}, $ctx->{PRIVATE_PROTO_HEADER}); - } - - if (defined($ctx->{PUBLIC_PROTO_HEADER})) { - $pub = output::add_dir_str($ctx->{BASEDIR}, $ctx->{PUBLIC_PROTO_HEADER}); - $comment .= $pub; - $target .= $pub; - $self->output("PROTO_HEADERS += $pub\n"); - } else { - $ctx->{PUBLIC_PROTO_HEADER} = $ctx->{PRIVATE_PROTO_HEADER}; - $pub = output::add_dir_str($ctx->{BASEDIR}, $ctx->{PUBLIC_PROTO_HEADER}); - } + my $priv = output::add_dir_str($ctx->{BASEDIR}, $ctx->{PRIVATE_PROTO_HEADER}); + $self->output("PROTO_HEADERS += $priv\n"); - $self->output("$pub: $ctx->{MK_FILE} \$($ctx->{NAME}_OBJ_LIST:.o=.c) \$(srcdir)/script/mkproto.pl\n"); - $self->output("\t\@echo \"$comment\"\n"); - $self->output("\t\@\$(PERL) \$(srcdir)/script/mkproto.pl --srcdir=\$(srcdir) --builddir=\$(builddir) --private=$priv --public=$pub \$($ctx->{NAME}_OBJ_LIST)\n\n"); + $self->output("$priv: $ctx->{MK_FILE} \$($ctx->{NAME}_OBJ_LIST:.o=.c) \$(srcdir)/script/mkproto.pl\n"); + $self->output("\t\@echo \"Creating \$@\"\n"); + $self->output("\t\@mkdir -p \$(\@D)\n"); + $self->output("\t\@\$(PERL) \$(srcdir)/script/mkproto.pl --srcdir=\$(srcdir) --builddir=\$(builddir) --all=\$@ \$($ctx->{NAME}_OBJ_LIST)\n\n"); } sub write($$) -- cgit From 4453348aed08e9d164454a8660081b5c177cd44b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 25 Feb 2008 18:29:04 +0100 Subject: Include CFLAGS overrides in make file. (This used to be commit 2ead1523608d9cd9a58cf55bcee2c8a39b6895e0) --- source4/build/smb_build/cflags.pm | 67 ------------------------------------- source4/build/smb_build/main.pl | 5 +-- source4/build/smb_build/makefile.pm | 53 +++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 71 deletions(-) delete mode 100755 source4/build/smb_build/cflags.pm (limited to 'source4/build') diff --git a/source4/build/smb_build/cflags.pm b/source4/build/smb_build/cflags.pm deleted file mode 100755 index ad6cd42c65..0000000000 --- a/source4/build/smb_build/cflags.pm +++ /dev/null @@ -1,67 +0,0 @@ -# SMB Build System -# -# Copyright (C) Jelmer Vernooij 2006 -# Released under the GNU GPL - -package cflags; -use strict; - -my $sort_available = eval "use sort 'stable'; return 1;"; -$sort_available = 0 unless defined($sort_available); - -sub by_path { - return 1 if($a =~ m#^\-I/#); - return -1 if($b =~ m#^\-I/#); - return 0; -} - -sub create_cflags($$$$) { - my $CTX = shift; - my $srcdir = shift; - my $builddir = shift; - my $file = shift; - - open(CFLAGS_TXT,">$file") || die ("Can't open `$file'\n"); - - my $src_ne_build = ($srcdir ne $builddir) ? 1 : 0; - - foreach my $key (values %{$CTX}) { - next unless defined ($key->{OBJ_LIST}); - next unless defined ($key->{FINAL_CFLAGS}); - next unless (@{$key->{FINAL_CFLAGS}} > 0); - - my @sorted_cflags = @{$key->{FINAL_CFLAGS}}; - if ($sort_available) { - @sorted_cflags = sort by_path @{$key->{FINAL_CFLAGS}}; - } - - # Rewrite CFLAGS so that both the source and the build - # directories are in the path. - my @cflags = (); - foreach my $flag (@sorted_cflags) { - if($src_ne_build) { - if($flag =~ m#^-I([^/].*$)#) { - my $dir = $1; - $dir =~ s#^\$\((?:src|build)dir\)/?##; - push(@cflags, "-I$builddir/$dir", "-I$srcdir/$dir"); - next; - } - } - push(@cflags, $flag); - } - - my $cflags = join(' ', @cflags); - - foreach (@{$key->{OBJ_LIST}}) { - my $ofile = $_; - my $dfile = $_; - $dfile =~ s/\.o$/.d/; - $dfile =~ s/\.ho$/.d/; - print CFLAGS_TXT "$ofile $dfile: CFLAGS+= $cflags\n"; - } - } - close(CFLAGS_TXT); - - print __FILE__.": creating $file\n"; -} -1; diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index 14f334a6ea..7312749f28 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -10,7 +10,6 @@ use smb_build::header; use smb_build::input; use smb_build::config_mk; use smb_build::output; -use smb_build::cflags; use smb_build::summary; use smb_build::config; use strict; @@ -68,6 +67,7 @@ foreach my $key (values %$OUTPUT) { grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); $mkenv->PythonFiles($key) if defined($key->{PYTHON_FILES}); $mkenv->ProtoHeader($key) if defined($key->{PRIVATE_PROTO_HEADER}); + $mkenv->CFlags($key); } foreach my $key (values %$OUTPUT) { @@ -84,9 +84,6 @@ foreach my $key (values %$OUTPUT) { $mkenv->write("data.mk"); header::create_smb_build_h($OUTPUT, "include/build.h"); -cflags::create_cflags($OUTPUT, $config::config{srcdir}, - $config::config{builddir}, "extra_cflags.txt"); - summary::show($OUTPUT, \%config::config); print "To build Samba, run $config::config{MAKE}\n"; diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 9e728fa162..902e8f7f42 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -398,4 +398,57 @@ endif print __FILE__.": creating $file\n"; } +my $sort_available = eval "use sort 'stable'; return 1;"; +$sort_available = 0 unless defined($sort_available); + +sub by_path { + return 1 if($a =~ m#^\-I/#); + return -1 if($b =~ m#^\-I/#); + return 0; +} + +sub CFlags($$) +{ + my ($self, $key) = @_; + + my $srcdir = $self->{config}->{srcdir}; + my $builddir = $self->{config}->{builddir}; + + my $src_ne_build = ($srcdir ne $builddir) ? 1 : 0; + + return unless defined ($key->{OBJ_LIST}); + return unless defined ($key->{FINAL_CFLAGS}); + return unless (@{$key->{FINAL_CFLAGS}} > 0); + + my @sorted_cflags = @{$key->{FINAL_CFLAGS}}; + if ($sort_available) { + @sorted_cflags = sort by_path @{$key->{FINAL_CFLAGS}}; + } + + # Rewrite CFLAGS so that both the source and the build + # directories are in the path. + my @cflags = (); + foreach my $flag (@sorted_cflags) { + if($src_ne_build) { + if($flag =~ m#^-I([^/].*$)#) { + my $dir = $1; + $dir =~ s#^\$\((?:src|build)dir\)/?##; + push(@cflags, "-I$builddir/$dir", "-I$srcdir/$dir"); + next; + } + } + push(@cflags, $flag); + } + + my $cflags = join(' ', @cflags); + + foreach (@{$key->{OBJ_LIST}}) { + my $ofile = $_; + my $dfile = $_; + $dfile =~ s/\.o$/.d/; + $dfile =~ s/\.ho$/.d/; + $self->output("$ofile $dfile: CFLAGS+= $cflags\n"); + } +} + 1; -- cgit