summaryrefslogtreecommitdiff
path: root/source4/build/smb_build
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-03-06 21:14:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:52:20 -0500
commitce3032cab82fd66ddfd4d55d7cc242aff80be161 (patch)
tree7a13b9a20a34ef79c17abc38cc9752149d94a5fc /source4/build/smb_build
parent148403594be03ab0ca8e396ef22cd01ef19921d5 (diff)
downloadsamba-ce3032cab82fd66ddfd4d55d7cc242aff80be161.tar.gz
samba-ce3032cab82fd66ddfd4d55d7cc242aff80be161.tar.bz2
samba-ce3032cab82fd66ddfd4d55d7cc242aff80be161.zip
r13898: Add a subsystem-specific DEFAULT_VISIBILITY property that can be used
to not export symbols when building shared libraries. Symbols that have to be available to users of the library can be explicitly exported by prepending them with _PUBLIC_ in the C source. (This used to be commit ea9988dfda6df09f1ee8f9aea1dc5b96fff52ee6)
Diffstat (limited to 'source4/build/smb_build')
-rw-r--r--source4/build/smb_build/TODO7
-rwxr-xr-xsource4/build/smb_build/cflags.pm1
-rw-r--r--source4/build/smb_build/config_mk.pm6
-rw-r--r--source4/build/smb_build/input.pm8
-rw-r--r--source4/build/smb_build/main.pl2
-rw-r--r--source4/build/smb_build/output.pm9
6 files changed, 23 insertions, 10 deletions
diff --git a/source4/build/smb_build/TODO b/source4/build/smb_build/TODO
index 0657eb2bc8..ca057cd543 100644
--- a/source4/build/smb_build/TODO
+++ b/source4/build/smb_build/TODO
@@ -1,11 +1,6 @@
-- split up proto.h into headers with public or private prototypes.
- Public prototypes can be marked with _PUBLIC_ in the source
- - get rid of include/structs.h
-- install Samba-specific headers in $INCLUDEDIR/samba-4.0. talloc.h, tdb.h and
- ldb.h belong in $INCLUDEDIR
+- get rid of include/structs.h
- add register function to smbtorture
- install shared modules
- improve (un)install scripts (rewrite in perl?)
- proper #include dependencies
- determine dependencies from #include lines ?
-- clean up include/smb.h
diff --git a/source4/build/smb_build/cflags.pm b/source4/build/smb_build/cflags.pm
index a19c0efa7b..2cf6453841 100755
--- a/source4/build/smb_build/cflags.pm
+++ b/source4/build/smb_build/cflags.pm
@@ -15,6 +15,7 @@ sub create_cflags($$)
foreach my $key (values %{$CTX}) {
next unless defined ($key->{OBJ_LIST});
next unless defined ($key->{EXTRA_CFLAGS});
+ next if ($key->{EXTRA_CFLAGS} eq "");
foreach (@{$key->{OBJ_LIST}}) {
print CFLAGS_TXT "$_: $key->{EXTRA_CFLAGS}\n";
diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm
index 56960f044c..d9e2cd31b7 100644
--- a/source4/build/smb_build/config_mk.pm
+++ b/source4/build/smb_build/config_mk.pm
@@ -35,6 +35,8 @@ my $section_types = {
"PUBLIC_HEADERS" => "list",
"EXTRA_CFLAGS" => "string",
+
+ "DEFAULT_VISIBILITY" => "string"
},
"MODULE" => {
"SUBSYSTEM" => "string",
@@ -92,7 +94,9 @@ my $section_types = {
"PUBLIC_PROTO_HEADER" => "string",
"PRIVATE_PROTO_HEADER" => "string",
- "EXTRA_CFLAGS" => "string"
+ "EXTRA_CFLAGS" => "string",
+
+ "DEFAULT_VISIBILITY" => "string"
}
};
diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm
index fbeeddcda1..0499d62565 100644
--- a/source4/build/smb_build/input.pm
+++ b/source4/build/smb_build/input.pm
@@ -154,6 +154,14 @@ sub check($$$$$)
if (defined($part->{PRIVATE_PROTO_HEADER})) {
$part->{NOPROTO} = "YES";
}
+
+ unless (defined($part->{DEFAULT_VISIBILITY})) {
+ $part->{DEFAULT_VISIBILITY} = "default";
+ }
+
+ unless (defined($part->{EXTRA_CFLAGS})) {
+ $part->{EXTRA_CFLAGS} = "";
+ }
if (defined($part->{PUBLIC_PROTO_HEADER})) {
$part->{NOPROTO} = "YES";
diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl
index a47899a3a5..83befe7c67 100644
--- a/source4/build/smb_build/main.pl
+++ b/source4/build/smb_build/main.pl
@@ -57,7 +57,7 @@ if (defined($ENV{"MODULE_OUTPUT_TYPE"})) {
my $DEPEND = smb_build::input::check($INPUT, \%config::enabled,
$subsystem_output_type, $library_output_type, $module_output_type);
-my $OUTPUT = output::create_output($DEPEND);
+my $OUTPUT = output::create_output($DEPEND, \%config::config);
$config::config{SUBSYSTEM_OUTPUT_TYPE} = $subsystem_output_type;
$config::config{LIBRARY_OUTPUT_TYPE} = $library_output_type;
$config::config{MODULE_OUTPUT_TYPE} = $module_output_type;
diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm
index 2fa8e0207a..6b3753aa9f 100644
--- a/source4/build/smb_build/output.pm
+++ b/source4/build/smb_build/output.pm
@@ -92,9 +92,9 @@ sub generate_binary($)
$bin->{BINARY} = $bin->{NAME};
}
-sub create_output($)
+sub create_output($$)
{
- my $depend = shift;
+ my ($depend, $config) = @_;
my $part;
foreach $part (values %{$depend}) {
@@ -111,6 +111,11 @@ sub create_output($)
$part->{OUTPUT_TYPE} = "OBJLIST";
}
+ if ($part->{DEFAULT_VISIBILITY} ne "default" and
+ $config->{visibility_attribute} eq "yes") {
+ $part->{EXTRA_CFLAGS} .= " -fvisibility=$part->{DEFAULT_VISIBILITY}";
+ }
+
generate_binary($part) if $part->{OUTPUT_TYPE} eq "BINARY";
generate_mergedobj($part) if $part->{OUTPUT_TYPE} eq "MERGEDOBJ";
generate_objlist($part) if $part->{OUTPUT_TYPE} eq "OBJLIST";