efl/m4/ecore_check_module.m4

36 lines
1.1 KiB
Plaintext
Raw Normal View History

dnl use: ECORE_EVAS_MODULE(name, want, [DEPENDENCY-CHECK-CODE])
AC_DEFUN([ECORE_EVAS_MODULE],
[dnl
m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
have_ecore_evas_[]m4_defn([DOWN])="no"
want_module="$2"
gl-drm: Fix missing link to gbm for ecore_evas_drm and clean up build script @fix Summary: This fixes following build script problems for ecore_evas_drm engine module. 1. Missing link to gbm for ecore_evas_drm if '--enable-gl-drm' option is given. ecore_evas_drm engine is using gbm function if it builds with that config option. To be more exact, ecore_evas_gl_drm_new_internal function needs gbm. Thus we need to add gbm library linking '-lgbm' to ecore_evas_drm engine module if '--enable-gl-drm' option is given. I've added this build script to m4/ecore_check_module.m4 file. 2. Wrong gbm dependency check code in configure.ac EFL_OPTIONAL_INTERNAL_DEPEND_PKG m4 macro function is designed for checking dependency of efl internal libraries. Thus we should remove gbm pkg name when configuring ecore_evas_drm engine module. It would be better to move dependency check for gbm to m4/ecore_check_module.m4 file. And one more thing want_drm value has to be changed to want_gl_drm in ECORE_EVAS_MODULE([gl-drm]...). 3. BUILD_ECORE_EVAS_OPENGL_DRM macro is always defined in configure.ac. This kind of macro, BUILD_EFL_MODULE_NAME, has to be defined only if given module is enabled. But this macro value was just defined with no test. And it is even useless, we can use BUILD_ECORE_EVAS_GL_DRM macro which is defined by ECORE_EVAS_MODULE([gl-drm], [${want_gl_drm}],...) function. So I've removed that from configure.ac. Test Plan: 1. Configure with --enable-gl-drm: $ ./autogen.sh --enable-drm --enable-gl-drm 2. Build: $ make && make install 3. Check module.so of ecore_evas_drm engine whether it has a library dependency with gbm: $ readelf -a $EFL_GIT/src/modules/ecore_evas/engines/drm/.libs/module.so | grep NEEDED Reviewers: raster, stefan_schmidt, devilhorns Reviewed By: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1379
2014-08-28 10:36:59 -07:00
ecore_evas_engines_[]m4_defn([DOWN])[]_cflags=""
ecore_evas_engines_[]m4_defn([DOWN])[]_libs=""
if test "x$want_module" = "xyes" || test "x$want_module" = "xstatic"; then
$3
AC_DEFINE([BUILD_ECORE_EVAS_]m4_defn([UP]), [1], [Support for $1 Engine in Ecore_Evas])
have_ecore_evas_[]m4_defn([DOWN])="yes"
gl-drm: Fix missing link to gbm for ecore_evas_drm and clean up build script @fix Summary: This fixes following build script problems for ecore_evas_drm engine module. 1. Missing link to gbm for ecore_evas_drm if '--enable-gl-drm' option is given. ecore_evas_drm engine is using gbm function if it builds with that config option. To be more exact, ecore_evas_gl_drm_new_internal function needs gbm. Thus we need to add gbm library linking '-lgbm' to ecore_evas_drm engine module if '--enable-gl-drm' option is given. I've added this build script to m4/ecore_check_module.m4 file. 2. Wrong gbm dependency check code in configure.ac EFL_OPTIONAL_INTERNAL_DEPEND_PKG m4 macro function is designed for checking dependency of efl internal libraries. Thus we should remove gbm pkg name when configuring ecore_evas_drm engine module. It would be better to move dependency check for gbm to m4/ecore_check_module.m4 file. And one more thing want_drm value has to be changed to want_gl_drm in ECORE_EVAS_MODULE([gl-drm]...). 3. BUILD_ECORE_EVAS_OPENGL_DRM macro is always defined in configure.ac. This kind of macro, BUILD_EFL_MODULE_NAME, has to be defined only if given module is enabled. But this macro value was just defined with no test. And it is even useless, we can use BUILD_ECORE_EVAS_GL_DRM macro which is defined by ECORE_EVAS_MODULE([gl-drm], [${want_gl_drm}],...) function. So I've removed that from configure.ac. Test Plan: 1. Configure with --enable-gl-drm: $ ./autogen.sh --enable-drm --enable-gl-drm 2. Build: $ make && make install 3. Check module.so of ecore_evas_drm engine whether it has a library dependency with gbm: $ readelf -a $EFL_GIT/src/modules/ecore_evas/engines/drm/.libs/module.so | grep NEEDED Reviewers: raster, stefan_schmidt, devilhorns Reviewed By: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1379
2014-08-28 10:36:59 -07:00
case "$1" in
xgl-drm)
PKG_CHECK_MODULES([GBM], [gbm])
ecore_evas_engines_[]m4_defn([DOWN])[]_cflags="${GBM_CFLAGS}"
ecore_evas_engines_[]m4_defn([DOWN])[]_libs="${GBM_LIBS}"
;;
esac
fi
gl-drm: Fix missing link to gbm for ecore_evas_drm and clean up build script @fix Summary: This fixes following build script problems for ecore_evas_drm engine module. 1. Missing link to gbm for ecore_evas_drm if '--enable-gl-drm' option is given. ecore_evas_drm engine is using gbm function if it builds with that config option. To be more exact, ecore_evas_gl_drm_new_internal function needs gbm. Thus we need to add gbm library linking '-lgbm' to ecore_evas_drm engine module if '--enable-gl-drm' option is given. I've added this build script to m4/ecore_check_module.m4 file. 2. Wrong gbm dependency check code in configure.ac EFL_OPTIONAL_INTERNAL_DEPEND_PKG m4 macro function is designed for checking dependency of efl internal libraries. Thus we should remove gbm pkg name when configuring ecore_evas_drm engine module. It would be better to move dependency check for gbm to m4/ecore_check_module.m4 file. And one more thing want_drm value has to be changed to want_gl_drm in ECORE_EVAS_MODULE([gl-drm]...). 3. BUILD_ECORE_EVAS_OPENGL_DRM macro is always defined in configure.ac. This kind of macro, BUILD_EFL_MODULE_NAME, has to be defined only if given module is enabled. But this macro value was just defined with no test. And it is even useless, we can use BUILD_ECORE_EVAS_GL_DRM macro which is defined by ECORE_EVAS_MODULE([gl-drm], [${want_gl_drm}],...) function. So I've removed that from configure.ac. Test Plan: 1. Configure with --enable-gl-drm: $ ./autogen.sh --enable-drm --enable-gl-drm 2. Build: $ make && make install 3. Check module.so of ecore_evas_drm engine whether it has a library dependency with gbm: $ readelf -a $EFL_GIT/src/modules/ecore_evas/engines/drm/.libs/module.so | grep NEEDED Reviewers: raster, stefan_schmidt, devilhorns Reviewed By: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1379
2014-08-28 10:36:59 -07:00
AC_SUBST([ecore_evas_engines_]m4_defn([DOWN])[_cflags])
AC_SUBST([ecore_evas_engines_]m4_defn([DOWN])[_libs])
EFL_ADD_FEATURE([ECORE_EVAS], [$1], [${want_module}])dnl
AM_CONDITIONAL([BUILD_ECORE_EVAS_]UP, [test "x$have_ecore_evas_]m4_defn([DOWN])[" = "xyes"])dnl
m4_popdef([UP])dnl
m4_popdef([DOWN])dnl
])