# Add -Werror if defined
CFLAGS += @CARES_CFLAG_EXTRAS@
+CFLAG_CARES_SYMBOL_HIDING = @CFLAG_CARES_SYMBOL_HIDING@
+
# For Windows build targets, when building or using static c-ares
if USE_CPPFLAG_CARES_STATICLIB
AM_CPPFLAGS = -DCARES_STATICLIB
AM_CPPFLAGS =
endif
-# For Windows build targets, when building c-ares library
+if DOING_CARES_SYMBOL_HIDING
+if USE_CPPFLAG_CARES_BUILDING_LIBRARY
+libcares_la_CPPFLAGS = $(AM_CPPFLAGS) -DCARES_SYMBOL_HIDING -DCARES_BUILDING_LIBRARY
+else
+libcares_la_CPPFLAGS = $(AM_CPPFLAGS) -DCARES_SYMBOL_HIDING
+endif
+libcares_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_CARES_SYMBOL_HIDING)
+else
if USE_CPPFLAG_CARES_BUILDING_LIBRARY
libcares_la_CPPFLAGS = $(AM_CPPFLAGS) -DCARES_BUILDING_LIBRARY
else
libcares_la_CPPFLAGS = $(AM_CPPFLAGS)
endif
+libcares_la_CFLAGS = $(AM_CFLAGS)
+endif
# Makefile.inc provides the CSOURCES and HHEADERS defines
include Makefile.inc
#***************************************************************************
# $Id$
#
-# Copyright (C) 2008 - 2010 by Daniel Stenberg et al
+# Copyright (C) 2008 - 2012 by Daniel Stenberg et al
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted, provided
#***************************************************************************
# File version for 'aclocal' use. Keep it a single number.
-# serial 9
+# serial 10
dnl CARES_CHECK_OPTION_CURLDEBUG
dnl Depending on --enable-symbol-hiding or --disable-symbol-hiding
dnl configure option, and compiler capability to actually honor such
dnl option, this will modify compiler flags as appropriate and also
-dnl provide needed definitions for configuration file.
+dnl provide needed definitions for configuration and Makefile.am files.
dnl This macro should not be used until all compilation tests have
dnl been done to prevent interferences on other tests.
AC_DEFUN([CARES_CONFIGURE_SYMBOL_HIDING], [
AC_MSG_CHECKING([whether hiding of library internal symbols will actually happen])
+ CFLAG_CARES_SYMBOL_HIDING=""
+ doing_symbol_hiding="no"
if test x"$ac_cv_native_windows" != "xyes" &&
test "$want_symbol_hiding" = "yes" &&
test "$supports_symbol_hiding" = "yes"; then
- CFLAGS="$CFLAGS $symbol_hiding_CFLAGS"
- AC_DEFINE_UNQUOTED(CARES_SYMBOL_HIDING, 1,
- [Define to 1 to enable hiding of library internal symbols.])
+ doing_symbol_hiding="yes"
+ CFLAG_CARES_SYMBOL_HIDING="$symbol_hiding_CFLAGS"
AC_DEFINE_UNQUOTED(CARES_SYMBOL_SCOPE_EXTERN, $symbol_hiding_EXTERN,
[Definition to make a library symbol externally visible.])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
+ AM_CONDITIONAL(DOING_CARES_SYMBOL_HIDING, test x$doing_symbol_hiding = xyes)
+ AC_SUBST(CFLAG_CARES_SYMBOL_HIDING)
])