From 9e24b9c7afbcb81120af4cf3f6cdee49a06d8224 Mon Sep 17 00:00:00 2001
From: Yang Tse <yangsita@gmail.com>
Date: Wed, 11 Apr 2012 19:33:54 +0200
Subject: 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.
---
 lib/Makefile.am         | 11 +++++++++++
 lib/config-os400.h      | 17 +++++++++--------
 lib/config-symbian.h    |  7 ++-----
 lib/config-vxworks.h    |  5 +----
 lib/curl_config.h.cmake |  5 +----
 5 files changed, 24 insertions(+), 21 deletions(-)

(limited to 'lib')

diff --git a/lib/Makefile.am b/lib/Makefile.am
index 76fd66040..5a8b3aa95 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -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
diff --git a/lib/config-os400.h b/lib/config-os400.h
index 4d2730928..208c02903 100644
--- a/lib/config-os400.h
+++ b/lib/config-os400.h
@@ -1,6 +1,5 @@
-/* ================================================================ */
-/*    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 */
diff --git a/lib/config-symbian.h b/lib/config-symbian.h
index b4dc03288..d70498fa9 100644
--- a/lib/config-symbian.h
+++ b/lib/config-symbian.h
@@ -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 */
diff --git a/lib/config-vxworks.h b/lib/config-vxworks.h
index 53266c021..83cf72375 100644
--- a/lib/config-vxworks.h
+++ b/lib/config-vxworks.h
@@ -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 */
 
diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake
index a321302a6..68251e4a7 100644
--- a/lib/curl_config.h.cmake
+++ b/lib/curl_config.h.cmake
@@ -1,4 +1,4 @@
-/* lib/curl_config.h.in.  Generated from configure.ac by autoheader.  */
+/* lib/curl_config.h.in.  Generated somehow by cmake.  */
 
 /* when building libcurl itself */
 #cmakedefine BUILDING_LIBCURL ${BUILDING_LIBCURL}
@@ -52,9 +52,6 @@
 #define CURL_EXTERN_SYMBOL
 #endif
 
-/* to enable hidden symbols */
-#cmakedefine CURL_HIDDEN_SYMBOLS ${CURL_HIDDEN_SYMBOLS}
-
 /* Use Windows LDAP implementation */
 #cmakedefine CURL_LDAP_WIN ${CURL_LDAP_WIN}
 
-- 
cgit v1.2.3