1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

r12836: use: -fvisibility=hidden -D_PUBLIC_="__attribute__((visibility(\"default\")))"

if the compiler supports it, this will cause that modules can only access
public functions (gcc 4 supports this)

metze
(This used to be commit bcf4c36255)
This commit is contained in:
Stefan Metzmacher
2006-01-11 00:56:49 +00:00
committed by Gerald (Jerry) Carter
parent 2470034e54
commit eab4a56197
2 changed files with 21 additions and 2 deletions

View File

@ -116,6 +116,25 @@ AC_TRY_RUN([#include "${srcdir-.}/build/tests/trivial.c"],
AC_MSG_ERROR([cant find test code. Aborting config]),
AC_MSG_WARN([cannot run when cross-compiling]))
#
# Check if the compiler support ELF visibility for symbols
#
if test x"$GCC" = x"yes" ; then
AX_CFLAGS_GCC_OPTION([-fvisibility=hidden], VISIBILITY_CFLAGS)
fi
if test -n "$VISIBILITY_CFLAGS"; then
OLD_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} ${VISIBILITY_CFLAGS} -D_PUBLIC_=__attribute__((visibility(\"default\")))"
VISIBILITY_CFLAGS="${VISIBILITY_CFLAGS} -D_PUBLIC_=\"__attribute__((visibility(\\\"default\\\")))\""
AC_MSG_CHECKING([that the C compiler can use the VISIBILITY_CFLAGS])
AC_TRY_RUN([
_PUBLIC_ void vis_foo1(void) {}
__attribute__((visibility("default"))) void vis_foo2(void) {}
#include "${srcdir-.}/build/tests/trivial.c"
], AC_MSG_RESULT(yes), [AC_MSG_RESULT(no);VISIBILITY_CFLAGS=""])
CFLAGS="${OLD_CFLAGS}"
fi
#
# Check if the compiler can handle the options we selected by
# --enable-*developer

View File

@ -53,8 +53,8 @@ if test "${ac_cv_prog_CC}" = "insure"; then
fi
#################################################
# add DEVELOPER_CFLAGS only for the real build
CFLAGS="${CFLAGS} ${DEVELOPER_CFLAGS}"
# add *_CFLAGS only for the real build
CFLAGS="${CFLAGS} ${VISIBILITY_CFLAGS} ${DEVELOPER_CFLAGS}"
#################################################
# final configure stuff