Hide symbols with gcc.

With gcc >= 4 and ELF, set default visibility to hidden and make visible
only the symbols with FLAC_API or FLACPP_API.

A convenience libFLAC-static.la is created for test_libFLAC as it
depends on the hidden symbols.
This commit is contained in:
Miroslav Lichvar
2012-12-03 21:04:57 +01:00
committed by Erik de Castro Lopo
parent 18e01547ac
commit 19c78e58d7
5 changed files with 35 additions and 11 deletions

View File

@@ -55,17 +55,22 @@
* \{
*/
#if defined(FLAC__NO_DLL) || !defined(_MSC_VER)
#if defined(FLAC__NO_DLL)
#define FLACPP_API
#else
#elif defined(_MSC_VER)
#ifdef FLACPP_API_EXPORTS
#define FLACPP_API _declspec(dllexport)
#else
#define FLACPP_API _declspec(dllimport)
#endif
#elif defined(FLAC__USE_VISIBILITY_ATTR)
#define FLACPP_API __attribute__ ((visibility ("default")))
#else
#define FLACPP_API
#endif
/* These #defines will mirror the libtool-based library version number, see