Bruno Haible <br...@clisp.org> writes: > Simon Josefsson wrote: >> However, one question. The document says: >> >> 1. Add `...@cflag_visibility@' or (in a Makefile.am) >> `$(CFLAG_VISIBILITY)' to the CFLAGS for the compilation of the >> sources that make up the library. >> >> Does this include source code in helper libraries, such as gnulib? > > Yes, sure. Otherwise the symbols coming from these source files will be > exported from the library.
Ok. >> In other words, should the gnulib generated Makefile.am add the >> $(CFLAG_VISIBILITY) to AM_CFLAGS? > > Good question. I would assume that you are using the --makefile-name option, > so that you can augment/customize AM_CPPFLAGS and other automake variables? Actually I am not. How about this patch? /Simon diff --git a/ChangeLog b/ChangeLog index 86a7852..f59284d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-04 Simon Josefsson <si...@josefsson.org> + + * gnulib-tool (func_emit_lib_Makefile_am): When using the + visibility module, add $(CFLAG_VISIBILITY) to AM_CFLAGS. + 2009-03-03 Bruno Haible <br...@clisp.org> * doc/visibility.texi: Recommend to use HAVE_VISIBILITY as a C macro. diff --git a/gnulib-tool b/gnulib-tool index 5882c68..56f51dc 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -1933,6 +1933,9 @@ func_emit_lib_Makefile_am () echo echo "AM_CPPFLAGS =" fi + if echo $modules | grep -q visibility; then + echo "AM_CFLAGS $assign \$(CFLAG_VISIBILITY)" + fi echo if LC_ALL=C grep "^[a-zA-Z0-9_]*_${perhapsLT}LIBRARIES *+\{0,1\}= *$libname\\.$libext\$" allsnippets.tmp > /dev/null; then # One of the snippets already specifies an installation location for the