Fix building both static and shared libs on MinGW with autotools
When building both static and shared libs on MinGW with autotools, the build broke down without any error message. This commit makes such a build work
This commit is contained in:
parent
ecede0bc72
commit
7dd7f94822
@ -531,7 +531,7 @@ AH_VERBATIM([FLAC_API_EXPORTS],
|
||||
#endif
|
||||
#endif])
|
||||
|
||||
if test x$enable_shared != "xyes" ; then
|
||||
if test x$enable_static = "xyes" ; then
|
||||
dnl for correct FLAC_API
|
||||
CPPFLAGS="-DFLAC__NO_DLL $CPPFLAGS"
|
||||
fi
|
||||
|
@ -55,16 +55,23 @@
|
||||
*
|
||||
* \{
|
||||
*/
|
||||
|
||||
/* This has grown quite complicated. FLAC__NO_DLL is used by MSVC sln
|
||||
* files and CMake, which build either static or shared. autotools can
|
||||
* build static, shared or **both**. Therefore, DLL_EXPORT, which is set
|
||||
* by libtool, must override FLAC__NO_DLL on building shared components
|
||||
*/
|
||||
#if defined(_WIN32)
|
||||
|
||||
#if defined(FLAC__NO_DLL)
|
||||
#if defined(FLAC__NO_DLL) && !(defined(DLL_EXPORT))
|
||||
#define FLACPP_API
|
||||
|
||||
#elif defined(_WIN32)
|
||||
#else
|
||||
#ifdef FLACPP_API_EXPORTS
|
||||
#define FLACPP_API __declspec(dllexport)
|
||||
#else
|
||||
#define FLACPP_API __declspec(dllimport)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#elif defined(FLAC__USE_VISIBILITY_ATTR)
|
||||
#define FLACPP_API __attribute__ ((visibility ("default")))
|
||||
|
@ -56,15 +56,22 @@
|
||||
* \{
|
||||
*/
|
||||
|
||||
#if defined(FLAC__NO_DLL)
|
||||
#define FLAC_API
|
||||
/* This has grown quite complicated. FLAC__NO_DLL is used by MSVC sln
|
||||
* files and CMake, which build either static or shared. autotools can
|
||||
* build static, shared or **both**. Therefore, DLL_EXPORT, which is set
|
||||
* by libtool, must override FLAC__NO_DLL on building shared components
|
||||
*/
|
||||
#if defined(_WIN32)
|
||||
|
||||
#elif defined(_WIN32)
|
||||
#if defined(FLAC__NO_DLL) && !(defined(DLL_EXPORT))
|
||||
#define FLAC_API
|
||||
#else
|
||||
#ifdef FLAC_API_EXPORTS
|
||||
#define FLAC_API __declspec(dllexport)
|
||||
#else
|
||||
#define FLAC_API __declspec(dllimport)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#elif defined(FLAC__USE_VISIBILITY_ATTR)
|
||||
#define FLAC_API __attribute__ ((visibility ("default")))
|
||||
|
Loading…
Reference in New Issue
Block a user