summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-05-16 16:57:56 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:07:26 -0500
commitf344db9038f266a6ad5e555870f58c9474b213e1 (patch)
treeb361bb3461bc80bf568a1528a4c50ebe9c4ac407
parente1c7a38b2c6cea81892fe837581e6635df11e625 (diff)
downloadsamba-f344db9038f266a6ad5e555870f58c9474b213e1.tar.gz
samba-f344db9038f266a6ad5e555870f58c9474b213e1.tar.bz2
samba-f344db9038f266a6ad5e555870f58c9474b213e1.zip
r15642: add an '--always-create' option to mkproto.pl
with this the proto headers will be always regenerated, even if the content hasn't changed you can use currently by #>make MK_PROTO_ALWAYS_CREATE=yes' or #>export MK_PROTO_ALWAYS_CREATE=yes #>make metze (This used to be commit 248d56af9d8841a0953686c7f2c2fac60bb41595)
-rwxr-xr-xsource4/script/mkproto.pl13
1 files changed, 9 insertions, 4 deletions
diff --git a/source4/script/mkproto.pl b/source4/script/mkproto.pl
index c2dc547c12..682712b679 100755
--- a/source4/script/mkproto.pl
+++ b/source4/script/mkproto.pl
@@ -25,6 +25,7 @@ my $public_data = \$_public;
my $private_data = \$_private;
my $builddir = undef;
my $srcdir = undef;
+my $always_create = $ENV{MK_PROTO_ALWAYS_CREATE};
sub public($)
{
@@ -47,6 +48,9 @@ sub usage()
print " --define=DEF Use DEF to check whether header was already included\n";
print " --public-define=DEF Same as --define, but just for public header\n";
print " --private-define=DEF Same as --define, but just for private header\n";
+ print " --srcdir=path Read files relative to this directory\n";
+ print " --builddir=path Write file relative to this directory\n";
+ print " --always-create Always create new proto headers, even if the content hasn't changed\n";
print " --help Print this help message\n\n";
exit 0;
}
@@ -61,9 +65,10 @@ GetOptions(
},
'public-define=s' => \$public_define,
'private-define=s' => \$private_define,
- 'help' => \&usage,
+ 'srcdir=s' => sub { my ($f,$v) = @_; $srcdir = $v; },
'builddir=s' => sub { my ($f,$v) = @_; $builddir = $v; },
- 'srcdir=s' => sub { my ($f,$v) = @_; $srcdir = $v; }
+ 'always-create' => \$always_create,
+ 'help' => \&usage
) or exit(1);
if (not defined($public_define) and defined($public_file)) {
@@ -239,7 +244,7 @@ if (not defined($private_file) and defined($public_file)) {
my $old_public_data = file_load($public_file);
my $old_private_data = file_load($private_file);
-if (not defined($old_public_data) or ($old_public_data ne $$public_data))
+if (defined($always_create) or not defined($old_public_data) or ($old_public_data ne $$public_data))
{
mkpath(dirname($public_file), 0, 0755);
open(PUBLIC, ">$public_file") or die("Can't open `$public_file': $!");
@@ -247,7 +252,7 @@ if (not defined($old_public_data) or ($old_public_data ne $$public_data))
close(PUBLIC);
}
-if (($public_file ne $private_file) and (
+if (($public_file ne $private_file) and (defined($always_create) or
not defined($old_private_data) or ($old_private_data ne $$private_data))) {
mkpath(dirname($private_file), 0, 0755);