Simon Josefsson wrote: > > A couple of lines in configure.ac should do it: > > > > if test "$enable_shared" = yes; then > > shared=1 > > else > > shared=0 > > fi > > AC_DEFINE_UNQUOTED([BUILDING_SHARED], [$shared], [Define when > > --enable-shared is used.]) > > I installed the following to make this easier to use for readers of the > manual. I'll update my usage of that code too, it is used in several > projects already...
Thanks Simon, for the update. The last line gives an overfull line in the PDF output, so let me add a line break. Also, there is some collision risk for a shell variable named 'shared'. I'm therefore applying this: 2022-07-10 Bruno Haible <[email protected]> lib-symbol-visibility: Improve documentation. * doc/lib-symbol-visibility.texi: Tweak BUILDING_SHARED snippet. diff --git a/doc/lib-symbol-visibility.texi b/doc/lib-symbol-visibility.texi index d8e63895d3..85ddd11f40 100644 --- a/doc/lib-symbol-visibility.texi +++ b/doc/lib-symbol-visibility.texi @@ -185,9 +185,10 @@ You may use the following @samp{configure.ac} snippet: @smallexample if test "$enable_shared" = yes; then - shared=1 + building_shared=1 else - shared=0 + building_shared=0 fi - AC_DEFINE_UNQUOTED([BUILDING_SHARED], [$shared], [Define when --enable-shared is used.]) + AC_DEFINE_UNQUOTED([BUILDING_SHARED], [$building_shared], + [Define when --enable-shared is used.]) @end smallexample
