diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-03-06 22:01:03 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:52:21 -0500 |
commit | c389883ba2c93dfc11ac410a952f42f1065057d2 (patch) | |
tree | 316742e41486876c9eb2fe021f28a913aca55171 | |
parent | 9862fabead2f82ed0864c5de0dfe4f3bda4db7f5 (diff) | |
download | samba-c389883ba2c93dfc11ac410a952f42f1065057d2.tar.gz samba-c389883ba2c93dfc11ac410a952f42f1065057d2.tar.bz2 samba-c389883ba2c93dfc11ac410a952f42f1065057d2.zip |
r13902: Stricter checking for the -fvisibility flag
Add two more proto headers.
(This used to be commit 0c95bf0cd33d8a6c35f692b796d7fbfd98b4d068)
-rw-r--r-- | source4/build/m4/check_cc.m4 | 29 | ||||
-rw-r--r-- | source4/build/smb_build/output.pm | 4 | ||||
-rw-r--r-- | source4/lib/com/com.h | 3 | ||||
-rw-r--r-- | source4/lib/com/config.mk | 4 | ||||
-rw-r--r-- | source4/lib/com/dcom/dcom.h | 1 | ||||
-rw-r--r-- | source4/torture/com/simple.c | 1 | ||||
-rw-r--r-- | source4/web_server/config.mk | 1 | ||||
-rw-r--r-- | source4/web_server/web_server.h | 1 |
8 files changed, 29 insertions, 15 deletions
diff --git a/source4/build/m4/check_cc.m4 b/source4/build/m4/check_cc.m4 index 33bb7050af..72a882b7d8 100644 --- a/source4/build/m4/check_cc.m4 +++ b/source4/build/m4/check_cc.m4 @@ -115,18 +115,25 @@ AC_TRY_RUN([#include "${srcdir-.}/build/tests/trivial.c"], # # Check if the compiler support ELF visibility for symbols # + visibility_attribute=no -AC_MSG_CHECKING([whether the C compiler supports the visibility attribute]) -AC_TRY_RUN([ -#pragma GCC visibility push(hidden) -void vis_foo1(void) {} -__attribute__((visibility("default"))) void vis_foo2(void) {} -#include "${srcdir-.}/build/tests/trivial.c" -], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_VISIBILITY_ATTR,1,[Whether the C compiler supports the visibility attribute]) - visibility_attribute=yes -], [AC_MSG_RESULT(no);]) +if test x"$GCC" = x"yes" ; then + AX_CFLAGS_GCC_OPTION([-fvisibility=hidden], VISIBILITY_CFLAGS) +fi + +if test -n "$VISIBILITY_CFLAGS"; then + AC_MSG_CHECKING([whether the C compiler supports the visibility attribute]) + AC_TRY_RUN([ + #pragma GCC visibility push(hidden) + void vis_foo1(void) {} + __attribute__((visibility("default"))) void vis_foo2(void) {} + #include "${srcdir-.}/build/tests/trivial.c" + ], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_VISIBILITY_ATTR,1,[Whether the C compiler supports the visibility attribute]) + visibility_attribute=yes + ], [AC_MSG_RESULT(no);]) +fi AC_SUBST(visibility_attribute) # diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index 6b3753aa9f..bd2b3eeca9 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -111,8 +111,8 @@ sub create_output($$) $part->{OUTPUT_TYPE} = "OBJLIST"; } - if ($part->{DEFAULT_VISIBILITY} ne "default" and - $config->{visibility_attribute} eq "yes") { + if (($part->{DEFAULT_VISIBILITY} ne "default") and + ($config->{visibility_attribute} eq "yes")) { $part->{EXTRA_CFLAGS} .= " -fvisibility=$part->{DEFAULT_VISIBILITY}"; } diff --git a/source4/lib/com/com.h b/source4/lib/com/com.h index 0a26a568b0..c4dd872ff7 100644 --- a/source4/lib/com/com.h +++ b/source4/lib/com/com.h @@ -31,4 +31,7 @@ struct com_context typedef struct IUnknown *(*get_class_object_function) (const struct GUID *clsid); + +#include "lib/com/proto.h" + #endif /* _COM_H */ diff --git a/source4/lib/com/config.mk b/source4/lib/com/config.mk index 6c668521a5..5933168885 100644 --- a/source4/lib/com/config.mk +++ b/source4/lib/com/config.mk @@ -1,12 +1,12 @@ [SUBSYSTEM::COM] -PRIVATE_PROTO_HEADER = com_proto.h +PRIVATE_PROTO_HEADER = proto.h OBJ_FILES = \ tables.o \ rot.o \ main.o [SUBSYSTEM::DCOM] -PRIVATE_PROTO_HEADER = dcom_proto.h +PRIVATE_PROTO_HEADER = dcom/proto.h OBJ_FILES = \ dcom/main.o \ dcom/tables.o diff --git a/source4/lib/com/dcom/dcom.h b/source4/lib/com/dcom/dcom.h index 41b155248e..308852848d 100644 --- a/source4/lib/com/dcom/dcom.h +++ b/source4/lib/com/dcom/dcom.h @@ -22,6 +22,7 @@ #define _DCOM_H #include "lib/com/com.h" +#include "lib/com/dcom/proto.h" struct dcom_client_context { struct cli_credentials *credentials; diff --git a/source4/torture/com/simple.c b/source4/torture/com/simple.c index 5d3c6250c4..4e4f91c971 100644 --- a/source4/torture/com/simple.c +++ b/source4/torture/com/simple.c @@ -21,6 +21,7 @@ #include "includes.h" #include "lib/com/com.h" +#include "lib/com/dcom/dcom.h" #include "librpc/gen_ndr/com_dcom.h" #include "lib/cmdline/popt_common.h" diff --git a/source4/web_server/config.mk b/source4/web_server/config.mk index 0f6158e6cc..04f0266ecd 100644 --- a/source4/web_server/config.mk +++ b/source4/web_server/config.mk @@ -3,6 +3,7 @@ ####################### # Start SUBSYSTEM WEB [SUBSYSTEM::WEB] +PRIVATE_PROTO_HEADER = proto.h OBJ_FILES = \ web_server.o \ http.o diff --git a/source4/web_server/web_server.h b/source4/web_server/web_server.h index f23a578206..45617082e6 100644 --- a/source4/web_server/web_server.h +++ b/source4/web_server/web_server.h @@ -19,6 +19,7 @@ */ #include "smbd/process_model.h" +#include "web_server/proto.h" /* context of one open web connection |