Commit 9e24b9c7 authored by Yang Tse's avatar Yang Tse
Browse files

build adjustments: CURL_HIDDEN_SYMBOLS no longer defined in config files

configure script now provides conditional definitions for Makefile.am
that result in CURL_HIDDEN_SYMBOLS being defined by resulting makefiles
when appropriate.

Additionally, configure script option for symbol hiding control is now
named --enable-symbol-hiding --disable-symbol-hiding. While still valid,
old option name --enable-hidden-symbols --disable-hidden-symbols will
be deprecated in some future release.
parent a144bb8b
Loading
Loading
Loading
Loading
+4 −41
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ CURL_CHECK_OPTION_OPTIMIZE
CURL_CHECK_OPTION_WARNINGS
CURL_CHECK_OPTION_WERROR
CURL_CHECK_OPTION_CURLDEBUG
CURL_CHECK_OPTION_SYMBOL_HIDING
CURL_CHECK_OPTION_ARES

CURL_CHECK_PATH_SEPARATOR_REQUIRED
@@ -299,6 +300,7 @@ fi

CURL_CHECK_COMPILER_HALT_ON_ERROR
CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
CURL_CHECK_COMPILER_SYMBOL_HIDING

CURL_CHECK_NO_UNDEFINED
AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
@@ -3060,48 +3062,9 @@ AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
)

dnl ************************************************************
dnl Enable hiding of internal symbols in library to reduce its size and
dnl speed dynamic linking of applications.  This currently is only supported
dnl on gcc >= 4.0 and SunPro C.
dnl hiding of library internal symbols
dnl
AC_MSG_CHECKING([whether to enable hidden symbols in the library])
AC_ARG_ENABLE(hidden-symbols,
AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library])
AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]),
[ case "$enableval" in
  no)
       AC_MSG_RESULT(no)
       ;;
  *)
       AC_MSG_CHECKING([whether $CC supports it])
       if test "$GCC" = yes ; then
         if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ||
           dnl clang always supports -fvisibility= but it doesn't show up
           dnl under --help.
           test "$compiler_id" = "CLANG"; then
           AC_MSG_RESULT(yes)
           AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
           AC_DEFINE(CURL_EXTERN_SYMBOL, [__attribute__ ((visibility ("default")))], [to make a symbol visible])
           CFLAGS="$CFLAGS -fvisibility=hidden"
         else
            AC_MSG_RESULT(no)
          fi

       else
         dnl Test for SunPro cc
         if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then
           AC_MSG_RESULT(yes)
           AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
           AC_DEFINE(CURL_EXTERN_SYMBOL, [__global], [to make a symbol visible])
           CFLAGS="$CFLAGS -xldscope=hidden"
         else
           AC_MSG_RESULT(no)
         fi
       fi
       ;;
  esac ],
       AC_MSG_RESULT(no)
)
CURL_CONFIGURE_SYMBOL_HIDING

dnl ************************************************************
dnl enforce SONAME bump
+11 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ LIBCURL_LIBS = @LIBCURL_LIBS@
# This might hold -Werror
CFLAGS += @CURL_CFLAG_EXTRAS@

CFLAG_SYMBOL_HIDING = @CFLAG_SYMBOL_HIDING@

# Specify our include paths here, and do it relative to $(top_srcdir) and
# $(top_builddir), to ensure that these paths which belong to the library
# being currently built and tested are searched before the library which
@@ -134,6 +136,14 @@ endif

libcurl_la_LDFLAGS = $(UNDEF) $(VERSIONINFO) $(MIMPURE) $(VERSIONED_SYMBOLS) $(LIBCURL_LIBS)

if DOING_SYMBOL_HIDING
libcurl_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_HIDDEN_SYMBOLS
libcurl_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_SYMBOL_HIDING)
else
libcurl_la_CPPFLAGS = $(AM_CPPFLAGS)
libcurl_la_CFLAGS = $(AM_CFLAGS)
endif

# unit testing static library built only along with unit tests
if BUILD_UNITTESTS
noinst_LTLIBRARIES = libcurlu.la
@@ -143,6 +153,7 @@ endif

libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DUNITTESTS
libcurlu_la_LDFLAGS = -static $(LIBCURL_LIBS)
libcurlu_la_CFLAGS = $(AM_CFLAGS)

# Makefile.inc provides the CSOURCES and HHEADERS defines
include Makefile.inc
+9 −8
Original line number Diff line number Diff line
/* ================================================================ */
/*    lib/config-os400.h - Hand crafted config file for OS/400      */
/* ================================================================ */
#ifndef HEADER_CURL_CONFIG_OS400_H
#define HEADER_CURL_CONFIG_OS400_H
/***************************************************************************
 *                                  _   _ ____  _
 *  Project                     ___| | | |  _ \| |
@@ -8,7 +7,7 @@
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
 * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution. The terms
@@ -23,6 +22,10 @@
 *
 ***************************************************************************/

/* ================================================================ */
/*                Hand crafted config file for OS/400               */
/* ================================================================ */

#pragma enum(int)

#undef PACKAGE
@@ -434,10 +437,7 @@
/* To disable LDAP */
#undef CURL_DISABLE_LDAP

/* To avoid external use of library hidden symbols */
#define CURL_HIDDEN_SYMBOLS

/* External symbols need no special keyword. */
/* Definition to make a library symbol externally visible. */
#define CURL_EXTERN_SYMBOL

/* Define if you have the ldap_url_parse procedure. */
@@ -542,3 +542,4 @@
#define qadrt_use_fread_inline         /* Generate fread() wrapper inline. */
#define qadrt_use_fwrite_inline        /* Generate fwrite() wrapper inline. */

#endif /* HEADER_CURL_CONFIG_OS400_H */
+2 −5
Original line number Diff line number Diff line
@@ -65,11 +65,8 @@
/* to disable verbose strings */
/* #define CURL_DISABLE_VERBOSE_STRINGS 1*/

/* to make a symbol visible */
/*#define CURL_EXTERN_SYMBOL  __declspec(dllexport)*/

/* to enable hidden symbols */
/*#define CURL_HIDDEN_SYMBOLS 1*/
/* Definition to make a library symbol externally visible. */
/* #undef CURL_EXTERN_SYMBOL */

/* Use Windows LDAP implementation */
/* #undef CURL_LDAP_WIN */
+1 −4
Original line number Diff line number Diff line
@@ -71,12 +71,9 @@
/* to disable verbose strings */
/* #undef CURL_DISABLE_VERBOSE_STRINGS */

/* to make a symbol visible */
/* Definition to make a library symbol externally visible. */
/* #undef CURL_EXTERN_SYMBOL */

/* to enable hidden symbols */
/* #undef CURL_HIDDEN_SYMBOLS */

/* Use Windows LDAP implementation */
/* #undef CURL_LDAP_WIN */

Loading