Page MenuHomePhabricator

problem with EAPI on Windows (again)
Open, Incoming QueuePublic

Description

on Windows, the purpose of EAPI is twice :

  1. When compiling a library, EAPI must be defined to __declspec(dllexport) so that symbols are exported
  2. When using this library, EAPI must be defined to __declspec(dllimport)

most of the EFL libraries (exception is elementary) define EAPI line that :

#ifdef _WIN32
# ifdef EFL_BUILD
#  ifdef DLL_EXPORT
#   define EAPI __declspec(dllexport)
#  else
#   define EAPI
#  endif
# else
#  define EAPI __declspec(dllimport)
# endif

So

  1. When compiling the EFL libraries, EFL_BUILD and DLL_EXPORT must be defined (not defining DLL_EXPORT means we want a static library, but we should avoid that on Windows)
  2. When using the libraries, EFL_BUILD must not be defined

The problem now is that autotools define EFL_BUILD for libraries and binaries. See m4/efl.m4, the EFL_LIB_END function, end of line 427 (as of today). This macro is used for each EFL parts in configure.ac and each time EINA_CFLAGS, EET_CFLAGS, etc... are used (that is in Makefile_*.am). And these *_CFLAGS are used for libraries and binaries

When I first wrote the autotools, i defined EFL_BUILD directly in all the Makefile_*.am only for library

I know that autotools will be removed in favor of meson. This task is to be sure that meson will correctly define EFL_BUILD