diff options
author | Yang Tse <yangsita@gmail.com> | 2012-04-17 12:46:22 +0200 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2012-04-17 13:29:59 +0200 |
commit | fc2c91c206ef4695fd0a71371910c923b133dfd6 (patch) | |
tree | ed88c13b97b1cf8aa9585a08a8f6578a28661e3c | |
parent | 41191cdd54ff7f6bbb5e65bb0cd56fe0a50b5d14 (diff) | |
download | c-ares-fc2c91c206ef4695fd0a71371910c923b133dfd6.tar.gz c-ares-fc2c91c206ef4695fd0a71371910c923b133dfd6.tar.bz2 c-ares-fc2c91c206ef4695fd0a71371910c923b133dfd6.zip |
build adjustments: CARES_SYMBOL_HIDING no longer defined in config files
configure script now provides conditional definitions for Makefile.am
that result in CARES_SYMBOL_HIDING being defined by resulting makefiles
when appropriate.
-rw-r--r-- | Makefile.am | 13 | ||||
-rw-r--r-- | m4/cares-confopts.m4 | 15 |
2 files changed, 21 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am index 08d6a58..edf7b59 100644 --- a/Makefile.am +++ b/Makefile.am @@ -103,6 +103,8 @@ libcares_la_LDFLAGS = $(UNDEF) $(VER) # 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 @@ -110,12 +112,21 @@ else 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 diff --git a/m4/cares-confopts.m4 b/m4/cares-confopts.m4 index f2ab45f..c2c37f6 100644 --- a/m4/cares-confopts.m4 +++ b/m4/cares-confopts.m4 @@ -1,7 +1,7 @@ #*************************************************************************** # $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 @@ -16,7 +16,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 9 +# serial 10 dnl CARES_CHECK_OPTION_CURLDEBUG @@ -330,23 +330,26 @@ dnl ------------------------------------------------- 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) ]) |