efl: m4 is a macro-expansion language, use that.
instead of replicating common patterns all around, let's use the common patterns as m4 macros. EFL_DEPEND_PKG() will use pkg-config and add the dependency. EFL_OPTIONAL_DEPEND_PKG() will use the former, but also defines have_XYZ and does the if statement for you. SVN revision: 80402
This commit is contained in:
parent
d338bcac63
commit
4476601805
96
configure.ac
96
configure.ac
|
@ -431,11 +431,7 @@ AM_CONDITIONAL([EFL_ENABLE_TESTS], [test "x${_efl_enable_tests}" = "xyes"])
|
||||||
# check for crypto/tls library to use
|
# check for crypto/tls library to use
|
||||||
case "$build_crypto" in
|
case "$build_crypto" in
|
||||||
gnutls)
|
gnutls)
|
||||||
EFL_PKG_CHECK_STRICT([gnutls >= 2.11])
|
EFL_DEPEND_PKG([crypto], [GNUTLS], [gnutls >= 2.11])
|
||||||
|
|
||||||
AC_DEFINE([HAVE_GNUTLS], [1], [Have Gnutls support])
|
|
||||||
requirements_pc_crypto="gnutls >= 2.11 ${requirements_pc_crypto}"
|
|
||||||
requirements_pc_deps_crypto="gnutls >= 2.11 ${requirements_pc_deps_crypto}"
|
|
||||||
|
|
||||||
# libgcrypt
|
# libgcrypt
|
||||||
AC_PATH_GENERIC([libgcrypt], [], [:],
|
AC_PATH_GENERIC([libgcrypt], [], [:],
|
||||||
|
@ -444,11 +440,7 @@ case "$build_crypto" in
|
||||||
;;
|
;;
|
||||||
|
|
||||||
openssl)
|
openssl)
|
||||||
EFL_PKG_CHECK_STRICT([openssl])
|
EFL_DEPEND_PKG([crypto], [OPENSSL], [openssl])
|
||||||
|
|
||||||
AC_DEFINE([HAVE_OPENSSL], [1], [Have Openssl support])
|
|
||||||
requirements_pc_crypto="openssl ${requirements_pc_crypto}"
|
|
||||||
requirements_pc_deps_crypto="openssl ${requirements_pc_deps_crypto}"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -1453,56 +1445,31 @@ esac
|
||||||
requirements_pc_evas="eo >= ${PACKAGE_VERSION} eet >= ${PACKAGE_VERSION} eina >= ${PACKAGE_VERSION} ${requirements_pc_evas}"
|
requirements_pc_evas="eo >= ${PACKAGE_VERSION} eet >= ${PACKAGE_VERSION} eina >= ${PACKAGE_VERSION} ${requirements_pc_evas}"
|
||||||
|
|
||||||
# Freetype
|
# Freetype
|
||||||
EFL_PKG_CHECK_STRICT([freetype2 >= 9.3.0])
|
EFL_DEPEND_PKG([evas], [FREETYPE], [freetype2 >= 9.3.0])
|
||||||
requirements_pc_evas="freetype2 >= 9.3.0 ${requirements_pc_evas}"
|
|
||||||
requirements_pc_deps_evas="freetype2 >= 9.3.0 ${requirements_pc_deps_evas}"
|
|
||||||
|
|
||||||
## optional dependencies
|
## optional dependencies
|
||||||
|
|
||||||
# FontConfig
|
# FontConfig
|
||||||
have_fontconfig="no"
|
EFL_OPTIONAL_DEPEND_PKG([evas], [${want_fontconfig}],
|
||||||
if test "x${want_fontconfig}" = "xyes"; then
|
[FONTCONFIG], [fontconfig >= 2.5.0])
|
||||||
EFL_PKG_CHECK_STRICT([fontconfig >= 2.5.0])
|
|
||||||
have_fontconfig="yes"
|
|
||||||
AC_DEFINE(HAVE_FONTCONFIG, 1, [have fontconfig searching capabilities])
|
|
||||||
requirements_pc_evas="fontconfig >= 2.5.0 ${requirements_pc_evas}"
|
|
||||||
requirements_pc_deps_evas="fontconfig >= 2.5.0 ${requirements_pc_deps_evas}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# fribidi support
|
# fribidi support
|
||||||
have_fribidi="no"
|
EFL_OPTIONAL_DEPEND_PKG([evas], [${want_fribidi}],
|
||||||
if test "x${want_fribidi}" = "xyes"; then
|
[FRIBIDI], [fribidi >= 0.19.2],
|
||||||
EFL_PKG_CHECK_STRICT([fribidi >= 0.19.2])
|
[
|
||||||
have_fribidi="yes"
|
CPPFLAGS_SAVE="$CPPFLAGS"
|
||||||
AC_DEFINE([HAVE_FRIBIDI], [1], [have fribidi support])
|
CPPFLAGS="$CPPFLAGS $FRIBIDI_CFLAGS"
|
||||||
requirements_pc_evas="fribidi >= 0.19.2 ${requirements_pc_evas}"
|
AC_CHECK_SIZEOF([FriBidiChar], [], [#include <fribidi/fribidi.h>])
|
||||||
requirements_pc_deps_evas="fribidi >= 0.19.2 ${requirements_pc_deps_evas}"
|
CPPFLAGS="$CPPFLAGS_SAVE"
|
||||||
|
])
|
||||||
CPPFLAGS_SAVE="$CPPFLAGS"
|
|
||||||
CPPFLAGS="$CPPFLAGS $FRIBIDI_CFLAGS"
|
|
||||||
AC_CHECK_SIZEOF([FriBidiChar], [], [#include <fribidi/fribidi.h>])
|
|
||||||
CPPFLAGS="$CPPFLAGS_SAVE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# harfbuzz support
|
# harfbuzz support
|
||||||
have_harfbuzz="no"
|
|
||||||
have_harfbuzz_ft="no"
|
have_harfbuzz_ft="no"
|
||||||
if test "x${want_harfbuzz}" = "xyes"; then
|
EFL_OPTIONAL_DEPEND_PKG([evas], [${want_harfbuzz}],
|
||||||
EFL_PKG_CHECK_STRICT([harfbuzz >= 0.9.0])
|
[HARFBUZZ], [harfbuzz >= 0.9.0])
|
||||||
have_harfbuzz="yes"
|
|
||||||
requirements_pc_evas="harfbuzz >= 0.9.0 ${requirements_pc_evas}"
|
|
||||||
requirements_pc_deps_evas="harfbuzz >= 0.9.0 ${requirements_pc_deps_evas}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Pixman
|
# Pixman
|
||||||
have_pixman="no"
|
EFL_OPTIONAL_DEPEND_PKG([evas], [${want_pixman}], [PIXMAN], [pixman-1])
|
||||||
if test "x${want_pixman}" = "xyes"; then
|
|
||||||
EFL_PKG_CHECK_STRICT([pixman-1])
|
|
||||||
have_pixman="yes"
|
|
||||||
AC_DEFINE([HAVE_PIXMAN], [1], [have pixman for rendering])
|
|
||||||
requirements_pc_evas="pixman-1 ${requirements_pc_evas}"
|
|
||||||
requirements_pc_deps_evas="pixman-1 ${requirements_pc_deps_evas}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "x${have_pixman}" = "xyes" ; then
|
if test "x${have_pixman}" = "xyes" ; then
|
||||||
if test "x${have_pixman_font}" = "xyes" ; then
|
if test "x${have_pixman_font}" = "xyes" ; then
|
||||||
|
@ -1980,14 +1947,8 @@ requirements_pc_ecore="eo >= ${PACKAGE_VERSION} eina >= ${PACKAGE_VERSION} ${req
|
||||||
|
|
||||||
# glib
|
# glib
|
||||||
|
|
||||||
have_glib="no"
|
EFL_OPTIONAL_DEPEND_PKG([ecore], [${want_glib}], [GLIB], [glib-2.0])
|
||||||
if test "x${want_glib}" = "xyes" ; then
|
if test "x${have_glib}" = "xno"; then
|
||||||
EFL_PKG_CHECK_STRICT([glib-2.0])
|
|
||||||
have_glib="yes"
|
|
||||||
AC_DEFINE([HAVE_GLIB], [1], [Have GLib])
|
|
||||||
requirements_pc_ecore="glib-2.0 ${requirements_pc_ecore}"
|
|
||||||
requirements_pc_deps_ecore="glib-2.0 ${requirements_pc_deps_ecore}"
|
|
||||||
else
|
|
||||||
want_g_main_loop="no"
|
want_g_main_loop="no"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -2155,27 +2116,12 @@ requirements_pc_deps_ecore_con="${requirements_pc_deps_crypto} ${requirements_pc
|
||||||
requirements_libs_ecore_con="${requirements_libs_crypto} ${requirements_libs_ecore_con}"
|
requirements_libs_ecore_con="${requirements_libs_crypto} ${requirements_libs_ecore_con}"
|
||||||
|
|
||||||
# cURL
|
# cURL
|
||||||
|
EFL_OPTIONAL_DEPEND_PKG([ecore_con], [${want_curl}], [CURL], [libcurl])
|
||||||
have_curl="no"
|
|
||||||
if test "x${want_curl}" = "xyes" ; then
|
|
||||||
EFL_PKG_CHECK_STRICT([libcurl])
|
|
||||||
have_curl="yes"
|
|
||||||
AC_DEFINE([HAVE_CURL], [1], [Downloading with CURL])
|
|
||||||
requirements_pc_ecore_con="libcurl ${requirements_pc_ecore_con}"
|
|
||||||
requirements_pc_deps_ecore_con="libcurl ${requirements_pc_deps_ecore_con}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# c-ares
|
# c-ares
|
||||||
|
|
||||||
have_cares="no"
|
EFL_OPTIONAL_DEPEND_PKG([ecore_con], [${want_cares}],
|
||||||
if test "x${want_cares}" = "xyes" ; then
|
[CARES], [libcares >= 1.6.1])
|
||||||
EFL_PKG_CHECK_STRICT([libcares >= 1.6.1])
|
|
||||||
have_cares="yes"
|
|
||||||
AC_DEFINE([HAVE_CARES], [1], [Build Ecore_Con_Info with c-ares support])
|
|
||||||
requirements_pc_ecore_con="libcares >= 1.6.1 ${requirements_pc_ecore_con}"
|
|
||||||
requirements_pc_deps_ecore_con="libcares >= 1.6.1 ${requirements_pc_deps_ecore_con}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
AM_CONDITIONAL([HAVE_CARES], [test "x${have_cares}" = "xyes"])
|
AM_CONDITIONAL([HAVE_CARES], [test "x${have_cares}" = "xyes"])
|
||||||
|
|
||||||
if test "x${requirements_pc_deps_ecore_con}" != "x" ; then
|
if test "x${requirements_pc_deps_ecore_con}" != "x" ; then
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
dnl file to manage modules in efl
|
||||||
|
|
||||||
|
dnl EFL_DEPEND_PKG(EFL, NAME, PACKAGE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||||
|
dnl Adds a pkg-config dependency to an efl, AC_DEFINE() HAVE_NAME,
|
||||||
|
dnl and inserts dependencies in proper variables
|
||||||
|
AC_DEFUN([EFL_DEPEND_PKG],
|
||||||
|
[
|
||||||
|
m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
|
||||||
|
m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
|
||||||
|
m4_pushdef([UPNAME], m4_translit([$2], [-a-z], [_A-Z]))dnl
|
||||||
|
m4_pushdef([DOWNNAME], m4_translit([$2], [-A-Z], [_a-z]))dnl
|
||||||
|
|
||||||
|
have_[]m4_defn([DOWNNAME])="no"
|
||||||
|
|
||||||
|
EFL_PKG_CHECK_STRICT([$3], [
|
||||||
|
AC_DEFINE([HAVE_]m4_defn([UPNAME]), [1], [Have `]m4_defn([DOWNNAME])[' pkg-config installed.])
|
||||||
|
requirements_pc_[]m4_defn([DOWNEFL])="$3 ${requirements_pc_[][]m4_defn([DOWNEFL])}"
|
||||||
|
requirements_pc_deps_[]m4_defn([DOWNEFL])="$3 ${requirements_pc_deps_[]m4_defn([DOWNEFL])}"
|
||||||
|
have_[]m4_defn([DOWNNAME])="yes"
|
||||||
|
|
||||||
|
$4
|
||||||
|
|
||||||
|
], [$5])
|
||||||
|
|
||||||
|
m4_popdef([DOWNNAME])
|
||||||
|
m4_popdef([UPNAME])
|
||||||
|
m4_popdef([DOWNEFL])
|
||||||
|
m4_popdef([UPEFL])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl EFL_OPTIONAL_DEPEND_PKG(EFL, VARIABLE, NAME, PACKAGE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||||
|
AC_DEFUN([EFL_OPTIONAL_DEPEND_PKG],
|
||||||
|
[
|
||||||
|
m4_pushdef([DOWN], m4_translit([$3], [-A-Z], [_a-z]))dnl
|
||||||
|
|
||||||
|
have_[]m4_defn([DOWN])="no"
|
||||||
|
if test "x$2" = "xyes"; then
|
||||||
|
EFL_DEPEND_PKG([$1], [$3], [$4], [$5], [$6])
|
||||||
|
fi
|
||||||
|
|
||||||
|
m4_popdef([DOWN])
|
||||||
|
])
|
|
@ -4,8 +4,7 @@ dnl EFL_PKG_CHECK_STRICT(MODULE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||||
dnl similar to PKG_CHECK_EXISTS() that will AC_MSG_ERROR() if not found
|
dnl similar to PKG_CHECK_EXISTS() that will AC_MSG_ERROR() if not found
|
||||||
AC_DEFUN([EFL_PKG_CHECK_STRICT],
|
AC_DEFUN([EFL_PKG_CHECK_STRICT],
|
||||||
[
|
[
|
||||||
PKG_CHECK_EXISTS([$1],
|
PKG_CHECK_EXISTS([$1], [$2],
|
||||||
[m4_if([$2], [$2], [:])],
|
[m4_ifval([$3], [$3], [AC_MSG_ERROR([pkg-config missing $1])])]
|
||||||
[m4_if([$3], [$3], [AC_MSG_ERROR([pkg-config missing $1])])]
|
|
||||||
)
|
)
|
||||||
])
|
])
|
||||||
|
|
Loading…
Reference in New Issue