summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-17 18:55:32 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-17 18:55:32 +0000
commit88f2d266085cdf75bab432d4cc08f481f1cf5c3c (patch)
tree37a4af74235a2c544c0462fac713bd652567b51e
parentc757cba26f172dfa04c1d1fe75b68db373150214 (diff)
don't mix private and public libraries dependencies.
when I fixed eina's dependency on -lpthread I used all the libraries eina links to. But we should just do with -lpthread as it's a public dependency... that was in eina.pc.in and I missed. Now we have EFL_ADD_PUBLIC_LIBS() that will register for requirements_public_libs_name and use internally when eina is used. This should also fix the problem by Arvind with gcrypt. SVN revision: 82942
-rw-r--r--configure.ac2
-rw-r--r--m4/efl.m459
-rw-r--r--pc/eina.pc.in4
3 files changed, 60 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 7d06758a7..efcf86c74 100644
--- a/configure.ac
+++ b/configure.ac
@@ -711,7 +711,7 @@ EINA_CONFIG([ENABLE_LOG], [test "x${enable_log}" = "xyes"])
EFL_CHECK_THREADS
-EFL_ADD_LIBS([EINA], [${EFL_PTHREAD_LIBS}])
+EFL_ADD_PUBLIC_LIBS([EINA], [${EFL_PTHREAD_LIBS}])
EFL_ADD_CFLAGS([EINA], [${EFL_PTHREAD_CFLAGS}])
EINA_CONFIG([HAVE_PTHREAD_BARRIER], [test "x${efl_have_pthread_barrier}" = "xyes"])
diff --git a/m4/efl.m4 b/m4/efl.m4
index 90e4cb7c3..c02138bc7 100644
--- a/m4/efl.m4
+++ b/m4/efl.m4
@@ -108,7 +108,7 @@ esac
requirements_pc_[]m4_defn([DOWNEFL])="${depname} >= ${PACKAGE_VERSION} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
requirements_cflags_[]m4_defn([DOWNEFL])="-I\$(top_srcdir)/src/lib/${libdirname} -I\$(top_builddir)/src/lib/${libdirname} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
requirements_internal_libs_[]m4_defn([DOWNEFL])="lib/${libdirname}/lib${libname}.la ${requirements_internal_libs_[][]m4_defn([DOWNEFL])}"
-requirements_internal_deps_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNOTHER])} ${requirements_internal_deps_libs_[][]m4_defn([DOWNEFL])}"
+requirements_internal_deps_libs_[]m4_defn([DOWNEFL])="${requirements_public_libs_[]m4_defn([DOWNOTHER])} ${requirements_internal_deps_libs_[][]m4_defn([DOWNEFL])}"
m4_popdef([DOWNOTHER])dnl
m4_popdef([DOWNEFL])dnl
])
@@ -208,6 +208,21 @@ requirements_libs_[]m4_defn([DOWN])="${requirements_libs_[]m4_defn([DOWN])} $2"
m4_popdef([DOWN])dnl
])
+dnl EFL_ADD_PUBLIC_LIBS(PKG, PUBLIC_LIBS)
+dnl Add libraries that the EFL library will depend on when used.
+dnl
+dnl Unlike EFL_ADD_LIBS(), that is only used when generating PKG,
+dnl this one is used when linking PKG to other libraries or applications.
+dnl
+dnl For instance if you use some other library in your header that user
+dnl inclues.
+AC_DEFUN([EFL_ADD_PUBLIC_LIBS],
+[dnl
+m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
+requirements_public_libs_[]m4_defn([DOWN])="${requirements_public_libs_[]m4_defn([DOWN])} $2"
+m4_popdef([DOWN])dnl
+])
+
dnl EFL_ADD_CFLAGS(PKG, CFLAGS)
dnl Add CFLAGS that the EFL library will use
dnl See EFL_DEPEND_PKG() for pkg-config version.
@@ -220,6 +235,44 @@ m4_popdef([DOWN])dnl
dnl EFL_LIB_START(PKG)
dnl start the setup of an EFL library, defines variables and prints a notice
+dnl
+dnl Exports (AC_SUBST)
+dnl PKG_CFLAGS: what to use for CFLAGS
+dnl
+dnl PKG_LDFLAGS: what to use for LDFLAGS
+dnl
+dnl PKG_LIBS: what to use in automake's _LIBADD or _LDADD. Includes
+dnl everything else.
+dnl
+dnl PKG_INTERNAL_LIBS: all other EFL as lib/name/libname.la that this
+dnl package depend. Used in automake's _DEPENDENCIES.
+dnl
+dnl USE_PKG_LIBS: what to use in automake's _LIBADD or _LDADD when using
+dnl this PKG (PKG_LIBS + libpkg.la)
+dnl
+dnl USE_PKG_INTERNAL_LIBS: extends PKG_INTERNAL_LIBS with lib/pkg/libpkg.la
+dnl
+dnl requirements_pc_pkg: all pkg-config (pc) files used by this pkg,
+dnl includes internal EFL (used in 'Requires.private' in pkg.pc)
+dnl
+dnl requirements_libs_pkg: external libraries this package needs when
+dnl linking (used in 'Libs.private' in pkg.pc)
+dnl
+dnl requirements_public_libs_pkg: external libraries other packages need
+dnl when using this (used in 'Libs' in pkg.pc)
+dnl
+dnl requirements_cflags_pkg: what to use for CFLAGS (same as PKG_CFLAGS).
+dnl
+dnl Variables:
+dnl requirements_pc_deps_pkg: external pkg-config (pc) files used by this
+dnl pkg (used in EFL_EVAL_PKGS())
+dnl
+dnl requirements_internal_libs_pkg: all other EFL as lib/name/libname.la
+dnl that this package depend.
+dnl
+dnl requirements_internal_deps_libs_pkg: external libraries that are public
+dnl dependencies (due internal libs).
+dnl
AC_DEFUN([EFL_LIB_START],
[
m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
@@ -228,6 +281,7 @@ m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
requirements_internal_libs_[]m4_defn([DOWN])=""
requirements_internal_deps_libs_[]m4_defn([DOWN])=""
requirements_libs_[]m4_defn([DOWN])=""
+requirements_public_libs_[]m4_defn([DOWN])=""
requirements_cflags_[]m4_defn([DOWN])=""
requirements_pc_[]m4_defn([DOWN])=""
requirements_pc_deps_[]m4_defn([DOWN])=""
@@ -240,6 +294,7 @@ m4_defn([UP])_LDFLAGS="${m4_defn([UP])_LDFLAGS}"
m4_defn([UP])_CFLAGS="${m4_defn([UP])_CFLAGS}"
AC_SUBST([requirements_libs_]m4_defn([DOWN]))
+AC_SUBST([requirements_public_libs_]m4_defn([DOWN]))
AC_SUBST([requirements_cflags_]m4_defn([DOWN]))
AC_SUBST([requirements_pc_]m4_defn([DOWN]))
AC_SUBST(m4_defn([UP])[_LIBS])
@@ -271,7 +326,7 @@ case "m4_defn([DOWN])" in
esac
m4_defn([UP])_LDFLAGS="${m4_defn([UP])_LDFLAGS} ${EFL_COV_CFLAGS} ${EFL_LDFLAGS}"
-m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS} ${m4_defn([UP])_LDFLAGS} ${EFL_COV_LIBS} ${EFL_LIBS} ${requirements_internal_libs_[]m4_defn([DOWN])} ${requirements_internal_deps_libs_[]m4_defn([DOWN])} ${requirements_libs_[]m4_defn([DOWN])} ${requirements_libs_efl} "
+m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS} ${m4_defn([UP])_LDFLAGS} ${EFL_COV_LIBS} ${EFL_LIBS} ${requirements_internal_libs_[]m4_defn([DOWN])} ${requirements_internal_deps_libs_[]m4_defn([DOWN])} ${requirements_public_libs_[]m4_defn([DOWN])} ${requirements_libs_[]m4_defn([DOWN])} ${requirements_libs_efl} "
m4_defn([UP])_INTERNAL_LIBS="${m4_defn([UP])_INTERNAL_LIBS} ${requirements_internal_libs_[]m4_defn([DOWN])}"
USE_[]m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS} lib/${libdirname}/lib${libname}.la"
USE_[]m4_defn([UP])_INTERNAL_LIBS="${m4_defn([UP])_INTERNAL_LIBS} lib/${libdirname}/lib${libname}.la ${requirements_internal_deps_libs_[]m4_defn([DOWN])}"
diff --git a/pc/eina.pc.in b/pc/eina.pc.in
index c5a10f2e1..e904c9ede 100644
--- a/pc/eina.pc.in
+++ b/pc/eina.pc.in
@@ -7,6 +7,6 @@ Name: Eina
Description: A Library that implements fast data types and miscellaneous tools
Requires.private: @requirements_pc_eina@
Version: @VERSION@
-Libs: -L${libdir} -leina @EFL_PTHREAD_LIBS@
-Libs.private: @EFL_PTHREAD_LIBS@ @requirements_libs_eina@
+Libs: -L${libdir} -leina @requirements_public_libs_eina@
+Libs.private: @requirements_libs_eina@
Cflags: -I${includedir}/eina-@VMAJ@ -I${includedir}/eina-@VMAJ@/eina