r13902: Stricter checking for the -fvisibility flag
authorJelmer Vernooij <jelmer@samba.org>
Mon, 6 Mar 2006 22:01:03 +0000 (22:01 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:52:21 +0000 (13:52 -0500)
Add two more proto headers.
(This used to be commit 0c95bf0cd33d8a6c35f692b796d7fbfd98b4d068)

source4/build/m4/check_cc.m4
source4/build/smb_build/output.pm
source4/lib/com/com.h
source4/lib/com/config.mk
source4/lib/com/dcom/dcom.h
source4/torture/com/simple.c
source4/web_server/config.mk
source4/web_server/web_server.h

index 33bb7050afa9d185623d4a5a0d8e3c3967b51a8b..72a882b7d8778c027138dcb0a10d6b10e510e7c3 100644 (file)
@@ -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)
 
 #
index 6b3753aa9faedaf69fd2935c3c9904bd151b95a6..bd2b3eeca9200341f36f78572afc79a00363f55f 100644 (file)
@@ -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}";
                }
 
index 0a26a568b0abedbcd272cf9d9832e1970db77782..c4dd872ff7f4e1f572cead8bedd2f2c5a5d49999 100644 (file)
@@ -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 */
index 6c668521a58a7856b279e456c75e709024c4d208..593316888562ff7850e181088abfa0d6e41f27f6 100644 (file)
@@ -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
index 41b155248e8b559e61516fbf07e3d8dc8445338b..308852848d413e94bb8c27bb7e66d96b72a4764e 100644 (file)
@@ -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;
index 5d3c6250c47bc643eeb60be9cbcd3698effffcc7..4e4f91c971dc674a8be4bf015cb7fd60de09ef53 100644 (file)
@@ -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"
 
index 0f6158e6ccc9c54281e15bf636ef57e8749b15e8..04f0266ecd07171cf027063d72a8f35fff903eb7 100644 (file)
@@ -3,6 +3,7 @@
 #######################
 # Start SUBSYSTEM WEB
 [SUBSYSTEM::WEB]
+PRIVATE_PROTO_HEADER = proto.h
 OBJ_FILES = \
                web_server.o \
                http.o
index f23a578206c898a3d38f1a86ba3c1de29b44e427..45617082e684f6e33d85953d87f1901e53506564 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 #include "smbd/process_model.h"
+#include "web_server/proto.h"
 
 /*
   context of one open web connection