From 83a42ee20ea7fc25abb61c0b7ef56ebe712d7093 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 12 Mar 2013 00:24:37 +0100 Subject: curl.h: stricter CURL_EXTERN linkage decorations logic No API change involved. Info: http://curl.haxx.se/mail/lib-2013-02/0234.html --- tests/libtest/Makefile.am | 33 +++++++++++++++++++-------------- tests/libtest/sethostname.h | 14 +++++++------- 2 files changed, 26 insertions(+), 21 deletions(-) (limited to 'tests/libtest') diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am index 256fcec1d..80707b165 100644 --- a/tests/libtest/Makefile.am +++ b/tests/libtest/Makefile.am @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. +# Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -70,11 +70,6 @@ endif LDADD = $(SUPPORTFILES_LIBS) DEPENDENCIES = $(top_builddir)/lib/libcurl.la -# Mostly for Windows build targets, when using static libcurl -if USE_CPPFLAG_CURL_STATICLIB -AM_CPPFLAGS += -DCURL_STATICLIB -endif - # Makefile.inc provides the source defines (TESTUTIL, SUPPORTFILES, # noinst_PROGRAMS, lib*_SOURCES, and lib*_CFLAGS) include Makefile.inc @@ -88,25 +83,35 @@ else noinst_LTLIBRARIES = endif +if USE_CPPFLAG_CURL_STATICLIB +AM_CPPFLAGS += -DCURL_STATICLIB +endif + AM_LDFLAGS = +AM_CFLAGS = +libhostname_la_CPPFLAGS_EXTRA = libhostname_la_LDFLAGS_EXTRA = -module -avoid-version -rpath /nowhere +libhostname_la_CFLAGS_EXTRA = if CURL_LT_SHLIB_USE_NO_UNDEFINED libhostname_la_LDFLAGS_EXTRA += -no-undefined endif +if CURL_LT_SHLIB_USE_MIMPURE_TEXT +libhostname_la_LDFLAGS_EXTRA += -mimpure-text +endif + +if DOING_CURL_SYMBOL_HIDING +libhostname_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS +libhostname_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING) +endif + +libhostname_la_CPPFLAGS = $(AM_CPPFLAGS) $(libhostname_la_CPPFLAGS_EXTRA) libhostname_la_LDFLAGS = $(AM_LDFLAGS) $(libhostname_la_LDFLAGS_EXTRA) +libhostname_la_CFLAGS = $(AM_CFLAGS) $(libhostname_la_CFLAGS_EXTRA) libhostname_la_SOURCES = sethostname.c sethostname.h libhostname_la_LIBADD = libhostname_la_DEPENDENCIES = - -if DOING_CURL_SYMBOL_HIDING -libhostname_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_HIDDEN_SYMBOLS -libhostname_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_CURL_SYMBOL_HIDING) -else -libhostname_la_CPPFLAGS = $(AM_CPPFLAGS) -libhostname_la_CFLAGS = $(AM_CFLAGS) -endif diff --git a/tests/libtest/sethostname.h b/tests/libtest/sethostname.h index e2633dd7f..192f037ab 100644 --- a/tests/libtest/sethostname.h +++ b/tests/libtest/sethostname.h @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -20,18 +20,18 @@ * ***************************************************************************/ -#if (defined(WIN32) || defined(__SYMBIAN32__)) && !defined(CURL_STATICLIB) +#ifdef CURL_STATICLIB +# define LIBHOSTNAME_EXTERN +#elif defined(WIN32) || defined(__SYMBIAN32__) # if defined(BUILDING_LIBCURL) # define LIBHOSTNAME_EXTERN __declspec(dllexport) # else # define LIBHOSTNAME_EXTERN __declspec(dllimport) # endif +#elif defined(BUILDING_LIBCURL) && defined(CURL_HIDDEN_SYMBOLS) +# define LIBHOSTNAME_EXTERN CURL_EXTERN_SYMBOL #else -# ifdef CURL_HIDDEN_SYMBOLS -# define LIBHOSTNAME_EXTERN CURL_EXTERN_SYMBOL -# else -# define LIBHOSTNAME_EXTERN -# endif +# define LIBHOSTNAME_EXTERN #endif #ifdef USE_WINSOCK -- cgit v1.2.3