The branch, v4-0-test has been updated
       via  b57f09f526f0783345be3d1de2540c35478d7af2 (commit)
       via  f97cce2522e7644181506dc49947297b394743eb (commit)
       via  2ead1523608d9cd9a58cf55bcee2c8a39b6895e0 (commit)
       via  438997c17951fa7f0a9fb14be14c3b364ed3ad90 (commit)
       via  2f7ff409e89c9682e681ddcf54439db9e3b6ccb4 (commit)
      from  b30fd477ff0d97bb4de3c5301a6cdc47867451ee (commit)

http://gitweb.samba.org/?samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit b57f09f526f0783345be3d1de2540c35478d7af2
Author: Jelmer Vernooij <[EMAIL PROTECTED]>
Date:   Fri Feb 29 15:06:05 2008 +0100

    Fix dynconfig compilation.

commit f97cce2522e7644181506dc49947297b394743eb
Author: Jelmer Vernooij <[EMAIL PROTECTED]>
Date:   Mon Feb 25 15:39:46 2008 +0100

    Remove the now unused cflags script.

commit 2ead1523608d9cd9a58cf55bcee2c8a39b6895e0
Author: Jelmer Vernooij <[EMAIL PROTECTED]>
Date:   Mon Feb 25 18:29:04 2008 +0100

    Include CFLAGS overrides in make file.

commit 438997c17951fa7f0a9fb14be14c3b364ed3ad90
Author: Jelmer Vernooij <[EMAIL PROTECTED]>
Date:   Fri Feb 29 14:43:54 2008 +0100

    Remove cruft that dealt with public prototype headers.

commit 2f7ff409e89c9682e681ddcf54439db9e3b6ccb4
Author: Jelmer Vernooij <[EMAIL PROTECTED]>
Date:   Fri Feb 29 14:36:51 2008 +0100

    Change remaining prototype headers to be private.

-----------------------------------------------------------------------

Summary of changes:
 source/Makefile                     |    1 +
 source/auth/config.mk               |    6 +-
 source/build/smb_build/cflags.pm    |   67 -------------------------
 source/build/smb_build/config_mk.pm |    1 -
 source/build/smb_build/main.pl      |    8 +--
 source/build/smb_build/makefile.pm  |   91 ++++++++++++++++++++++------------
 source/dsdb/config.mk               |    2 +-
 source/dynconfig.mk                 |    4 +-
 source/lib/util/config.mk           |    6 +-
 source/libcli/ldap/config.mk        |    2 +-
 source/param/config.mk              |    2 +-
 source/rules.mk                     |   16 ++----
 source/script/cflags.pl             |   42 ----------------
 13 files changed, 78 insertions(+), 170 deletions(-)
 delete mode 100755 source/build/smb_build/cflags.pm
 delete mode 100755 source/script/cflags.pl


Changeset truncated at 500 lines:

diff --git a/source/Makefile b/source/Makefile
index 1fddfef..f9a753e 100644
--- a/source/Makefile
+++ b/source/Makefile
@@ -23,6 +23,7 @@ default: all
 
 include rules.mk
 include data.mk
+include extra_cflags.txt
 
 DEFAULT_HEADERS = $(srcdir)/lib/util/dlinklist.h \
                  $(srcdir)/version.h
diff --git a/source/auth/config.mk b/source/auth/config.mk
index 7a6ca05..369c5bb 100644
--- a/source/auth/config.mk
+++ b/source/auth/config.mk
@@ -6,14 +6,14 @@ mkinclude credentials/config.mk
 
 [SUBSYSTEM::auth_session]
 OBJ_FILES = session.o
-PUBLIC_PROTO_HEADER = session_proto.h
+PRIVATE_PROTO_HEADER = session_proto.h
 PUBLIC_DEPENDENCIES = CREDENTIALS
 
 PUBLIC_HEADERS += auth/session.h
 
 [SUBSYSTEM::auth_system_session]
 OBJ_FILES = system_session.o
-PUBLIC_PROTO_HEADER = system_session_proto.h
+PRIVATE_PROTO_HEADER = system_session_proto.h
 PUBLIC_DEPENDENCIES = CREDENTIALS
 PRIVATE_DEPENDENCIES = auth_session LIBSAMBA-UTIL LIBSECURITY 
 
@@ -82,7 +82,7 @@ OBJ_FILES = pam_errors.o
 [SUBSYSTEM::auth]
 #VERSION = 0.0.1
 #SO_VERSION = 0
-PUBLIC_PROTO_HEADER = auth_proto.h
+PRIVATE_PROTO_HEADER = auth_proto.h
 OBJ_FILES = \
                auth.o \
                auth_util.o \
diff --git a/source/build/smb_build/cflags.pm b/source/build/smb_build/cflags.pm
deleted file mode 100755
index ad6cd42..0000000
--- a/source/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/source/build/smb_build/config_mk.pm 
b/source/build/smb_build/config_mk.pm
index 90e4512..d8ec646 100644
--- a/source/build/smb_build/config_mk.pm
+++ b/source/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",
diff --git a/source/build/smb_build/main.pl b/source/build/smb_build/main.pl
index 6c205a6..7312749 100644
--- a/source/build/smb_build/main.pl
+++ b/source/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;
@@ -67,8 +66,8 @@ 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});
+       $mkenv->CFlags($key);
 }
 
 foreach my $key (values %$OUTPUT) {
@@ -85,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/source/build/smb_build/makefile.pm 
b/source/build/smb_build/makefile.pm
index 5fe0e68..902e8f7 100644
--- a/source/build/smb_build/makefile.pm
+++ b/source/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("[EMAIL PROTECTED] \"$comment\"\n");
-       $self->output("[EMAIL PROTECTED](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("[EMAIL PROTECTED] \"Creating [EMAIL PROTECTED]"\n");
+       $self->output("[EMAIL PROTECTED] -p \$([EMAIL PROTECTED])\n");
+       $self->output("[EMAIL PROTECTED](PERL) \$(srcdir)/script/mkproto.pl 
--srcdir=\$(srcdir) --builddir=\$(builddir) --all=\$@ 
\$($ctx->{NAME}_OBJ_LIST)\n\n");
 }
 
 sub write($$)
@@ -424,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;
diff --git a/source/dsdb/config.mk b/source/dsdb/config.mk
index 82119c2..fb8cd4f 100644
--- a/source/dsdb/config.mk
+++ b/source/dsdb/config.mk
@@ -20,7 +20,7 @@ OBJ_FILES = \
 PUBLIC_HEADERS += dsdb/samdb/samdb.h
 
 [SUBSYSTEM::SAMDB_COMMON]
-PUBLIC_PROTO_HEADER = common/proto.h
+PRIVATE_PROTO_HEADER = common/proto.h
 PRIVATE_DEPENDENCIES = LIBLDB
 OBJ_FILES = \
                common/sidmap.o \
diff --git a/source/dynconfig.mk b/source/dynconfig.mk
index e970d4c..aa0565c 100644
--- a/source/dynconfig.mk
+++ b/source/dynconfig.mk
@@ -21,5 +21,5 @@ PATH_FLAGS = -DCONFIGFILE=\"$(CONFIGFILE)\" \
 
 dynconfig.o: dynconfig.c Makefile
        @echo Compiling $<
-       @$(CC) $(CFLAGS) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] 
$(CPPFLAGS) $(PICFLAG) \
-               $(PATH_FLAGS) -c $(FIRST_PREREQ) -o $@
+       @$(CC) $(CFLAGS) $(CPPFLAGS) $(PICFLAG) \
+               $(PATH_FLAGS) -c $< -o $@
diff --git a/source/lib/util/config.mk b/source/lib/util/config.mk
index e057340..16a0357 100644
--- a/source/lib/util/config.mk
+++ b/source/lib/util/config.mk
@@ -47,7 +47,7 @@ OBJ_FILES = unix_privs.o
 ################################################
 # Start SUBSYSTEM WRAP_XATTR
 [SUBSYSTEM::WRAP_XATTR]
-PUBLIC_PROTO_HEADER = wrap_xattr.h
+PRIVATE_PROTO_HEADER = wrap_xattr.h
 OBJ_FILES = \
                wrap_xattr.o
 PUBLIC_DEPENDENCIES = XATTR
@@ -56,13 +56,13 @@ PUBLIC_DEPENDENCIES = XATTR
 ################################################
 
 [SUBSYSTEM::UTIL_TDB]
-PUBLIC_PROTO_HEADER = util_tdb.h
+PRIVATE_PROTO_HEADER = util_tdb.h
 OBJ_FILES = \
                util_tdb.o
 PUBLIC_DEPENDENCIES = LIBTDB
 
 [SUBSYSTEM::UTIL_LDB]
-PUBLIC_PROTO_HEADER = util_ldb.h
+PRIVATE_PROTO_HEADER = util_ldb.h
 OBJ_FILES = \
                        util_ldb.o
 PUBLIC_DEPENDENCIES = LIBLDB
diff --git a/source/libcli/ldap/config.mk b/source/libcli/ldap/config.mk
index 9b0dc1a..bcdedd3 100644
--- a/source/libcli/ldap/config.mk
+++ b/source/libcli/ldap/config.mk
@@ -13,6 +13,6 @@ PRIVATE_DEPENDENCIES = LIBCLI_COMPOSITE samba-socket NDR_SAMR 
LIBTLS ASN1_UTIL \
 PUBLIC_HEADERS += libcli/ldap/ldap.h
 
 [SUBSYSTEM::LDAP_ENCODE]
-PUBLIC_PROTO_HEADER = ldap_ndr.h
+PRIVATE_PROTO_HEADER = ldap_ndr.h
 OBJ_FILES = ldap_ndr.o
 # FIXME PRIVATE_DEPENDENCIES = LIBLDB
diff --git a/source/param/config.mk b/source/param/config.mk
index aa75253..f43c9d8 100644
--- a/source/param/config.mk
+++ b/source/param/config.mk
@@ -6,7 +6,7 @@ OBJ_FILES = loadparm.o \
                        ../lib/version.o
 PUBLIC_DEPENDENCIES = LIBSAMBA-UTIL 
 PRIVATE_DEPENDENCIES = DYNCONFIG LIBREPLACE_EXT CHARSET
-PUBLIC_PROTO_HEADER = proto.h
+PRIVATE_PROTO_HEADER = proto.h
 
 PUBLIC_HEADERS += param/param.h
 
diff --git a/source/rules.mk b/source/rules.mk
index b644a6a..d0be997 100644
--- a/source/rules.mk
+++ b/source/rules.mk
@@ -1,33 +1,27 @@
 # Dependencies command
 DEPENDS = $(CC) -M -MG -MP -MT $(<:.c=.o) -MT $@ \
-    $(CFLAGS) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] \
-    $(CPPFLAGS) $< -o $@
+    $(CFLAGS) $(CPPFLAGS) $< -o $@
 # Dependencies for host objects
 HDEPENDS = $(CC) -M -MG -MP -MT $(<:.c=.ho) -MT $@ \
-    $(HOSTCC_FLAGS) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] \
-    $(CPPFLAGS) $< -o $@
+    $(HOSTCC_FLAGS) $(CPPFLAGS) $< -o $@
 # Dependencies for precompiled headers
 PCHDEPENDS = $(CC) -M -MG -MT include/includes.h.gch -MT $@ \
     $(CFLAGS) $(CPPFLAGS) $< -o $@
 
 # Run a static analysis checker
-CHECK = $(CC_CHECKER) $(CFLAGS) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL 
PROTECTED] \
-    $(PICFLAG) $(CPPLAGS) -c $< -o $@
+CHECK = $(CC_CHECKER) $(CFLAGS) $(PICFLAG) $(CPPLAGS) -c $< -o $@
 
 # Run the configured compiler
 COMPILE = $(CC) $(CFLAGS) $(PICFLAG) \
-          `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] \
                  $(CPPFLAGS) \
                  -c $< -o $@
 
 # Run the compiler for the build host
-HCOMPILE = $(HOSTCC) $(HOSTCC_FLAGS) `$(PERL) $(srcdir)/script/cflags.pl 
[EMAIL PROTECTED] \
-        $(CPPFLAGS) -c $< -o $@
+HCOMPILE = $(HOSTCC) $(HOSTCC_FLAGS) $(CPPFLAGS) -c $< -o $@
 
 # Precompile headers
 PCHCOMPILE = @$(CC) -Ilib/replace \
-    $(CFLAGS) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] \
-    $(PICFLAG) $(CPPFLAGS) -c $< -o $@
+    $(CFLAGS) $(PICFLAG) $(CPPFLAGS) -c $< -o $@
 
 # Partial linking
 PARTLINK = @$(PROG_LD) -r
diff --git a/source/script/cflags.pl b/source/script/cflags.pl
deleted file mode 100755
index 37b5aa7..0000000
--- a/source/script/cflags.pl
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env perl
-
-# This is a hack to allow per target cflags. It isn't very elegant, but it
-# is the most portable idea we have come up with yet
-# [EMAIL PROTECTED], July 2005
-# [EMAIL PROTECTED], March 2006
-use strict;
-
-my $target = shift;
-
-my $vars = {};
-
-sub check_flags($$);
-sub check_flags($$)
-{
-       my ($path, $name)[EMAIL PROTECTED];
-       open (IN, $path);
-       foreach my $line (<IN>) {
-               if ($line =~ /^include (.*)$/) {
-                       check_flags($1, $name);
-               } elsif ($line =~ /^([A-Za-z0-9_]+) =(.*)$/) {
-                       $vars->{$1} = $2;
-               } elsif ($line =~ /^([^:]+): (.*)$/) {
-                       next unless (grep(/^$target$/, (split / /, $1)));
-                       my $data = $2;
-                       $data =~ s/^CFLAGS\+=//;
-                       foreach my $key (keys %$vars) {
-                               my $val = $vars->{$key};
-                               $data =~ s/\$\($key\)/$val/g;
-                       }
-                       # Remove undefined variables
-                       $data =~ s/\$\([A-Za-z0-9_]+\)//g;
-                       print "$data ";
-               }
-       }
-       close(IN);
-}
-
-check_flags("extra_cflags.txt", $target);
-print "\n";
-
-exit 0;


-- 
Samba Shared Repository

Reply via email to